public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] How to support C++11 in libraries?
@ 2013-12-18  7:54 Michał Górny
  2013-12-18  8:20 ` "C. Bergström"
                   ` (4 more replies)
  0 siblings, 5 replies; 52+ messages in thread
From: Michał Górny @ 2013-12-18  7:54 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2587 bytes --]

Hello, folks.

As some of you are already aware, the C++11 standard brought a few
changes to the C++ standard library. As a result, the standard library
used in C++11 mode has a different ABI than the one used in pre-C++11
mode. And this means that libraries that use some of standard C++ types
in their APIs also have different ABIs depending on the C++ standard
used to build them. This is somehow explained in [1].

As a result, if a single library suffers that, its reverse dependencies
need to be built with the same C++ standard. And then, those can force
even more dependencies and you may guess where this is going.

Basically, I've hit this with sys-devel/llvm. A user has requested lldb
support to be enabled in the ebuild [2]. Sadly, lldb requires C++11 to
be used, and this means that whole LLVM needs to become C++11 enabled.
And then, it would be at least recommended that all reverse deps become
C++11 enabled as well.

[1]:http://gcc.gnu.org/wiki/Cxx11AbiCompatibility
[2]:https://bugs.gentoo.org/show_bug.cgi?id=464354


This raises the following question: how do we want to do it? I see two
possibilities:

a) adding USE=c++11 and USE-deps to all the packages in question,

b) doing the switch via synchronous version bump and matching
dependencies.


I think that the variant a) is simpler. It goes like this:

1) we add 'sys-devel/llvm[-c++11(-)]' deps to everything that uses it,

2) we add USE=c++11 to llvm,

3) we add USE=c++11 and 'sys-devel/llvm[c++11=(-)]' deps to newest
version of everything that uses it.

The advantage is that plain users may just keep USE=c++11 disabled as
it is by default, and avoid hitting some issues with non-tree packages
and so on.

At some point, we'll probably want to remove non-C++11 support
completely. Then we could start by use.forcing the flag, changing deps
in packages and so on.


The variant b) requires much more synchronous work. In this case, we:

1) update LLVM deps to '<=' deps in everything that uses it,

2) revbump llvm and unconditionally enable C++11 in it,

3) update the reverse deps to enable C++11 and use '>=' deps on the new
version.

Of course, the same steps need to be repeated for every C++ reverse dep
of reverse deps, and libs and so on. In other words, it's a lot of work.

The problem with this solution is that as soon as user upgrades, shklee
is forced to use C++11. On the other hand, we get rid of pre-C++11
packages quite transparently, without extra work.


What are your thoughts?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2013-12-21  2:27 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18  7:54 [gentoo-dev] How to support C++11 in libraries? Michał Górny
2013-12-18  8:20 ` "C. Bergström"
2013-12-18 18:07   ` Michał Górny
2013-12-18 13:58 ` heroxbd
2013-12-18 16:29   ` Jan Kundrát
2013-12-18 16:37     ` "C. Bergström"
2013-12-18 16:50       ` Jan Kundrát
2013-12-18 17:05         ` "C. Bergström"
2013-12-18 17:33           ` Jan Kundrát
2013-12-18 17:47             ` Kent Fredric
2013-12-18 17:56               ` "C. Bergström"
2013-12-19  1:45                 ` heroxbd
2013-12-19  8:20                 ` Michał Górny
2013-12-19  8:28                   ` "C. Bergström"
2013-12-19  8:35                     ` Michał Górny
2013-12-19  8:44                       ` "C. Bergström"
2013-12-19 12:28                         ` Jan Kundrát
2013-12-19  8:45                       ` Jan Kundrát
2013-12-19  8:47                   ` Georg Rudoy
2013-12-18 17:49             ` "C. Bergström"
2013-12-18 18:28             ` Georg Rudoy
2013-12-19  1:41             ` heroxbd
2013-12-19  8:43               ` Jan Kundrát
2013-12-19  9:18                 ` Michał Górny
2013-12-19 13:47                   ` heroxbd
2013-12-19 14:46                     ` Michał Górny
2013-12-19 15:12                       ` heroxbd
2013-12-19 16:56                     ` Ciaran McCreesh
2013-12-19 15:17                   ` Jan Kundrát
2013-12-19 16:29                     ` vivo75
2013-12-19 16:51                       ` Jan Kundrát
2013-12-21  2:36                   ` [gentoo-dev] " Ryan Hill
2013-12-18 18:15   ` [gentoo-dev] " Michał Górny
2013-12-18 20:58     ` [gentoo-dev] " Martin Vaeth
2013-12-19  2:01     ` [gentoo-dev] " heroxbd
2013-12-18 14:27 ` Ian Stakenvicius
2013-12-18 18:10 ` Anthony G. Basile
2013-12-18 18:28   ` Ian Stakenvicius
2013-12-19  8:58 ` Sven Eden
2013-12-19  9:07   ` Michał Górny
2013-12-19 15:00     ` Ian Stakenvicius
2013-12-19 15:23       ` Jan Kundrát
2013-12-19 16:00         ` Anthony G. Basile
2013-12-20  9:00         ` [gentoo-dev] " Martin Vaeth
2013-12-20 12:35           ` [gentoo-dev] " Jan Kundrát
2013-12-20 17:35             ` [gentoo-dev] " Martin Vaeth
2013-12-20 11:56         ` [gentoo-dev] " Sven Eden
2013-12-20 12:45           ` Jan Kundrát
2013-12-20 12:54             ` Georg Rudoy
2013-12-20 17:49             ` [gentoo-dev] " Martin Vaeth
2013-12-20 15:10           ` [gentoo-dev] " Ian Stakenvicius
2013-12-19 15:51       ` Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox