Bug 216266 - lang/gcc5: Fix build with libc++ 4.0.0
Summary: lang/gcc5: Fix build with libc++ 4.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Gerald Pfeifer
URL:
Keywords: patch
Depends on:
Blocks: 216008
  Show dependency treegraph
 
Reported: 2017-01-19 19:33 UTC by Dimitry Andric
Modified: 2017-10-11 14:36 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (gerald)


Attachments
Include <new> in gcc/system.h (810 bytes, patch)
2017-01-19 19:33 UTC, Dimitry Andric
no flags Details | Diff
Fix more system includes in lang/gcc5 (2.81 KB, patch)
2017-01-19 21:23 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2017-01-19 19:33:17 UTC
Created attachment 179080 [details]
Include <new> in gcc/system.h

Similar to bug 212465, lang/gcc5 doesn't compile with recent versions of libc++, because it attempts to redefine abort():

In file included from /usr/work/share/dim/ports/lang/gcc5/work/gcc-5.4.0/gcc/auto-profile.c:25:
In file included from /usr/include/c++/v1/map:446:
/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();
        ^~~~~~~
/usr/include/c++/v1/__config:383:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^

Patch this in the same way as the other gcc ports, by including <new> in gcc/system.h.
Comment 1 Dimitry Andric freebsd_committer 2017-01-19 20:21:25 UTC
Hmm, even that patch is not enough:

In file included from /usr/work/share/dim/ports/lang/gcc5/work/gcc-5.4.0/gcc/auto-profile.c:25:
In file included from /usr/include/c++/v1/map:446:
/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();
        ^~~~~~~
/usr/include/c++/v1/__config:383:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/usr/work/share/dim/ports/lang/gcc5/work/gcc-5.4.0/gcc/system.h:701:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
            ^

This probably needs more hacks to get it right.  I wish the gcc authors would stop redefining abort. :(
Comment 2 Dimitry Andric freebsd_committer 2017-01-19 21:23:57 UTC
Created attachment 179098 [details]
Fix more system includes in lang/gcc5

This patch adds two more fixes:
* Move inclusion of <map> and <set> to before "system.h" in gcc/auto-profile.c
* Move inclusion of <map> to before "system.h" in gcc/graphite-isl-ast-to-gimple.c
Comment 3 commit-hook freebsd_committer 2017-01-31 21:26:37 UTC
A commit references this bug:

Author: dim
Date: Tue Jan 31 21:25:31 UTC 2017
New revision: 432958
URL: https://svnweb.freebsd.org/changeset/ports/432958

Log:
  Similar to bug 212465, lang/gcc5 doesn't compile with recent versions of
  libc++, because it attempts to redefine abort():

  In file included from /wrkdirs/usr/ports/lang/gcc5/work/gcc-5.4.0/gcc/auto-profile.c:25:
  In file included from /usr/include/c++/v1/map:446:
  /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();
          ^~~~~~~
  /usr/include/c++/v1/__config:383:15: note: expanded from macro '_VSTD'
  #define _VSTD std::_LIBCPP_NAMESPACE
                ^

  Patch this in the same way as the other gcc ports, by including <new> in
  gcc/system.h, and moving a few includes to before "system.h".

  Approved by:	gerald (maintainer)
  PR:		216266
  MFH:		2017Q1

Changes:
  head/lang/gcc5/files/patch-libc++
Comment 4 commit-hook freebsd_committer 2017-02-01 20:55:15 UTC
A commit references this bug:

Author: gerald
Date: Wed Feb  1 20:54:53 UTC 2017
New revision: 433105
URL: https://svnweb.freebsd.org/changeset/ports/433105

Log:
  Copy over files/patch-libc++ from lang/gcc5 to lang/gcc5-devel as well.

  PR:		216266
  Submitted by:	dim

Changes:
  head/lang/gcc5-devel/files/patch-libc++
Comment 5 commit-hook freebsd_committer 2017-10-11 14:36:31 UTC
A commit references this bug:

Author: gerald
Date: Wed Oct 11 14:35:28 UTC 2017
New revision: 451753
URL: https://svnweb.freebsd.org/changeset/ports/451753

Log:
  Update to the GCC 5.5 release.  This brings more than 250 final bug
  fixes compared to GCC 5.4 and is the last release planned on the GCC 5
  branch which is now closed.

  files/patch-aarch64-support, files/patch-disable-armvhf-config.gcc,
  files/patch-libgcc-config-arm-unwind-arm, and files/patch-x86-64-fix-m16
  all have been merged upstream in between GCC 5.4 and 5.5 and can thus
  be removed; the same is the case for most of files/patch-libc++.

  Finally, the tarball is now compressed using xz instead of bzip2.

  PR:		216266

Changes:
  head/lang/gcc5/Makefile
  head/lang/gcc5/distinfo
  head/lang/gcc5/files/patch-aarch64-support
  head/lang/gcc5/files/patch-disable-armvhf-config.gcc
  head/lang/gcc5/files/patch-libc++
  head/lang/gcc5/files/patch-libgcc-config-arm-unwind-arm
  head/lang/gcc5/files/patch-x86-64-fix-m16