source: chapter05/binutils-pass2.xml@ 8eb3fe4

multilib-10.1 multilib-before-cross
Last change on this file since 8eb3fe4 was 8eb3fe4, checked in by Thomas Trepl <thomas@…>, 3 years ago

First apply of multilib-patch of April 1st, 2019

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11566 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 6.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-tools-binutils-pass2" role="wrap">
9 <?dbhtml filename="binutils-pass2.html"?>
10
11 <sect1info condition="script">
12 <productname>binutils</productname>
13 <productnumber>&binutils-version;</productnumber>
14 <address>&binutils-url;</address>
15 </sect1info>
16
17 <title>Binutils-&binutils-version; - Pass 2</title>
18
19 <indexterm zone="ch-tools-binutils-pass2">
20 <primary sortas="a-Binutils">Binutils</primary>
21 <secondary>tools, pass 2</secondary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title/>
26
27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
28 href="../chapter06/binutils.xml"
29 xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&binutils-ch5p2-sbu;</seg>
37 <seg>&binutils-ch5p2-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Binutils</title>
45
46 <para>Create a separate build directory again:</para>
47
48<screen><userinput remap="pre">mkdir -v build
49cd build</userinput></screen>
50
51 <para>Prepare Binutils for compilation:</para>
52
53<screen arch="default"><userinput remap="configure">CC=$LFS_TGT-gcc \
54AR=$LFS_TGT-ar \
55RANLIB=$LFS_TGT-ranlib \
56../configure \
57 --prefix=/tools \
58 --disable-nls \
59 --disable-werror \
60 --with-lib-path=/tools/lib \
61 --with-sysroot</userinput></screen>
62
63<screen arch="multilib"><userinput remap="configure">CC=$LFS_TGT-gcc \
64AR=$LFS_TGT-ar \
65RANLIB=$LFS_TGT-ranlib \
66../configure \
67 --prefix=/tools \
68 --disable-nls \
69 --disable-werror \
70 --with-lib-path=/tools/lib:/tools/lib32:/tools/libx32 \
71 --with-sysroot \
72 --enable-64-bit-bfd \
73 --enable-multilib</userinput></screen>
74
75 <variablelist>
76 <title>The meaning of the new configure options:</title>
77
78 <varlistentry>
79 <term><parameter>CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib</parameter></term>
80 <listitem>
81 <para>Because this is really a native build of Binutils, setting these
82 variables ensures that the build system uses the cross-compiler and
83 associated tools instead of the ones on the host system.</para>
84 </listitem>
85 </varlistentry>
86
87 <varlistentry arch="default">
88 <term><parameter>--with-lib-path=/tools/lib</parameter></term>
89 <listitem>
90 <para>This tells the configure script to specify the library
91 search path during the compilation of Binutils, resulting in
92 <filename class="directory">/tools/lib</filename> being passed
93 to the linker. This prevents the linker from searching through
94 library directories on the host.</para>
95 </listitem>
96 </varlistentry>
97
98 <varlistentry arch="multilib">
99 <term><parameter>--with-lib-path=/tools/lib:...</parameter></term>
100 <listitem>
101 <para>This tells the configure script to specify the library
102 search path during the compilation of Binutils, resulting in
103 <filename class="directory">/tools/lib</filename>,
104 <filename class="directory">/tools/lib32</filename> and
105 <filename class="directory">/tools/libx32</filename> being passed
106 to the linker. This prevents the linker from searching through
107 library directories on the host.</para>
108 </listitem>
109 </varlistentry>
110
111 <varlistentry>
112 <term><parameter>--with-sysroot</parameter></term>
113 <listitem>
114 <para>The sysroot feature enables the linker to find shared objects
115 which are required by other shared objects explicitly included on the
116 linker's command line. Without this, some packages may not build
117 successfully on some hosts.</para>
118 </listitem>
119 </varlistentry>
120
121 <varlistentry arch="multilib">
122 <term><parameter>--enable-64-bit-bfd</parameter></term>
123 <listitem>
124 <para>TODO</para>
125 </listitem>
126 </varlistentry>
127
128 <varlistentry arch="multilib">
129 <term><parameter>--enable-multilib</parameter></term>
130 <listitem>
131 <para>TODO</para>
132 </listitem>
133 </varlistentry>
134
135 </variablelist>
136
137 <para>Compile the package:</para>
138
139<screen><userinput remap="make">make</userinput></screen>
140
141 <para>Install the package:</para>
142
143<screen><userinput remap="install">make install</userinput></screen>
144
145 <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in
146 the next chapter:</para>
147
148<screen arch="default"><userinput remap="adjust">make -C ld clean
149make -C ld LIB_PATH=/usr/lib:/lib
150cp -v ld/ld-new /tools/bin</userinput></screen>
151
152<screen arch="multilib"><userinput remap="adjust">make -C ld clean
153make -C ld LIB_PATH=/usr/lib:/lib:/usr/lib32:/lib32:/usr/libx32:/libx32
154cp -v ld/ld-new /tools/bin</userinput></screen>
155
156 <variablelist>
157 <title>The meaning of the make parameters:</title>
158
159 <varlistentry>
160 <term><parameter>-C ld clean</parameter></term>
161 <listitem>
162 <para>This tells the make program to remove all compiled
163 files in the <filename class="directory">ld</filename>
164 subdirectory.</para>
165 </listitem>
166 </varlistentry>
167
168 <varlistentry>
169 <term><parameter>-C ld LIB_PATH=/usr/lib:/lib</parameter></term>
170 <listitem>
171 <para>This option rebuilds everything in the <filename
172 class="directory">ld</filename> subdirectory. Specifying the
173 <envar>LIB_PATH</envar> Makefile variable on the command line
174 allows us to override the default value of the temporary tools
175 and point it to the proper final path. The value of this variable
176 specifies the linker's default library search path. This
177 preparation is used in the next chapter.</para>
178 </listitem>
179 </varlistentry>
180
181 </variablelist>
182
183 </sect2>
184
185 <sect2 role="content">
186 <title/>
187
188 <para>Details on this package are located in
189 <xref linkend="contents-binutils" role="."/></para>
190
191 </sect2>
192
193</sect1>
Note: See TracBrowser for help on using the repository browser.