Bug 212804

Summary: devel/arm-none-eabi-gcc492: Fix build with libc++ 3.9.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Gerald Pfeifer <gerald>
Status: Closed FIXED    
Severity: Affects Some People CC: gerald, ian, imp
Priority: --- Flags: ian: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 212343    
Attachments:
Description Flags
Include <new> in gcc/system.h none

Description Dimitry Andric freebsd_committer freebsd_triage 2016-09-18 21:25:54 UTC
Created attachment 174934 [details]
Include <new> in gcc/system.h

During the exp-run for bug 212343, devel/arm-none-eabi-gcc492 encounters a similar problem as with bug 212465 for lang/gcc49, and bug 212696 for devel/avr-gcc, namely:

In file included from /wrkdirs/usr/ports/devel/arm-none-eabi-gcc492/work/gcc-4.9.2/gcc/c/c-objc-common.c:33:
In file included from /usr/include/c++/v1/new:70:
/usr/include/c++/v1/exception:267:5: error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
    _VSTD::abort();
    ^~~~~~~

This is because gcc's system.h redefines abort to fancy_abort, and then includes a number of C++ standard headers.  I propose to fix this with the same patch as I submitted for bug 212465 and bug 212696.
Comment 1 Ian Lepore freebsd_committer freebsd_triage 2017-03-28 03:25:58 UTC
We still need gcc492 to compile a few of the older uboot ports.  Could a ports commit please commit this?
Comment 2 Warner Losh freebsd_committer freebsd_triage 2017-04-07 16:56:39 UTC
(In reply to Ian Lepore from comment #1)

We don't need gcc 4.9.2 anymore for the old u-boot ports. They have all been updated. And if I've missed one, the compilation fix is trivial.
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-16 02:16:22 UTC
Let me help with this...

After all, someone cared enough to create and provide a patch, and
letting this sit isn't helpful nor encouraging.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-04-16 02:40:30 UTC
A commit references this bug:

Author: gerald
Date: Sun Apr 16 02:40:18 UTC 2017
New revision: 438614
URL: https://svnweb.freebsd.org/changeset/ports/438614

Log:
  Copy files/patch-gcc_system.h over from lang/gcc49 to fix the build
  with libc++ 3.9.0.

  PR:		212804
  Submitted by:	dim
  Approved by:	ian (maintainer)

Changes:
  head/devel/arm-none-eabi-gcc492/files/patch-gcc_system.h
Comment 5 Gerald Pfeifer freebsd_committer freebsd_triage 2017-04-16 02:47:18 UTC
I applied the patch, thank you.

As a note about this port, I recommend to not go for minor releases
when it comes to GCC, but would have named this just arm-none-eabi-gcc49
(and updated to GCC 4.9.4 from 4.9.2).