mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2026-09-12 11:02:43 -04:00
In gcc-pass2 the C++ std module fails to build, similar to the issue
we've fixed for gcc-pass1 at commit 2be87ced88. Here it's even more
complicated than gcc-pass1: the problem is the libstdc++ fenv.h
has #include_next <fenv.h> and expects the directive to find glibc
fenv.h, but with CXX_FOR_TARGET=$LFS_TGT-g++ (the default) the compiler
finds it's own (installed at ch.05 libstdc++) fenv.h, then
this #include_next directive finds fenv.h in the gcc-pass2 build, and
because of the _GLIBCXX_FENV_H include guard gcc-pass2 fenv.h won't pull
the glibc header anymore. Then the build will report errors like
"cannot find fenv_t" etc.
To resolve the issue, pass CXX_FOR_TARGET="$LFS_TGT-gcc -nostdinc++"
like what the top-level build system does for a native build.