diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-09-13 18:41:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-09-13 18:41:08 +0000 |
commit | 46a4e1eb5f321155019343169be693e21f7856a4 (patch) | |
tree | b46b3cf7df2299391e4fab336eedb471d2a7e15c | |
parent | 9b40b6af905fd84afaa7e1e2b968d3fef5363447 (diff) | |
download | ports-46a4e1eb5f321155019343169be693e21f7856a4.tar.gz ports-46a4e1eb5f321155019343169be693e21f7856a4.zip |
MFH: r421625
Fix build of lang/gcc49 with libc++ 3.9.0
While testing the clang390-import branch, I ran into the following
errors building lang/gcc49:
In file included from /wrkdirs/usr/ports/lang/gcc49/work/gcc-4.9.4/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();
^~~~~~~
/usr/include/c++/v1/__config:451:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
^
/wrkdirs/usr/ports/lang/gcc49/work/gcc-4.9.4/gcc/system.h:685:13: note: 'fancy_abort' declared here
extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
^
1 error generated.
What is happening here, is that the source file includes gcc/system.h,
which defines abort to fancy_abort, and then the source file includes
<new>, which attempts to call _VSTD::abort() (the _VSTD is a libc++
alias for std::). The macro definition then causes the above breakage.
Newer gcc ports, such as gcc5 and gcc6 don't show this issue, because
upstream gcc first added an include of <algorithm> (which indirectly
includes <new>) in r217348 [1], and later even add a direct include of
<new> in r232736 [2].
Fix it for this version, by adding the direct include of <new> to
gcc/system.h. This makes the 'second' includes of <new> in some .c
files superfluous, but at least they won't result in errors.
[1] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=217348
[2] https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=232736
Approved by: portmgr (feld)
PR: 212465
Notes
Notes:
svn path=/branches/2016Q3/; revision=422057
-rw-r--r-- | lang/gcc49/files/patch-gcc_system.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lang/gcc49/files/patch-gcc_system.h b/lang/gcc49/files/patch-gcc_system.h new file mode 100644 index 000000000000..05f61aaab868 --- /dev/null +++ b/lang/gcc49/files/patch-gcc_system.h @@ -0,0 +1,10 @@ +--- gcc/system.h.orig 2014-01-02 22:23:26 UTC ++++ gcc/system.h +@@ -203,6 +203,7 @@ extern int errno; + + #ifdef __cplusplus + # include <cstring> ++# include <new> + #endif + + /* Some of glibc's string inlines cause warnings. Plus we'd rather |