As discussed with the FreeBSD gcc ports maintainer, building the
gcc-5-branch with libc++ requires standard C++ headers to be included
*before* gcc/system.h, otherwise the redefinition of abort() to
fancy_abort() will cause trouble.

In trunk r235362, most gcc C++ sources were updated to define
INCLUDE_xxx macros before including gcc/system.h, which fixes the
incompatibility with libc++.  However, this revision is most likely too
disruptive to backport to the gcc-5-branch.

Attached is the patch which has been used in the FreeBSD gcc5 port (see
also https://bugs.freebsd.org/216266 ).  Proposed ChangeLog entry:

2017-01-31  Dimitry Andric <d...@freebsd.org>

        * system.h: For C++, always include <new>.
        * graphite-isl-ast-to-gimple.c: Include standard C++ headers before
        system.h.
        * auto-profile.c: Likewise.  Also remove string.h, since it is already
        included in system.h.

-Dimitry

Attachment: gcc5-cxx-includes-1.diff
Description: Binary data

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to