Gentoo Archives: gentoo-dev

From: Guilherme Amadio <amadio@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] C++ standard in ebuilds
Date: Tue, 18 Sep 2018 14:26:21
Message-Id: 20180918142607.GA25320@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] C++ standard in ebuilds by Richard Yao
1 On Tue, Sep 18, 2018 at 08:46:46AM -0400, Richard Yao wrote:
2 >
3 > > On Sep 17, 2018, at 12:40 PM, Vadim A. Misbakh-Soloviov <gentoo@×××.name> wrote:
4 > >
5 > > I'd prefer to wait another replies on the list for the main theme of this e-
6 > > mail, but this problem also affects C (so, as **c**flags and C standards), so
7 > > solution shoudn't be c++ specific, imho.
8 > You would think that, but the C standard version does not effect ABI compatibility. We had a very long discussion about this in OpenZFS because the other platforms were using C99 while we had backported everything to C89 on Linux because of the Linux kernel. No one could find a single example of ABI breakage caused by mixing and matching C89 and C99 (C99 LKM and C89 kernel). After a few years of not a single example being raised, the Linux team lead opted to adopt C99.
9 >
10 > Now, there are flags affecting the ABI, but those are separate from the C standard version. As for C++, mixing standard versions does go badly because new language features require ABI changes.
11 > >
12
13 Yes, since mixing standard versions is not so good, and many ebuilds
14 hard-code it with append-cxxflags, I think it's worth discussing a
15 better solution that will avoid unnecessary breakage. The big problem
16 is going from C++14 to C++17 as mentioned before. The 'noexcept' became
17 part of the mangled name. C++17 also removes features, so there will be
18 code that will need to be changed to compile as well. If we have a
19 system-wide setting, we can start warning upstreams about it at least
20 when things break.
21
22 Cheers,
23 -Guilherme