Changeset af9063d
- Timestamp:
- 07/29/2009 08:46:21 PM (15 years ago)
- 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.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:
- 1435e8f
- Parents:
- 420a2a21
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter01/changelog.xml
r420a2a21 raf9063d 40 40 <para>2009-07-29</para> 41 41 <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> 42 47 <listitem> 43 48 <para>[bdubbs] - Updated Acknowledgements. -
chapter05/toolchaintechnotes.xml
r420a2a21 raf9063d 18 18 19 19 <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 be21 produceda clean, trouble-free build of the target LFS system in <xref22 linkend="chapter-building-system"/> . Along the way, we separate the new system23 from the host system as much as possible, and in doing so, build a24 self-contained and self-hosted toolchain. It should be noted that the build25 process has been designed to minimize the risks for new readers and provide26 maximumeducational 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> 27 27 28 28 <important> … … 55 55 <itemizedlist> 56 56 <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 "vendor" 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> 62 64 </listitem> 63 65 <listitem> … … 99 101 seen during its run of <command>configure</command> is:</para> 100 102 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 104 checking what linker to use... /tools/i686-lfs-linux-gnu/bin/ld</computeroutput></screen> 104 105 105 106 <para>This is important for the reasons mentioned above. It also demonstrates … … 118 119 <para>The next package installed is Glibc. The most important considerations 119 120 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 126 129 class="directory">glibc-build</filename> directory for all important details. 127 Note the use of <parameter>CC=" gcc -B/tools/bin/"</parameter> to control which128 binary tools are used and the use of the <parameter>-nostdinc</parameter> 129 and<parameter>-isystem</parameter> flags to control the compiler's include130 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 130 133 search path. These items highlight an important aspect of the Glibc 131 134 package—it is very self-sufficient in terms of its build machinery and 132 135 generally does not rely on toolchain defaults.</para> 133 136 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: 144 144 <userinput>readelf -l <name of binary> | grep interpreter</userinput>. 145 Amending gcc's specs file ensures that every program compiled from here146 through the end of this chapter will use the new dynamic linker in147 <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> 148 148 149 149 <para>For the second pass of GCC, its sources also need to be modified … … 165 165 installed is Glibc, due to its self-sufficient nature mentioned above. 166 166 Once this Glibc is installed into <filename 167 class="directory">/usr</filename>, perform a quick changeover of the168 toolchain defaults, then proceed in building the rest of the target167 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 169 169 LFS system.</para> 170 170
Note:
See TracChangeset
for help on using the changeset viewer.