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

            Bug ID: 82091
           Summary: [5] Build failure on macOS 10.13 with Xcode 9
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

gcc 5.4.0 fails to build on macOS 10.13 with Xcode 9 with the following error:

clang++ -c   -g  -DIN_GCC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-fno-common  -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/.
-I../../gcc/../include -I../../gcc/../libcpp/include
-I/usr/local/opt/gmp/include -I/usr/local/opt/mpfr/include
-I/usr/local/opt/libmpc/include  -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace
-I/usr/local/opt/isl@0.14/include  -o auto-profile.o -MT auto-profile.o -MMD
-MP -MF ./.deps/auto-profile.TPo ../../gcc/auto-profile.c
In file included from ../../gcc/auto-profile.c:25:
In file included from
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:446:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:1398:2:
error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean
simply 'fancy_abort'?
        _VSTD::abort();
        ^~~~~~~
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config:392:15:
note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
../../gcc/system.h:700:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
            ^


Full logs can be found here:
https://gist.github.com/anonymous/914e45c380ec81a524394098db4b5a64

The problem is that <functional> is included (via <map>) after abort has been
defined as a macro to fancy_abort. And thus when the C++ standard headers try
to call std::abort, they end up calling std::fancy_abort, which of course
doesn't exist.

A simple fix is to include <map> in gcc/config.h before we mess with abort.
Patch:
https://raw.githubusercontent.com/Homebrew/formula-patches/078797f1/gcc%405/xcode9.patch

Reply via email to