Changeset 03c845f


Ignore:
Timestamp:
07/29/2009 08:47:13 PM (15 years ago)
Author:
Matthew Burgess <matthew@…>
Branches:
6.5
Children:
c4ca803
Parents:
53eff30a
Message:

Correct and clarify toolchain explanatory notes. Fixes #2461.

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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chapter01/changelog.xml

    r53eff30a r03c845f  
    4040      <para>2009-07-29</para>
    4141      <itemizedlist>
     42        <listitem>
     43          <para>[matthew] - Correct and clarify some of the explanatory text in
     44          the toolchain technical notes. Fixes
     45          <ulink url="&lfs-ticket-root;2461">#2461</ulink>.</para>
     46        </listitem>
    4247        <listitem>
    4348          <para>[bdubbs] - Updated Acknowledgements. 
  • chapter05/toolchaintechnotes.xml

    r53eff30a r03c845f  
    1818
    1919  <para>The overall goal of <xref linkend="chapter-temporary-tools"/> is to
    20   provide a temporary environment that can be chrooted into and from which can be
    21   produced a clean, trouble-free build of the target LFS system in <xref
    22   linkend="chapter-building-system"/>. Along the way, we separate the new system
    23   from the host system as much as possible, and in doing so, build a
    24   self-contained and self-hosted toolchain. It should be noted that the build
    25   process has been designed to minimize the risks for new readers and provide
    26   maximum educational value at the same time.</para>
     20  provide a temporary environment that can be chrooted into,
     21  where a clean, trouble-free build of the target LFS system in <xref
     22  linkend="chapter-building-system"/> can be produced. Along the way, we
     23  separate the new system from the host system as much as possible, and in
     24  doing so, build a self-contained and self-hosted toolchain.
     25  The build process has been designed to minimize the risks for new
     26  readers and to provide the most educational value at the same time.</para>
    2727
    2828  <important>
     
    5555  <itemizedlist>
    5656    <listitem>
    57       <para>Slightly adjusting the name of the working platform ensures that
    58       the first build of Binutils and GCC produces a compatible cross-linker
    59       and cross-compiler. Instead of producing binaries for another architecture,
    60       the cross-linker and cross-compiler will produce binaries compatible with
    61       the current hardware.</para>
     57      <para>Slightly adjusting the name of the working platform, by changing the
     58      &quot;vendor&quot; field target triplet by way of the
     59      <envar>LFS_TGT</envar> variable, ensures that the first build of Binutils
     60      and GCC produces a compatible cross-linker and cross-compiler. Instead of
     61      producing binaries for another architecture, the cross-linker and
     62      cross-compiler will produce binaries compatible with the current
     63      hardware.</para>
    6264    </listitem>
    6365    <listitem>
     
    99101  seen during its run of <command>configure</command> is:</para>
    100102
    101 <screen><computeroutput>checking what assembler to use...
    102         /tools/i686-pc-linux-gnu/bin/as
    103 checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</computeroutput></screen>
     103<screen><computeroutput>checking what assembler to use... /tools/i686-lfs-linux-gnu/bin/as
     104checking what linker to use... /tools/i686-lfs-linux-gnu/bin/ld</computeroutput></screen>
    104105
    105106  <para>This is important for the reasons mentioned above. It also demonstrates
     
    118119  <para>The next package installed is Glibc. The most important considerations
    119120  for building Glibc are the compiler, binary tools, and kernel headers. The
    120   compiler is generally not an issue since Glibc will always use the
    121   <command>gcc</command> found in a <envar>PATH</envar> directory. The binary
    122   tools and kernel headers can be a bit more complicated. Therefore, take no
    123   risks and use the available configure switches to enforce the correct
    124   selections. After the run of <command>configure</command>, check the contents
    125   of the <filename>config.make</filename> file in the <filename
     121  compiler is generally not an issue since Glibc will always use the compiler
     122  relating to the <parameter>--host</parameter> parameter passed to its
     123  configure script, e.g. in our case,
     124  <command>i686-lfs-linux-gnu-gcc</command>. The binary tools and kernel
     125  headers can be a bit more complicated. Therefore, take no risks and use the
     126  available configure switches to enforce the correct selections. After the run
     127  of <command>configure</command>, check the contents of the
     128  <filename>config.make</filename> file in the <filename
    126129  class="directory">glibc-build</filename> directory for all important details.
    127   Note the use of <parameter>CC="gcc -B/tools/bin/"</parameter> to control which
    128   binary tools are used and the use of the <parameter>-nostdinc</parameter>
    129   and <parameter>-isystem</parameter> flags to control the compiler's include
     130  Note the use of <parameter>CC="i686-lfs-gnu-gcc"</parameter> to control which
     131  binary tools are used and the use of the <parameter>-nostdinc</parameter> and
     132  <parameter>-isystem</parameter> flags to control the compiler's include
    130133  search path. These items highlight an important aspect of the Glibc
    131134  package&mdash;it is very self-sufficient in terms of its build machinery and
    132135  generally does not rely on toolchain defaults.</para>
    133136
    134   <para>After the Glibc installation, make some adjustments to ensure that
    135   searching and linking take place only within the <filename
    136   class="directory">/tools</filename> prefix.  Install an adjusted
    137   <command>ld</command>, which has a hard-wired search path limited to
    138   <filename class="directory">/tools/lib</filename>. Then amend
    139   <command>gcc</command>'s specs file to point to the new dynamic linker in
    140   <filename class="directory">/tools/lib</filename>. This last step is vital
    141   to the whole process. As mentioned above, a hard-wired path to a dynamic
    142   linker is embedded into every Executable and Link Format (ELF)-shared
    143   executable.  This can be inspected by running:
     137  <para>After the Glibc installation, change <command>gcc</command>'s specs file
     138  to point to the new dynamic linker in <filename
     139  class="directory">/tools/lib</filename>.  This last step is vital in ensuring
     140  that searching and linking take place only within the <filename
     141  class="directory">/tools</filename> prefix. A hard-wired
     142  path to a dynamic linker is embedded into every Executable and Link Format
     143  (ELF)-shared executable.  This can be inspected by running:
    144144  <userinput>readelf -l &lt;name of binary&gt; | grep interpreter</userinput>.
    145   Amending gcc's specs file ensures that every program compiled from here
    146   through the end of this chapter will use the new dynamic linker in
    147   <filename class="directory">/tools/lib</filename>.</para>
     145  Amending <command>gcc</command>'s specs file ensures that every program
     146  compiled from here through the end of this chapter will use the new dynamic
     147  linker in <filename class="directory">/tools/lib</filename>.</para>
    148148
    149149  <para>For the second pass of GCC, its sources also need to be modified
     
    165165  installed is Glibc, due to its self-sufficient nature mentioned above.
    166166  Once this Glibc is installed into <filename
    167   class="directory">/usr</filename>, perform a quick changeover of the
    168   toolchain defaults, then proceed in building the rest of the target
     167  class="directory">/usr</filename>, we will perform a quick changeover of the
     168  toolchain defaults, and then proceed in building the rest of the target
    169169  LFS system.</para>
    170170
Note: See TracChangeset for help on using the changeset viewer.