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