[Bug 224927] lang/gcc48 lang/gcc49 lang/gcc5: Fix build with clang 6.0.0
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Fri Jan 5 09:30:59 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224927
Bug ID: 224927
Summary: lang/gcc48 lang/gcc49 lang/gcc5: Fix build with clang
6.0.0
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: gerald at FreeBSD.org
Reporter: dim at FreeBSD.org
Assignee: gerald at FreeBSD.org
Flags: maintainer-feedback?(gerald at FreeBSD.org)
Created attachment 189436
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=189436&action=edit
Fix build with clang 6.0.0 for lang/gcc{48,49,5}
While testing the new clang600-import branch (see bug 224669), I noticed that
lang/gcc48, lang/gcc49 and lang/gcc5 fail to compile, due clang++ 6.0.0 now
defaulting to -std=gnu++14. There are lots of errors similar to:
/wrkdirs/share/dim/ports/lang/gcc5/work/gcc-5.5.0/gcc/wide-int-print.cc:130:27:
error: invalid suffix on literal; C++11 requires a space between literal and
identifier [-Wreserved-user-defined-literal]
buf += sprintf (buf, "0x"HOST_WIDE_INT_PRINT_HEX_PURE, wi.elt (--i));
^
Upstream fixed this for gcc 6 and later by adding a space between the double
quote and the macro names.
I tried getting the first stage compiled with -std=gnu++98 by setting
USE_CXXSTD=gnu++98, but that lead to lots of compilation errors while building
libstdc++, which apparently needs C++11 or higher to compile.
So I have added a post-patch section to the three Makefiles, which searches out
all source files using double quotes followed directly by a few specific macro
names, and adds a space, e.g.:
post-patch:
@${FIND} ${WRKSRC} -type f \( -name '*.[ch]' -o -name '*.cc' \) | \
${XARGS} ${EGREP} -l '"(HOST_WIDE|PLUGIN_COND|PRId64)' | \
${XARGS} ${REINPLACE_CMD} -E -e
's/"(HOST_WIDE|PLUGIN_COND|PRId64)/" \1/g'
Furthermore, lang/gcc5 also needs a separate patch to fix an incorrect call to
error(), which should have been error_at(). That was a mismerge by upstream,
but reporting it there is probably futile now.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list