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.
This commit is contained in:
Xi Ruoyao 2021-12-01 05:56:34 +08:00
parent bdc9e03b78
commit 0fc98a07ff
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC

View File

@ -83,7 +83,7 @@ cd build</userinput></screen>
<screen><userinput remap="configure">../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</userinput></screen>
<title>The meaning of the configure options:</title>
<varlistentry>
<term><parameter>--with-glibc-version=2.11</parameter></term>
<term><parameter>--with-glibc-version=&glibc-version;</parameter></term>
<listitem>
<para>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 <xref linkend="ch-partitioning-hostreqs"/>.</para>
<para>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
<xref linkend="ch-partitioning-hostreqs"/> because everything
compiled by pass1 gcc will run in the chroot environment,
which is isolated from glibc of the host distro.</para>
</listitem>
</varlistentry>