diff --git a/chapter04/aboutsbus.xml b/chapter04/aboutsbus.xml index 646fe2875..1928423ea 100644 --- a/chapter04/aboutsbus.xml +++ b/chapter04/aboutsbus.xml @@ -41,7 +41,7 @@ compilation time for a package can be reduced by performing a "parallel make" by either setting an environment variable or telling the make program how many processors are available. For - instance, an Intel i5-6500 COU can support four simultaneous processes with: + instance, an Intel i5-6500 CPU can support four simultaneous processes with: export MAKEFLAGS='-j4' diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml index e91c64a62..00816c94a 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -63,13 +63,10 @@ cd build to be of any use, measure the time it takes to build this package from the configuration, up to and including the first install. To achieve this easily, wrap the commands in a time - command like this: time { ./configure ... && ... + command like this: time { ./configure ... && make && make install; }. - + Now prepare Binutils for compilation: ../configure --prefix=$LFS/tools \ @@ -85,7 +82,7 @@ cd build --prefix=$LFS/tools This tells the configure script to prepare to install the - Binutils programs in the $LFS/tools directory. @@ -97,22 +94,14 @@ cd build $LFS for the target system libraries as needed. - + --target=$LFS_TGT Because the machine description in the LFS_TGT variable is slightly different than the value returned by the config.guess script, this switch will tell the - configure script to adjust Binutil's build system + configure script to adjust binutil's build system for building a cross linker. diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 7db6408c2..2f8145713 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -132,36 +132,45 @@ cd build - --disable-shared + --enable-initfini-array - This switch forces GCC to link its internal libraries - statically. We need this because the shared libraries require glibc, - which is not yet installed on the target system. + This switch forces the use of some internal data structures + that are needed but cannot be detected when building a cross + compiler. - --disable-decimal-float, --disable-threads, - --disable-libatomic, --disable-libgomp, - --disable-libquadmath, --disable-libssp, --disable-libvtv, - --disable-libstdcxx + --disable-shared - These switches disable support for the decimal floating point - extension, threading, libatomic, libgomp, libquadmath, libssp, - libvtv, and the C++ standard library respectively. These features - will fail to compile when building a cross-compiler and are not - necessary for the task of cross-compiling the temporary libc. + This switch forces GCC to link its internal libraries + statically. We need this because the shared libraries require glibc, + which is not yet installed on the target system. --disable-multilib - On x86_64, LFS does not yet support a multilib configuration. + On x86_64, LFS does not support a multilib configuration. This switch is harmless for x86. + + --disable-decimal-float, --disable-threads, + --disable-libatomic, --disable-libgomp, + --disable-libquadmath, --disable-libssp, --disable-libvtv, + --disable-libstdcxx + + These switches disable support for the decimal floating point + extension, threading, libatomic, libgomp, libquadmath, libssp, + libvtv, and the C++ standard library respectively. These features + will fail to compile when building a cross-compiler and are not + necessary for the task of cross-compiling the temporary libc. + + + --enable-languages=c,c++ diff --git a/chapter05/generalinstructions.xml b/chapter05/generalinstructions.xml index 05b88b98c..b0a5377e1 100644 --- a/chapter05/generalinstructions.xml +++ b/chapter05/generalinstructions.xml @@ -18,7 +18,7 @@ Several of the packages are patched before compilation, but only when the patch is needed to circumvent a problem. A patch is often needed in - both this and the next chapter, but sometimes in only one or the other. + both this and the following chapters, but sometimes in only one location. Therefore, do not be concerned if instructions for a downloaded patch seem to be missing. Warning messages about offset or fuzz may also be encountered when applying a patch. Do @@ -93,8 +93,8 @@ Using the tar program, extract the package - to be built. In Chapter 5, ensure you are the lfs - user when extracting the package. + to be built. In Chapters 5 and 6, ensure you are + the lfs user when extracting the package. Change to the directory created when the package was diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index d6974bb21..361dd0e58 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -211,14 +211,14 @@ readelf -l a.out | grep '/ld-linux' - Building packages in the next sections will serve as an + Building packages in the next chapter will serve as an additional check that the toolchain has been built properly. If some package, especially binutils-pass2 or gcc-pass2, fails to build, it is an indication that something has gone wrong with the previous Binutils, GCC, or Glibc installations. Now that our cross-toolchain is complete, finalize the installation - of the limits.h header. For doing so, run an utility provided by the GCC + of the limits.h header. For doing so, run a utility provided by the GCC developers: $LFS/tools/libexec/gcc/$LFS_TGT/&gcc-version;/install-tools/mkheaders diff --git a/chapter05/libstdc++.xml b/chapter05/libstdc++.xml index 3a1b0f2bf..5058be9a5 100644 --- a/chapter05/libstdc++.xml +++ b/chapter05/libstdc++.xml @@ -53,12 +53,12 @@ gcc-&gcc-version; directory. - Create a separate build directory for Libstdc++ and enter it: + Create a separate build directory for libstdc++ and enter it: mkdir -v build cd build - Prepare Libstdc++ for compilation: + Prepare libstdc++ for compilation: ../libstdc++-v3/configure \ --host=$LFS_TGT \ @@ -75,7 +75,7 @@ cd build --host=... - Indicates to use the cross compiler we have just built + Specifies the use the cross compiler we have just built instead of the one in /usr/bin. @@ -91,9 +91,9 @@ cd build --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version; - This is the location where the standard include files are - searched by the C++ compiler. In a normal build, this information - is automatically passed to the Libstdc++ configure + This is the location where the C++ compiler should search for the + standard include files. In a normal build, this information + is automatically passed to the libstdc++ configure options from the top level directory. In our case, this information must be explicitly given. diff --git a/chapter05/toolchaintechnotes.xml b/chapter05/toolchaintechnotes.xml index 376337662..9e582e345 100644 --- a/chapter05/toolchaintechnotes.xml +++ b/chapter05/toolchaintechnotes.xml @@ -16,13 +16,14 @@ clearer after performing an actual build. This section can be referred to at any time during the process. - The overall goal of is to - produce a temporary area that contains a known-good set of tools that can be - isolated from the host system. By using chroot, the - commands in the remaining chapters will be contained within that environment, - ensuring a clean, trouble-free build of the target LFS system. The build - process has been designed to minimize the risks for new readers and to provide - the most educational value at the same time. + The overall goal of this chapter and is to produce a temporary area that + contains a known-good set of tools that can be isolated from the host system. + By using chroot, the commands in the remaining chapters + will be contained within that environment, ensuring a clean, trouble-free + build of the target LFS system. The build process has been designed to + minimize the risks for new readers and to provide the most educational value + at the same time. The build process is based on the process of cross-compilation. Cross-compilation is normally used @@ -143,7 +144,7 @@ appearing, that proved insufficient. The word triplet remained. A simple way to determine your machine triplet is to run the config.guess - script that comes with the source for many packages. Unpack the Binutils + script that comes with the source for many packages. Unpack the binutils sources and run the script: ./config.guess and note the output. For example, for a 32-bit Intel processor the output will be i686-pc-linux-gnu. On a 64-bit @@ -151,7 +152,7 @@ Also be aware of the name of the platform's dynamic linker, often referred to as the dynamic loader (not to be confused with the standard - linker ld that is part of Binutils). The dynamic linker + linker ld that is part of binutils). The dynamic linker provided by Glibc finds and loads the shared libraries needed by a program, prepares the program to run, and then runs it. The name of the dynamic linker for a 32-bit Intel machine will be In order to fake a cross compilation, the name of the host triplet is slightly adjusted by changing the "vendor" field in the LFS_TGT variable. We also use the - --with-sysroot when building the cross linker and - cross compiler, to tell them where to find the needed host files. This - ensures none of the other programs built in --with-sysroot option when building the cross linker and + cross compiler to tell them where to find the needed host files. This + ensures that none of the other programs built in can link to libraries on the build machine. Only two stages are mandatory, and one more for tests: @@ -215,7 +216,7 @@ internal library is named libgcc, and must be linked to the glibc library to be fully functional! Furthermore, the standard library for C++ (libstdc++) also needs being linked to glibc. The solution - to this chicken and egg problem is to first build a degraded cc1+libgcc, + to this chicken and egg problem is to first build a degraded cc1 based libgcc, lacking some fuctionalities such as threads and exception handling, then build glibc using this degraded compiler (glibc itself is not degraded), then build libstdc++. But this last library will lack the @@ -225,8 +226,8 @@ paragraph is that cc1 is unable to build a fully functional libstdc++, but this is the only compiler available for building the C/C++ libraries during stage 2! Of course, the compiler built during stage 2, cc-lfs, - would be able to build those libraries, but (i) the build system of - gcc does not know that it is usable on pc, and (ii) using it on pc + would be able to build those libraries, but (1) the build system of + gcc does not know that it is usable on pc, and (2) using it on pc would be at risk of linking to the pc libraries, since cc-lfs is a native compiler. So we have to build libstdc++ later, in chroot. @@ -306,17 +307,18 @@ checking what linker to use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/ld - As said above, the standard C++ library is compiled next, followed - by all the programs that need themselves to be built. The install step - uses the DESTDIR variable to have the programs land into - the LFS filesystem. + As said above, the standard C++ library is compiled next, followed in + Chapter 6 by all the programs that need themselves to be built. The install + step of libstdc++ uses the DESTDIR variable to have the + programs land into the LFS filesystem. - Then the native lfs compiler is built. First Binutils Pass 2, with - the same DESTDIR install as the other programs, then the - second pass of GCC, omitting libstdc++ and other non-important libraries. - Due to some weird logic in GCC's configure script, - CC_FOR_TARGET ends up as cc when host - is the same as target, but is different from build. This is why + In Chapter 7 the native lfs compiler is built. First binutils-pass2, + with the same DESTDIR install as the other programs is + built, and then the second pass of GCC is constructed, omitting libstdc++ + and other non-important libraries. Due to some weird logic in GCC's + configure script, CC_FOR_TARGET ends up as + cc when the host is the same as the target, but is + different from the build system. This is why CC_FOR_TARGET=$LFS_TGT-gcc is put explicitely into the configure options. diff --git a/stylesheets/lfs-xsl/lfs.css b/stylesheets/lfs-xsl/lfs.css index 15ceba1ef..23d461304 100644 --- a/stylesheets/lfs-xsl/lfs.css +++ b/stylesheets/lfs-xsl/lfs.css @@ -342,7 +342,7 @@ div.important em, div.warning em, div.caution em { margin-bottom: .3em; } -.table table { +.table table, .informaltable { margin-left: auto; margin-right: auto; }