Ignore:
Timestamp:
02/19/2005 10:16:42 PM (19 years ago)
Author:
Gerard Beekmans <gerard@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
3d31fc4
Parents:
2f9131f
Message:

Trunk is now identical to Testing

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/binutils-pass1.xml

    r2f9131f r81fd230  
    88<?dbhtml filename="binutils-pass1.html"?>
    99
     10<indexterm zone="ch-tools-binutils-pass1">
     11<primary sortas="a-Binutils">Binutils</primary>
     12<secondary>tools, pass 1</secondary></indexterm>
     13
    1014<sect2 role="package"><title/>
     15<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
    1116
    1217<segmentedlist>
     
    1621</segmentedlist>
    1722
     23<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
     24
    1825</sect2>
    1926
     
    2128<title>Installation of Binutils</title>
    2229
    23 <para>Create a build dir:</para>
     30<para>It is important that Binutils be the first package compiled
     31because both Glibc and GCC perform various tests on the available
     32linker and assembler to determine which of their own features to
     33enable.</para>
     34
     35<para>This package is known to have issues when its default
     36optimization flags (including the <parameter>-march</parameter> and
     37<parameter>-mcpu</parameter> options) are changed. If any environment
     38variables that override default optimizations have been defined, such
     39as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
     40unset them when building Binutils.</para>
     41
     42<para>The Binutils documentation recommends building Binutils outside of the
     43source directory in a dedicated build directory:</para>
    2444
    2545<screen><userinput>mkdir ../binutils-build
    2646cd ../binutils-build</userinput></screen>
    2747
    28 <note><para>If you want the SBU values you could wrap the four commands in a
    29 <command>time</command> command like this:
    30 <userinput>time { ./configure ... &amp;&amp; ... &amp;&amp; ...
    31 &amp;&amp; make install; }</userinput>.</para></note>
     48<note><para>In order for the SBU values listed in the rest of the book
     49to be of any use, measure the time it takes to build this package from
     50the configuration, up to and including the first install. To achieve
     51this easily, wrap the four commands in a <command>time</command>
     52command like this: <userinput>time { ./configure ... &amp;&amp; ...
     53&amp;&amp; ... &amp;&amp; make install; }</userinput>.</para></note>
    3254
    3355<para>Now prepare Binutils for compilation:</para>
     
    3658    --disable-nls</userinput></screen>
    3759
     60<para>The meaning of the configure options:</para>
     61
     62<variablelist>
     63<varlistentry>
     64<term><parameter>--prefix=/tools</parameter></term>
     65<listitem><para>This tells the configure script to prepare to install the Binutils
     66programs in the <filename class="directory">/tools</filename> directory.</para></listitem>
     67</varlistentry>
     68
     69<varlistentry>
     70<term><parameter>--disable-nls</parameter></term>
     71<listitem><para>This disables internationalization. This is not needed
     72for the static programs, and NLS can cause problems when linking
     73statically.</para></listitem>
     74</varlistentry>
     75</variablelist>
     76
    3877<para>Continue with compiling the package:</para>
    3978
     
    4180make LDFLAGS="-all-static"</userinput></screen>
    4281
    43 <para>Now install the package:</para>
     82<para>The meaning of the make parameters:</para>
     83
     84<variablelist>
     85<varlistentry>
     86<term><parameter>configure-host</parameter></term>
     87<listitem><para>This forces all subdirectories to be configured
     88immediately. A statically-linked build will fail without it. Use this
     89option to work around the problem.</para></listitem>
     90</varlistentry>
     91
     92<varlistentry>
     93<term><parameter>LDFLAGS="-all-static"</parameter></term>
     94<listitem><para>This tells the linker that all Binutils programs
     95should be linked statically. However, strictly speaking,
     96<parameter>"-all-static"</parameter> is passed to the
     97<command>libtool</command> program, which then passes
     98<parameter>"-static"</parameter> to the linker.</para></listitem>
     99</varlistentry>
     100</variablelist>
     101
     102<para>Compilation is now complete. Ordinarily we would now run the
     103test suite, but at this early stage the test suite framework (Tcl,
     104Expect, and DejaGNU) is not yet in place. The benefits of running the
     105tests at this point are minimal since the programs from this
     106first pass will soon be replaced by those from the second.</para>
     107
     108<para>Install the package:</para>
    44109
    45110<screen><userinput>make install</userinput></screen>
    46111
    47 <para>Now prepare the linker for the <quote>Adjusting</quote> phase later on:</para>
     112<para>Next, prepare the linker for the <quote>Adjusting</quote> phase
     113later on:</para>
    48114
    49115<screen><userinput>make -C ld clean
    50116make -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib</userinput></screen>
    51117
    52 <warning><para><emphasis>Do not yet remove</emphasis> the Binutils build and
    53 source directories. You will need them again in their current state a bit
    54 further on in this chapter.</para></warning>
     118<para>The meaning of the make parameters:</para>
     119
     120<variablelist>
     121<varlistentry>
     122<term><parameter>-C ld clean</parameter></term>
     123<listitem><para>This tells the make program to remove all compiled
     124files in the <filename class="directory">ld</filename>
     125subdirectory.</para></listitem>
     126</varlistentry>
     127
     128<varlistentry>
     129<term><parameter>-C ld LDFLAGS="-all-static"
     130LIB_PATH=/tools/lib</parameter></term>
     131<listitem><para>This option rebuilds everything in the
     132<filename class="directory">ld</filename> subdirectory. Specifying
     133the <envar>LIB_PATH</envar> Makefile variable on the command
     134line allows us to override the default value
     135and point it to the temporary tools location. The value of this variable
     136specifies the linker's default library search path. This preparation
     137is used later in the chapter.</para></listitem>
     138</varlistentry>
     139</variablelist>
     140
     141<warning><para><emphasis>Do not</emphasis> remove the Binutils
     142build and source directories yet. These will be needed again in their
     143current state later in this chapter.</para></warning>
    55144
    56145</sect2>
    57146
     147<sect2 role="content"><title/>
     148<para>Details on this package are located in <xref
     149linkend="contents-binutils" role="."/></para>
     150</sect2>
     151
    58152</sect1>
     153
Note: See TracChangeset for help on using the changeset viewer.