public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/103570] New: Libstdc++ fails to build with compilers that already have a C++ library on their path
@ 2021-12-06  8:11 pedro.falcato at gmail dot com
  2021-12-06 11:38 ` [Bug libstdc++/103570] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pedro.falcato at gmail dot com @ 2021-12-06  8:11 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libstdc++/103570] Libstdc++ fails to build with compilers that already have a C++ library on their path
  2021-12-06  8:11 [Bug libstdc++/103570] New: Libstdc++ fails to build with compilers that already have a C++ library on their path pedro.falcato at gmail dot com
@ 2021-12-06 11:38 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-06 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Another dup of PR 100017 etc. which I plan to fix soon.

*** This bug has been marked as a duplicate of bug 100017 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-06 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06  8:11 [Bug libstdc++/103570] New: Libstdc++ fails to build with compilers that already have a C++ library on their path pedro.falcato at gmail dot com
2021-12-06 11:38 ` [Bug libstdc++/103570] " redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).