https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103570

            Bug ID: 103570
           Summary: Libstdc++ fails to build with compilers that already
                    have a C++ library on their path
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pedro.falcato at gmail dot com
  Target Milestone: ---

Created attachment 51930
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51930&action=edit
GCC Error log with -H

GCC 11.2.0's libstdc++ fails to build when trying to build it with a compiler
that already contains C++ headers on its path. Because of this, the build fails
when cross-compiling GCC itself to another system (which doesn't use the newly
built GCC, because it can't).

Simplifying the test, I managed to reproduce it fairly reliably with simply:
../gcc-11.2.0/libstdc++/configure && make

I hit this error using --host=aarch64-linux-gnu

Eventually, it will fail on:

aarch64-linux-gnu-g++
-I/home/pfalcato/armstuff/gcc-11.2.0/libstdc++-v3/../libgcc
-I/home/pfalcato/armstuff/gcc-build/include/aarch64-linux-gnu
-I/home/pfalcato/armstuff/gcc-build/include
-I/home/pfalcato/armstuff/gcc-11.2.0/libstdc++-v3/libsupc++ -std=gnu++17
-D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=floating_from_chars.lo -fimplicit-templates -c
../../../gcc-11.2.0/libstdc++-v3/src/c++17/floating_from_chars.cc  -fPIC -DPIC
-D_GLIBCXX_SHARED -o floating_from_chars.o

Running libstdc++'s configure without any host hits a similar error.

Attached is a detailed log of the compile command, with -H appended on it for
clarity's sake.
By looking at -H's output, we can deduce that in-tree libstdc++ fenv.h
includes_next the compiler's fenv.h, which fails to include_next libc's fenv.h
due to the in-tree's fenv.h and the compiler's fenv.h headers guards being the
same.
  • [Bug libstdc++/103570] New: Li... pedro.falcato at gmail dot com via Gcc-bugs

Reply via email to