Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: jkt@g.o
Subject: Re: [gentoo-dev] How to support C++11 in libraries?
Date: Thu, 19 Dec 2013 09:19:52
In Reply to: Re: [gentoo-dev] How to support C++11 in libraries? by "Jan Kundrát"
1 Dnia 2013-12-19, o godz. 09:43:40
2 Jan Kundrát <jkt@g.o> napisał(a):
4 > On Thursday, 19 December 2013 02:41:55 CEST, heroxbd@g.o wrote:
5 > > I'd like to make an analogy to the version bump of gcc[1]. We (gentoo)
6 > > decide to support c++11 officially or not. If so, open a tracker bug to
7 > > push it globally. If not, patch lldb to support non-c++11, or leave it
8 > > up to the user to fiddle with the CXXFLAGS, where we only point the user
9 > > by to proper docs.
10 >
11 > To be honest, I do not really see a link between the "let's bring in a new
12 > version of compiler, it is a bit stricter in some situations, but these
13 > were bugs anyway, like missing headers or unfounded assumptions about
14 > memcpy()" with "let's support a new version of language which produces
15 > object files with different ABI". Perhaps a Python 2.6 vs. Python 3.3 is a
16 > better analogy?
18 Well, it's even worse than that. I think the main difference is that
19 usual gcc/whatever bumps may have resulted in *one* different libstdc++
20 ABI. People rebuilt all their packages, world went back to normal.
22 The issue here is that gcc is providing two ABIs in parallel, with
23 a -std= switch. And this sucks pretty much...
25 > Anyway, GCC 4.8 is pretty clear that the C++11's support is still
26 > experimental [1] and subject to change [2]. The upstream developers have
27 > announced that they plan to break the ABI of the code using C++11 features
28 > in 4.9 [3].
30 Would it be possible to have a consistent ABI for both C++03 and C++11?
31 The simpler changes like adding new fields can be backported quite
32 easily (even if it would mean having dummy fields in C++03), I have no
33 idea about the more complex changes.
35 > Right now, it seems that we shall wait at least for GCC 4.9 to come and for
36 > upstream to decide how to solve this properly.
38 Well, if they considered the C++11 ABI in gcc-4.9 stable, we could
39 consider changing the default to C++11. Then, we could do our
40 bump/switch thing as a matter of gcc-4.9 upgrade problem.
42 And that brings another issue in Gentoo -- gcc-config. AFAIR this tool
43 is completely insane and switches libstdc++ along with gcc version.
44 As a result, after switching to a gcc version with different C++ ABI,
45 installed software gets broken. And you can't really fix it without
46 going through the broken-system state or some hackery.
48 It would be much better if the switching was done by some ebuild. We
49 could then use subslots to force rebuilds of stuff using libstdc++.
50 Well, more than that, preserved-libs would prevent disappearing old
51 libstdc++ from breaking stuff.
53 But well, that's just my wishes...
55 --
56 Best regards,
57 Michał Górny


File name MIME type
signature.asc application/pgp-signature