ch05/libstdc++: set CXX=$LFS_TGT-gcc

In a normal GCC build the top-level Makefile automatically sets the
CXX=xgcc.  And without it the "checking for sin in -lm" probe will fail,
and then GCC will believe the math functions (for example acosf) are not
available and fail to build std.gcm (added since GCC 16) with about a
dozen lines of error messages, which would likely disconcert the user if
spotted.
This commit is contained in:
Xi Ruoyao
2026-07-18 23:48:36 +08:00
parent e86e9c4f23
commit 2be87ced88

View File

@@ -63,6 +63,7 @@ cd build</userinput></screen>
<screen><userinput remap="configure">../libstdc++-v3/configure \
--host=$LFS_TGT \
--build=$(../config.guess) \
CXX=$LFS_TGT-gcc \
--prefix=/usr \
--disable-multilib \
--disable-nls \
@@ -81,6 +82,23 @@ cd build</userinput></screen>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>CXX=$LFS_TGT-gcc</parameter></term>
<listitem>
<para>Specifies to use <command>$LFS_TGT-gcc</command> to compile
the C++ code. The default, <command>$LFS_TGT-g++</command>,
would automatically specify linking against
<systemitem class='library'>libstdc++</systemitem> when invoking
the linker, but in our case
<systemitem class='library'>libstdc++</systemitem> is not
installed yet so some checks in the <command>configure</command>
script would misbehave with <command>$LFS_TGT-g++</command>. In a
normal build, this override is automatically passed to the
<command>configure</command> script from the top level directory.
Here we explicitly pass it.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>--disable-libstdcxx-pch</parameter></term>
<listitem>