Summary: | dev-libs/boost-1.60.0: -std=gnu++98 breaks build of dev-util/source-highlight-3.1.7-r2 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Peter Levine <plevine457> |
Component: | [OLD] GCC Porting | Assignee: | C++ Team [disbanded] <cpp+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jstein, plevine457, suporte |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=632090 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 587012 | ||
Bug Blocks: | 542482, 582084 |
Description
Peter Levine
2016-05-10 23:43:37 UTC
g++ 6 defaults to -std=c++14, and the BOOST ABI changes depending on the standard set during compile time, which means for some parts of boost one is required to use the same flags when compiling against BOOST that were used when compiling BOOST itself. See also https://bugs.debian.org/823978 for a similar problem. Did you test compiling dev-util/source-highlight with gcc-5 -std=c++11 or -std=c++14? However, maybe because of the changes to enums with the new c++ standard #582694 might also come up when compiling with g++5 and c++11/14 enabled. Best, Gert (In reply to Gert Wollny from comment #1) > Did you test compiling dev-util/source-highlight with gcc-5 -std=c++11 or > -std=c++14? However, maybe because of the changes to enums with the new c++ > standard #582694 might also come up when compiling with g++5 and c++11/14 > enabled. > > Best, > Gert I noticed that boost would append -std=c++98 to the end of CXXFLAGS regardless of what compiler I was using or what other "-std" flag was in CXXFLAGS. After building boost with gcc-6, I was able to effectively build source-highlight with gcc-6 as well by putting -std=c++98 in CXXFLAGS. Not ideal, since boost shouldn't be forcing a c+++ dialect if could cause potential breakage in dependent packages that don't default to that same dialect. Strangely though, regardless of the fact that boost forces the -std=c++98 dialect, if it is built with gcc-6* then source-highlight won't build with gcc-5* regardless of the dialect. In the case of either -std=c++11 or -std=c++14 in CXXFLAGS, source-highlight fails with something like: > ./stdbool.h:112:70: error: expected ';', identifier or '(' before '_Bool' > typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; which might be expected since boost is always using -std=c++98 anyway. The -std=gnu++98 is coming from the boost ebuild (append-cxxflags -std=gnu++98), apparently until building with c++11 is considered stable.
The problem is one can't really test for stability with gcc-6 (and -std=c++14) if the ebuild maintainers are going to preemptively force -std=gnu++98.
I altered boost-1.60.0.ebuild to omit the -std=gnu++98 and it built and installed fine with gcc-6. source-highlight-3.1.7-r2, however, still failed with:
> ./stdbool.h:112:70: error: expected ';', identifier or '(' before '_Bool'
> typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
dev-libs/boost shouldn't force -std=gnu++98. Some packages built with gcc-6 such as dev-util/source-highlight-3.1.7-r2 rely on building with the same C++ dialect. Can we we at least have a use flag to choose CPP 11 support instead of hard setting it to 98 support? I need it for a package I'm doing. 1.62 in tree now, using C++14. Please try and report back. You will have to KEYWORD dev-util/boost-build and dev-libs/boost. commit 1367893b54c8ee3de72561e853c9f0f70089bd40 Author: David Seifert <soap@gentoo.org> Date: Sat Oct 1 15:54:42 2016 +0200 dev-libs/boost: Version bump to 1.62.0 * Various QA cleanups * Switch to building in ISO C++14 mode (-std=c++14) commit a20f82824bff15ec83702f07697f3b2433a17e5c Author: David Seifert <soap@gentoo.org> Date: Sat Oct 8 20:43:39 2016 +0200 dev-util/source-highlight: Version bump to 3.1.8 Gentoo-bug: 507112, 579002, 582694, 582696 * EAPI=6 * Build using C++14 mode (due to boost-1.62) *** Bug 622858 has been marked as a duplicate of this bug. *** |