[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[81109e3] | 7 |
|
---|
[9652249] | 8 | <sect1 id="ch-tools-binutils-pass1" role="wrap">
|
---|
[81109e3] | 9 | <?dbhtml filename="binutils-pass1.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Binutils-&binutils-version; - Pass 1</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-tools-binutils-pass1">
|
---|
| 14 | <primary sortas="a-Binutils">Binutils</primary>
|
---|
| 15 | <secondary>tools, pass 1</secondary>
|
---|
| 16 | </indexterm>
|
---|
[bc82645e] | 17 |
|
---|
[81109e3] | 18 | <sect2 role="package">
|
---|
| 19 | <title/>
|
---|
[81fd230] | 20 |
|
---|
[81109e3] | 21 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
| 22 | href="../chapter06/binutils.xml"
|
---|
| 23 | xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
---|
[673b0d8] | 24 |
|
---|
[81109e3] | 25 | <segmentedlist>
|
---|
| 26 | <segtitle>&buildtime;</segtitle>
|
---|
| 27 | <segtitle>&diskspace;</segtitle>
|
---|
[673b0d8] | 28 |
|
---|
[81109e3] | 29 | <seglistitem>
|
---|
[e4a5635] | 30 | <seg>&binutils-ch5p1-sbu;</seg>
|
---|
| 31 | <seg>&binutils-ch5p1-du;</seg>
|
---|
[81109e3] | 32 | </seglistitem>
|
---|
| 33 | </segmentedlist>
|
---|
[81fd230] | 34 |
|
---|
[81109e3] | 35 | </sect2>
|
---|
[73aedd1d] | 36 |
|
---|
[81109e3] | 37 | <sect2 role="installation">
|
---|
| 38 | <title>Installation of Binutils</title>
|
---|
[81fd230] | 39 |
|
---|
[81109e3] | 40 | <para>It is important that Binutils be the first package compiled
|
---|
| 41 | because both Glibc and GCC perform various tests on the available
|
---|
| 42 | linker and assembler to determine which of their own features to
|
---|
| 43 | enable.</para>
|
---|
| 44 |
|
---|
| 45 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
| 46 | source directory in a dedicated build directory:</para>
|
---|
[3d36131c] | 47 |
|
---|
[5998892] | 48 | <screen><userinput>mkdir -v ../binutils-build
|
---|
[73aedd1d] | 49 | cd ../binutils-build</userinput></screen>
|
---|
| 50 |
|
---|
[81109e3] | 51 | <note>
|
---|
| 52 | <para>In order for the SBU values listed in the rest of the book
|
---|
| 53 | to be of any use, measure the time it takes to build this package from
|
---|
| 54 | the configuration, up to and including the first install. To achieve
|
---|
| 55 | this easily, wrap the three commands in a <command>time</command>
|
---|
| 56 | command like this: <userinput>time { ./configure ... && make
|
---|
| 57 | && make install; }</userinput>.</para>
|
---|
| 58 | </note>
|
---|
[73aedd1d] | 59 |
|
---|
[81109e3] | 60 | <para>Now prepare Binutils for compilation:</para>
|
---|
[73aedd1d] | 61 |
|
---|
[1652151] | 62 | <screen><userinput>CC="gcc -B/usr/bin/" ../binutils-&binutils-version;/configure \
|
---|
| 63 | --prefix=/tools --disable-nls</userinput></screen>
|
---|
[73aedd1d] | 64 |
|
---|
[81109e3] | 65 | <variablelist>
|
---|
| 66 | <title>The meaning of the configure options:</title>
|
---|
| 67 |
|
---|
[acec478] | 68 | <varlistentry>
|
---|
| 69 | <term><envar>CC="gcc -B/usr/bin/"</envar></term>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>This forces <command>gcc</command> to prefer the linker from
|
---|
| 72 | the host in <filename class="directory">/usr/bin</filename>. This
|
---|
| 73 | is necessary on some hosts where the new <command>ld</command>
|
---|
| 74 | built here is not compatible with the host's <command>gcc</command>.
|
---|
| 75 | </para>
|
---|
| 76 | </listitem>
|
---|
| 77 | </varlistentry>
|
---|
| 78 |
|
---|
[81109e3] | 79 | <varlistentry>
|
---|
| 80 | <term><parameter>--prefix=/tools</parameter></term>
|
---|
| 81 | <listitem>
|
---|
| 82 | <para>This tells the configure script to prepare to install the
|
---|
| 83 | Binutils programs in the <filename class="directory">/tools</filename>
|
---|
| 84 | directory.</para>
|
---|
| 85 | </listitem>
|
---|
| 86 | </varlistentry>
|
---|
[81fd230] | 87 |
|
---|
[81109e3] | 88 | <varlistentry>
|
---|
| 89 | <term><parameter>--disable-nls</parameter></term>
|
---|
| 90 | <listitem>
|
---|
| 91 | <para>This disables internationalization as i18n is not needed for the
|
---|
| 92 | temporary tools.</para>
|
---|
| 93 | </listitem>
|
---|
| 94 | </varlistentry>
|
---|
[81fd230] | 95 |
|
---|
[81109e3] | 96 | </variablelist>
|
---|
[81fd230] | 97 |
|
---|
[81109e3] | 98 | <para>Continue with compiling the package:</para>
|
---|
[73aedd1d] | 99 |
|
---|
[516b668] | 100 | <screen><userinput>make</userinput></screen>
|
---|
[81fd230] | 101 |
|
---|
[81109e3] | 102 | <para>Compilation is now complete. Ordinarily we would now run the
|
---|
| 103 | test suite, but at this early stage the test suite framework (Tcl,
|
---|
| 104 | Expect, and DejaGNU) is not yet in place. The benefits of running the
|
---|
| 105 | tests at this point are minimal since the programs from this
|
---|
| 106 | first pass will soon be replaced by those from the second.</para>
|
---|
[81fd230] | 107 |
|
---|
[81109e3] | 108 | <para>Install the package:</para>
|
---|
[73aedd1d] | 109 |
|
---|
| 110 | <screen><userinput>make install</userinput></screen>
|
---|
| 111 |
|
---|
[81109e3] | 112 | <para>Next, prepare the linker for the <quote>Adjusting</quote> phase
|
---|
| 113 | later on:</para>
|
---|
[73aedd1d] | 114 |
|
---|
| 115 | <screen><userinput>make -C ld clean
|
---|
[a11b40f] | 116 | make -C ld LIB_PATH=/tools/lib
|
---|
[62d3362] | 117 | cp -v ld/ld-new /tools/bin</userinput></screen>
|
---|
[73aedd1d] | 118 |
|
---|
[81109e3] | 119 | <variablelist>
|
---|
| 120 | <title>The meaning of the make parameters:</title>
|
---|
| 121 |
|
---|
| 122 | <varlistentry>
|
---|
| 123 | <term><parameter>-C ld clean</parameter></term>
|
---|
| 124 | <listitem>
|
---|
| 125 | <para>This tells the make program to remove all compiled
|
---|
| 126 | files in the <filename class="directory">ld</filename>
|
---|
| 127 | subdirectory.</para>
|
---|
| 128 | </listitem>
|
---|
| 129 | </varlistentry>
|
---|
| 130 |
|
---|
| 131 | <varlistentry>
|
---|
[a11b40f] | 132 | <term><parameter>-C ld LIB_PATH=/tools/lib</parameter></term>
|
---|
[81109e3] | 133 | <listitem>
|
---|
| 134 | <para>This option rebuilds everything in the <filename
|
---|
[a11b40f] | 135 | class="directory">ld</filename> subdirectory. Specifying the
|
---|
[81109e3] | 136 | <envar>LIB_PATH</envar> Makefile variable on the command line
|
---|
| 137 | allows us to override the default value and point it to the
|
---|
| 138 | temporary tools location. The value of this variable specifies
|
---|
| 139 | the linker's default library search path. This preparation is
|
---|
| 140 | used later in the chapter.</para>
|
---|
| 141 | </listitem>
|
---|
| 142 | </varlistentry>
|
---|
| 143 |
|
---|
| 144 | </variablelist>
|
---|
| 145 |
|
---|
| 146 | </sect2>
|
---|
| 147 |
|
---|
| 148 | <sect2 role="content">
|
---|
| 149 | <title/>
|
---|
| 150 |
|
---|
| 151 | <para>Details on this package are located in
|
---|
| 152 | <xref linkend="contents-binutils" role="."/></para>
|
---|
| 153 |
|
---|
| 154 | </sect2>
|
---|
[81fd230] | 155 |
|
---|
[bc82645e] | 156 | </sect1>
|
---|