Bug 216303

Summary: lang/gcc7-devel: Fix build with libc++ 4.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Gerald Pfeifer <gerald>
Status: Closed FIXED    
Severity: Affects Some People CC: dim, gerald
Priority: --- Flags: gerald: maintainer-feedback+
gerald: merge-quarterly+
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216647
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216266
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212465
Bug Depends on:    
Bug Blocks: 216008    
Attachments:
Description Flags
Fix system includes in lang/gcc7-devel none

Description Dimitry Andric freebsd_committer freebsd_triage 2017-01-19 22:50:10 UTC
Created attachment 179118 [details]
Fix system includes in lang/gcc7-devel

Similar to bug 212465 and bug 216266, lang/gcc7-devel doesn't compile with libc++ 4.0.0, due to clashes between the redefined abort macro and standard C++ headers.

In gcc7 they seem to have realized this issue, and are now using system.h to pull in C++ standard headers, when INCLUDE_xxx is defined, where xxx is ALGORITHM, VECTOR, and so on.

In this case only gcov.c needs to be fixed.  This should probably be committed upstream too.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2017-01-20 21:07:23 UTC
This is fine; thanks for digging into this and providing the patch, Dim!

Just one request: mind naming the patch files/patch-libc++ ?  That'll 
help me manage things in the longer term.


Yes, this definitely should be submitted upstream.  If you send this
to gcc-patches@gcc.gnu.org, I promise to push it there and commit it.

(I'll also create a ChangeLog entry if you prefer, your submission
does not have to carry one if you don't know how/want to create one.)

Deal? :-)
Comment 2 Gerald Pfeifer freebsd_committer freebsd_triage 2017-01-20 21:09:13 UTC
Oh, and if you prefer I'll take care of committing this to lang/gcc7-devel;
just let me know.

(If you could submit to gcc-patches@gcc.gnu.org, that would still be great.)
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-01-21 19:17:13 UTC
A commit references this bug:

Author: dim
Date: Sat Jan 21 19:16:07 UTC 2017
New revision: 432076
URL: https://svnweb.freebsd.org/changeset/ports/432076

Log:
  Fix system includes in lang/gcc7-devel

  Similar to bug 212465 and bug 216266, lang/gcc7-devel doesn't compile
  with libc++ 4.0.0, due to clashes between the redefined abort macro and
  standard C++ headers.

  Upstream seems to have realized this issue, and are now using system.h
  to pull in C++ standard headers, when INCLUDE_xxx is defined, where xxx
  is ALGORITHM, VECTOR, and so on.

  In this case only gcov.c needs to be fixed.

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

Changes:
  head/lang/gcc7-devel/files/patch-libc++
Comment 4 Gerald Pfeifer freebsd_committer freebsd_triage 2017-01-22 09:38:08 UTC
Thanks, Dimitry!

I did ping the upstream maintainers of this part of GCC and also added
the "merge quarterly" flag, and think we can now close this PR now your
fix is in.