From 3bb463d33d713d262b4864d8d3c6af08e25c77aa Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 1 Mar 2022 18:09:30 +0800 Subject: gcc-pass2: document *_FOR_TARGET parameters --- chapter06/gcc-pass2.xml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'chapter06') diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml index d10b403e9..d76b9d9af 100644 --- a/chapter06/gcc-pass2.xml +++ b/chapter06/gcc-pass2.xml @@ -107,7 +107,7 @@ cd build The meaning of the new configure options: - -with-build-sysroot=$LFS + --with-build-sysroot=$LFS Normally, using --host ensures that a cross-compiler is used for building GCC, and that compiler knows @@ -119,6 +119,33 @@ cd build + + --target=$LFS_TGT + + As we are cross-compiling GCC, it's impossible to build + target libraries (libgcc + and libstdc++) with the + compiled GCC binaries because these binaries won't run on the + host distro. GCC building system will attempt to use the + C and C++ compilers on the host distro as a workaround by default. + It's not supported to build GCC target libraries with a different + version of GCC, so using host compilers may cause building + failure. This parameter ensures to build the libraries with GCC + pass 1 and prevent the issue. + + + + + LDFLAGS_FOR_TARGET=... + + Allow libstdc++ to + use shared libgcc being + built in this pass, instead of the static version built in GCC + pass 1. This is needed for supporting C++ exception + handling. + + + --enable-initfini-array -- cgit v1.2.3-54-g00ecf