From 0fc98a07ffecf993c6597d71089e40b3f5687fae Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 1 Dec 2021 05:56:34 +0800 Subject: [PATCH] gcc-pass1: set --with-glibc-version to target glibc version "info gccinstall" says: '--with-glibc-version=MAJOR.MINOR' Tell GCC that when the GNU C Library (glibc) is used on the target it will be version MAJOR.MINOR or later. Normally this can be detected from the C library's header files, but this option may be needed when bootstrapping a cross toolchain without the header files available for building the initial bootstrap compiler. So it can, and should be set to the version of glibc which will be built for the chroot environment. On x86_64, currently it does not make any difference with values >= 2.13. But it may make a difference if a new feature is added to glibc, or on other platforms. --- chapter05/gcc-pass1.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 765f5b875..93b6a2229 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -83,7 +83,7 @@ cd build ../configure \ --target=$LFS_TGT \ --prefix=$LFS/tools \ - --with-glibc-version=2.11 \ + --with-glibc-version=&glibc-version; \ --with-sysroot=$LFS \ --with-newlib \ --without-headers \ @@ -104,11 +104,14 @@ cd build The meaning of the configure options: - --with-glibc-version=2.11 + --with-glibc-version=&glibc-version; - This option ensures the package will be compatible with the host's - version of glibc. It is set to the minimum glibc requirement - specified in the . + This option specifies the version of glibc which will be + used on the target. It is not relevent to the minimum glibc + requirement specified in the + because everything + compiled by pass1 gcc will run in the chroot environment, + which is isolated from glibc of the host distro.