[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C++11



On 6 August 2013 14:41, Pau Garcia i Quiles <pgquiles@elpauer.org> wrote:
> Hello,
>
> I am the maintainer of Wt [1], a C++ web development library (think of Qt or
> Gtk+ for the web) and web server.
>
> My upstream [2] sent me a mail asking about mixing C++03 and C++11. My
> understanding is it is not possible for a variety of reasons, unless all
> players take great care (see [3], for instance).
>
> The specific case upstream asked about is Boost.Signals2, which provides a
> different and ABI-incompatible implementation [4] depending on whether Boost
> was compiled as C++03 or C++11. I expect users and Wt to use more and more
> C++11, to the point where Wt may not even be compilable as C++03. Given that
> Wt depends on Boost, I can foresee a problem:
>
> - Application may be C++11 or C++03, depending on what the user is doing
> - Wt would be C++11-only
> - Boost would be compiled as C++03 in Debian
> - Wt (C++11) would depend on Boost (C++03), which but this mix is broken
>
> I'm talking about Wt + Boost in this e-mail but this will arise as other
> combinations for other packagers: log4cpp, Xerces, SOCI, ACE (which I
> co-maintain), Gtkmm, ZeroC ICE, POCO, etc
>
> I have googled but so far I have found no clear conclusion about this for
> Debian. What are we going to do with C++11? Are we goint to provide C++03
> and C++11 using multiarch (is that even possible?) ? Everything C++11?
> Fingers crossed?
>

At the moment gcc-4.8 C++11 abi is still experimental and has not been
declared stable. 4.8.1 did bring a few advances, but the stdlibc++ is
still not C++11 complete.
There are further ABI breakages planned to happen in 4.9, and
hopefully with 4.9 it will become default.

Currently the default boost version in Debian is 1.49, the transition
to boost1.54 is planned soon.

At the moment, compiling with C++11 enabled, will result in binaries
which are not abi stable, since toolchain abi will change and all of
those packages that use C++11 will have to be recompiled (a big pain).

I guess one could use gcc-4.8.1 with libc++ from llvm project, but
libc++ doesn't seem to have complete test-suite pass on linux (if
their website results are the current ones) and libc++ doesn't support
the complete range of support Debian architectures.

In short, I am not expecting compiling with C++11 by default in Debian
until after gcc-4.9 is default and libstc++ is api/abi stable for
C++11.

In practice, you can enabled c++11 but you get to keep the fallout
from abi mismatches between said package, its dependencies and reverse
depends / build-depends. (some packages started doing this in ubuntu,
and it has been a pain

> E. g Microsoft took a very pragmatic decision: C++11 is enabled by default
> and it is not possible to disable it.
>

I'm not sure how that applies to linux distributions though. There is
no package management per-se and one either depends on platform
libraries from micrsoft or bundles their own copies.
On Debian we need to ship something that works across 12 odd
architectures and 30 000 packages.

Some additional points:
http://gcc.gnu.org/wiki/Cxx11AbiCompatibility

Regards,

Dmitrijs.


Reply to: