Changeset f84d8a6
- Timestamp:
- 11/03/2022 06:12:33 PM (18 months ago)
- Branches:
- 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/update-glibc
- Children:
- 172185a9
- Parents:
- 2c8cb17
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
part3intro/toolchaintechnotes.xml
r2c8cb17 rf84d8a6 202 202 <envar>LFS_TGT</envar> variable so it says "lfs". We also use the 203 203 <parameter>--with-sysroot</parameter> option when building the cross-linker and 204 cross-compiler to tell them where to find the needed host files. This204 cross-compiler, to tell them where to find the needed host files. This 205 205 ensures that none of the other programs built in <xref 206 206 linkend="chapter-temporary-tools"/> can link to libraries on the build … … 239 239 lfs</quote> means the commands are run in a chrooted environment.</para> 240 240 241 <para> Now, there is more about cross-compiling: the C language is not242 just a compiler, but also defines a standard library. In this book, the241 <para>This is not yet the end of the story. The C language is not 242 merely a compiler; it also defines a standard library. In this book, the 243 243 GNU C library, named glibc, is used (there is an alternative, "musl"). This library must 244 244 be compiled for the LFS machine; that is, using the cross-compiler cc1. … … 257 257 build a fully functional libstdc++ with the degraded libgcc, but cc1 258 258 is the only compiler available for building the C/C++ libraries 259 during stage 2. Of course, the compiler built by stage 2, cc-lfs,260 would be able to build those libraries, but:</para>259 during stage 2. There are two reasons we don't immediately use the 260 compiler built in stage 2, cc-lfs, to build those libraries.</para> 261 261 262 262 <itemizedlist> 263 263 <listitem> 264 264 <para> 265 Generally cc-lfs cannot run on pc (the host distro). Despitethe266 triplets of pc and lfs are compatible toeach other, an executable267 for lfs will depend on glibc-&glibc-version; whilethe host distro268 may utilize a different libc implementation (for example, musl)or265 Generally speaking, cc-lfs cannot run on pc (the host system). Even though the 266 triplets for pc and lfs are compatible with each other, an executable 267 for lfs must depend on glibc-&glibc-version;; the host distro 268 may utilize either a different implementation of libc (for example, musl), or 269 269 a previous release of glibc (for example, glibc-2.13). 270 270 </para> … … 272 272 <listitem> 273 273 <para> 274 Even if cc-lfs happens torun on pc, using it on pc would create274 Even if cc-lfs can run on pc, using it on pc would create 275 275 a risk of linking to the pc libraries, since cc-lfs is a native 276 276 compiler. … … 280 280 281 281 <para>So when we build gcc stage 2, we instruct the building system to 282 rebuild libgcc and libstdc++ with cc1, but link libstdc++ to the newly283 rebuilt libgcc instead of the degraded build. Thenthe rebuilt284 libstdc++ will befully functional.</para>282 rebuild libgcc and libstdc++ with cc1, but we link libstdc++ to the newly 283 rebuilt libgcc instead of the old, degraded build. This makes the rebuilt 284 libstdc++ fully functional.</para> 285 285 286 286 <para>In &ch-final; (or <quote>stage 3</quote>), all the packages needed for 287 287 the LFS system are built. Even if a package has already been installed into 288 288 the LFS system in a previous chapter, we still rebuild the package. The main reason for 289 rebuilding these packages is to make them stable: if we reinstall a LFS290 package on a complete LFS system, theinstalled content of the package291 should be the same as the content of the same package when installed in289 rebuilding these packages is to make them stable: if we reinstall an LFS 290 package on a completed LFS system, the reinstalled content of the package 291 should be the same as the content of the same package when first installed in 292 292 &ch-final;. The temporary packages installed in &ch-tmp-cross; or 293 293 &ch-tmp-chroot; cannot satisfy this requirement, because some of them
Note:
See TracChangeset
for help on using the changeset viewer.