Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582696 - dev-libs/boost-1.60.0: -std=gnu++98 breaks build of dev-util/source-highlight-3.1.7-r2
Summary: dev-libs/boost-1.60.0: -std=gnu++98 breaks build of dev-util/source-highlight...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords:
: 622858 (view as bug list)
Depends on: 587012
Blocks: c++11-abi gcc-6
  Show dependency tree
 
Reported: 2016-05-10 23:43 UTC by Peter Levine
Modified: 2017-09-26 19:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2016-05-10 23:43:37 UTC
In its current state, dev-util/source-highlight-3.1.7-r2 can't be successfully compiled with gcc-6* (see https://bugs.gentoo.org/show_bug.cgi?id=582694).  However, if dev-libs/boost-1.60 is compiled with gcc-6*, using gcc-5* to compile dev-util/source-highlight-3.1.7-r2 also fails with:


../lib/srchilite/.libs/libsource-highlight.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
../lib/srchilite/.libs/libsource-highlight.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'

Tested with gcc-6.1.0 and gcc-5.3.0.
Comment 1 Gert Wollny 2016-05-28 16:07:36 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
Comment 2 Peter Levine 2016-05-28 17:38:54 UTC
(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.
Comment 3 Peter Levine 2016-05-28 21:08:18 UTC
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;
Comment 4 Peter Levine 2016-05-30 20:53:13 UTC
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.
Comment 5 Jonathan Scruggs (RETIRED) gentoo-dev 2016-06-24 16:56:35 UTC
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.
Comment 6 David Seifert gentoo-dev 2016-10-01 17:05:08 UTC
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)
Comment 7 David Seifert gentoo-dev 2016-10-08 18:47:17 UTC
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)
Comment 8 David Seifert gentoo-dev 2017-09-16 13:58:47 UTC
*** Bug 622858 has been marked as a duplicate of this bug. ***