Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] How to support C++11 in libraries?
Date: Wed, 18 Dec 2013 07:55:10
1 Hello, folks.
3 As some of you are already aware, the C++11 standard brought a few
4 changes to the C++ standard library. As a result, the standard library
5 used in C++11 mode has a different ABI than the one used in pre-C++11
6 mode. And this means that libraries that use some of standard C++ types
7 in their APIs also have different ABIs depending on the C++ standard
8 used to build them. This is somehow explained in [1].
10 As a result, if a single library suffers that, its reverse dependencies
11 need to be built with the same C++ standard. And then, those can force
12 even more dependencies and you may guess where this is going.
14 Basically, I've hit this with sys-devel/llvm. A user has requested lldb
15 support to be enabled in the ebuild [2]. Sadly, lldb requires C++11 to
16 be used, and this means that whole LLVM needs to become C++11 enabled.
17 And then, it would be at least recommended that all reverse deps become
18 C++11 enabled as well.
20 [1]:
21 [2]:
24 This raises the following question: how do we want to do it? I see two
25 possibilities:
27 a) adding USE=c++11 and USE-deps to all the packages in question,
29 b) doing the switch via synchronous version bump and matching
30 dependencies.
33 I think that the variant a) is simpler. It goes like this:
35 1) we add 'sys-devel/llvm[-c++11(-)]' deps to everything that uses it,
37 2) we add USE=c++11 to llvm,
39 3) we add USE=c++11 and 'sys-devel/llvm[c++11=(-)]' deps to newest
40 version of everything that uses it.
42 The advantage is that plain users may just keep USE=c++11 disabled as
43 it is by default, and avoid hitting some issues with non-tree packages
44 and so on.
46 At some point, we'll probably want to remove non-C++11 support
47 completely. Then we could start by use.forcing the flag, changing deps
48 in packages and so on.
51 The variant b) requires much more synchronous work. In this case, we:
53 1) update LLVM deps to '<=' deps in everything that uses it,
55 2) revbump llvm and unconditionally enable C++11 in it,
57 3) update the reverse deps to enable C++11 and use '>=' deps on the new
58 version.
60 Of course, the same steps need to be repeated for every C++ reverse dep
61 of reverse deps, and libs and so on. In other words, it's a lot of work.
63 The problem with this solution is that as soon as user upgrades, shklee
64 is forced to use C++11. On the other hand, we get rid of pre-C++11
65 packages quite transparently, without extra work.
68 What are your thoughts?
70 --
71 Best regards,
72 Michał Górny


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


Subject Author
Re: [gentoo-dev] How to support C++11 in libraries? "C. Bergström" <cbergstrom@×××××××××.com>
Re: [gentoo-dev] How to support C++11 in libraries? heroxbd@g.o
Re: [gentoo-dev] How to support C++11 in libraries? Ian Stakenvicius <axs@g.o>
Re: [gentoo-dev] How to support C++11 in libraries? "Anthony G. Basile" <blueness@g.o>
Re: [gentoo-dev] How to support C++11 in libraries? Sven Eden <sven.eden@×××.de>