Ignore:
Timestamp:
05/30/2004 01:41:04 PM (20 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
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.0, 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:
07f719a
Parents:
b711e1d
Message:

Tagging corrections in chapters 5.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter05/toolchaintechnotes.xml

    rb711e1d r574b0ea  
    2828many folks the target triplet will probably be
    2929<emphasis>i686-pc-linux-gnu</emphasis>. A simple way to determine your target
    30 triplet is to run the <filename>config.guess</filename> script that comes with
     30triplet is to run the <command>config.guess</command> script that comes with
    3131the source for many packages. Unpack the Binutils sources and run the script:
    3232<userinput>./config.guess</userinput> and note the output.</para>
     
    3535<emphasis>dynamic linker</emphasis>, often also referred to as the
    3636<emphasis>dynamic loader</emphasis>, not to be confused with the standard linker
    37 <emphasis>ld</emphasis> that is part of Binutils. The dynamic linker is provided
     37<command>ld</command> that is part of Binutils. The dynamic linker is provided
    3838by Glibc and has the job of finding and loading the shared libraries needed by a
    3939program, preparing the program to run and then running it. For most folks the
    40 name of the dynamic linker will be <emphasis>ld-linux.so.2</emphasis>. On
     40name of the dynamic linker will be <filename>ld-linux.so.2</filename>. On
    4141platforms that are less prevalent, the name might be
    42 <emphasis>ld.so.1</emphasis> and newer 64 bit platforms might even have
     42<filename>ld.so.1</filename> and newer 64 bit platforms might even have
    4343something completely different. You should be able to determine the name
    4444of your platform's dynamic linker by looking in the
     
    6464
    6565<listitem><para>Careful manipulation of <command>gcc</command>'s
    66 <emphasis>specs</emphasis> file to tell the compiler which target dynamic
     66<filename>specs</filename> file to tell the compiler which target dynamic
    6767linker will be used.</para></listitem>
    6868</itemizedlist>
     
    8282the tools in one location are hard linked to the other. An important facet of
    8383the linker is its library search order. Detailed information can be obtained
    84 from <command>ld</command> by passing it the <emphasis>--verbose</emphasis>
     84from <command>ld</command> by passing it the <parameter>--verbose</parameter>
    8585flag. For example: <command>ld --verbose | grep SEARCH</command> will
    8686show you the current search paths and their order. You can see what files are
    8787actually linked by <command>ld</command> by compiling a dummy program and
    88 passing the <emphasis>--verbose</emphasis> switch to the linker. For example:
    89 <command>gcc dummy.c -Wl,--verbose 2&gt;&amp;1 | grep succeeded</command>
     88passing the <parameter>--verbose</parameter> switch to the linker. For example:
     89<userinput>gcc dummy.c -Wl,--verbose 2&gt;&amp;1 | grep succeeded</userinput>
    9090will show you all the files successfully opened during the linking.</para>
    9191
     
    9393<command>./configure</command> you'll see, for example:</para>
    9494
    95 <blockquote><screen>checking what assembler to use... /tools/i686-pc-linux-gnu/bin/as
    96 checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</screen></blockquote>
     95<blockquote><screen><computeroutput>checking what assembler to use... /tools/i686-pc-linux-gnu/bin/as
     96checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</computeroutput></screen></blockquote>
    9797
    9898<para>This is important for the reasons mentioned above. It also demonstrates
     
    101101itself, the same search paths are not necessarily used. You can find out which
    102102standard linker <command>gcc</command> will use by running:
    103 <command>gcc -print-prog-name=ld</command>.
     103<userinput>gcc -print-prog-name=ld</userinput>.
    104104Detailed information can be obtained from <command>gcc</command> by passing
    105 it the <emphasis>-v</emphasis> flag while compiling a dummy program. For
    106 example: <command>gcc -v dummy.c</command> will show you detailed
     105it the <parameter>-v</parameter> flag while compiling a dummy program. For
     106example: <userinput>gcc -v dummy.c</userinput> will show you detailed
    107107information about the preprocessor, compilation and assembly stages, including
    108108<command>gcc</command>'s include search paths and their order.</para>
     
    118118<filename class="directory">glibc-build</filename> directory for all the
    119119important details. You'll note some interesting items like the use of
    120 <emphasis>CC="gcc -B/tools/bin/"</emphasis> to control which binary tools are
    121 used, and also the use of the <emphasis>-nostdinc</emphasis> and
    122 <emphasis>-isystem</emphasis> flags to control the compiler's include search
     120<parameter>CC="gcc -B/tools/bin/"</parameter> to control which binary tools are
     121used, and also the use of the <parameter>-nostdinc</parameter> and
     122<parameter>-isystem</parameter> flags to control the compiler's include search
    123123path. These items help to highlight an important aspect of the Glibc package:
    124124it is very self-sufficient in terms of its build machinery and generally does
     
    126126
    127127<para>After the Glibc installation, we make some adjustments to ensure that
    128 searching and linking take place only within our <filename>/tools</filename>
     128searching and linking take place only within our <filename class="directory">/tools</filename>
    129129prefix. We install an adjusted <command>ld</command>, which has a hard-wired
    130130search path limited to <filename class="directory">/tools/lib</filename>. Then
     
    134134hard-wired path to a dynamic linker is embedded into every ELF shared
    135135executable. You can inspect this by running:
    136 <command>readelf -l &lt;name of binary&gt; | grep interpreter</command>.
     136<userinput>readelf -l &lt;name of binary&gt; | grep interpreter</userinput>.
    137137By amending <command>gcc</command>'s specs file, we are ensuring that every
    138138program compiled from here through the end of this chapter will use our new
     
    146146
    147147<para>During the second pass of Binutils, we are able to utilize the
    148 <emphasis>--with-lib-path</emphasis> configure switch to control
     148<parameter>--with-lib-path</parameter> configure switch to control
    149149<command>ld</command>'s library search path. From this point onwards, the
    150150core toolchain is self-contained and self-hosted. The remainder of the
Note: See TracChangeset for help on using the changeset viewer.