Gentoo Archives: gentoo-dev

From: "Anthony G. Basile" <blueness@g.o>
To: Gentoo Development <gentoo-dev@l.g.o>
Subject: [gentoo-dev] RFC: News item regarding c++98 vs c++11
Date: Sun, 19 Oct 2014 22:52:41
Message-Id: 544440F7.2020507@gentoo.org
1 Hi everyone,
2
3 I debated about whether to write a news item about c++11 abi. Usually
4 our news items are about some change which requires user intervention.
5 But this is just precautionary. With more packages needing c++11
6 because of source changes, we may want to inform users about breakage at
7 the ABI level in case they do something like add -std=c++11 to their
8 global CXXFLAGS.
9
10 Let me know if you think its worth sending out and/or any other suggestions.
11
12
13 Title: GCC 4.7 Introduces New c++11 ABI
14 Author: Anthony G. Basile <blueness@g.o>
15 Content-Type: text/plain
16 Posted: 2014-10-20
17 Revision: 1
18 News-Item-Format: 1.0
19 Display-If-Installed: >=sys-devel/gcc-4.7.0
20 Display-If-Keyword: amd64
21 Display-If-Keyword: arm
22 Display-If-Keyword: mips
23 Display-If-Keyword: ppc
24 Display-If-Keyword: ppc64
25 Display-If-Keyword: x86
26 Display-If-Keyword: amd64-fbsd
27 Display-If-Keyword: x86-fbsd
28
29 GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along
30 with
31 its GNU variant. This new standard is not the default in GCC 4.7, 4.8
32 or 4.9,
33 the default is still gnu++98, but it can be enabled by passing -std=c++11 or
34 -std=gnu++11 to CXXFLAGS.
35
36 Users that wish to try c++11 should exercise caution because it is not
37 ABI-compatible with c++98. Thus linking c++98 and c++11 objects is
38 likely to
39 cause breakage. For packages which are self-contained and do not link
40 against
41 any libraries written in C++, there is no problem. However, switching
42 to c++11
43 and then building packages which link against any of the numerous
44 libraries still
45 in the older ABI, can lead to a crippled system.
46
47 This is a precautionary news item and the typical user need not do anything.
48 However, as c++11 gains in popularity and the number of packages using it
49 increase, it is important that users understand these precautions.
50
51 For an ABI compliance checker, and more information about C++ ABIs, see
52 [2].
53
54 Ref.
55 [1] http://www.stroustrup.com/C++11FAQ.html
56 [2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker
57
58 --
59 Anthony G. Basile, Ph.D.
60 Gentoo Linux Developer [Hardened]
61 E-Mail : blueness@g.o
62 GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
63 GnuPG ID : F52D4BBA

Replies