public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: News item regarding c++98 vs c++11
@ 2014-10-19 22:53 Anthony G. Basile
  2014-10-19 22:57 ` Jeroen Roovers
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-19 22:53 UTC (permalink / raw
  To: Gentoo Development

Hi everyone,

I debated about whether to write a news item about c++11 abi. Usually 
our news items are about some change which requires user intervention.  
But this is just precautionary.  With more packages needing c++11 
because of source changes, we may want to inform users about breakage at 
the ABI level in case they do something like add -std=c++11 to their 
global CXXFLAGS.

Let me know if you think its worth sending out and/or any other suggestions.


Title: GCC 4.7 Introduces New c++11 ABI
Author: Anthony G. Basile <blueness@gentoo.org>
Content-Type: text/plain
Posted: 2014-10-20
Revision: 1
News-Item-Format: 1.0
Display-If-Installed: >=sys-devel/gcc-4.7.0
Display-If-Keyword: amd64
Display-If-Keyword: arm
Display-If-Keyword: mips
Display-If-Keyword: ppc
Display-If-Keyword: ppc64
Display-If-Keyword: x86
Display-If-Keyword: amd64-fbsd
Display-If-Keyword: x86-fbsd

GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along 
with
its GNU variant.  This new standard is not the default in GCC 4.7, 4.8 
or 4.9,
the default is still gnu++98, but it can be enabled by passing -std=c++11 or
-std=gnu++11 to CXXFLAGS.

Users that wish to try c++11 should exercise caution because it is not
ABI-compatible with c++98.  Thus linking c++98 and c++11 objects is 
likely to
cause breakage.  For packages which are self-contained and do not link 
against
any libraries written in C++, there is no problem.  However, switching 
to c++11
and then building packages which link against any of the numerous 
libraries still
in the older ABI, can lead to a crippled system.

This is a precautionary news item and the typical user need not do anything.
However, as c++11 gains in popularity and the number of packages using it
increase, it is important that users understand these precautions.

For an ABI compliance checker, and more information about C++ ABIs, see 
[2].

Ref.
[1] http://www.stroustrup.com/C++11FAQ.html
[2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 22:53 [gentoo-dev] RFC: News item regarding c++98 vs c++11 Anthony G. Basile
@ 2014-10-19 22:57 ` Jeroen Roovers
  2014-10-19 22:59   ` Anthony G. Basile
  2014-10-19 23:08 ` [gentoo-dev] " Alex Xu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 27+ messages in thread
From: Jeroen Roovers @ 2014-10-19 22:57 UTC (permalink / raw
  To: gentoo-dev

On Sun, 19 Oct 2014 18:53:43 -0400
"Anthony G. Basile" <blueness@gentoo.org> wrote:

> we may want to inform users about breakage at the ABI level in case
> they do something like add -std=c++11 to their global CXXFLAGS.

You mean tell them they get to keep the pieces?


     jer


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 22:57 ` Jeroen Roovers
@ 2014-10-19 22:59   ` Anthony G. Basile
  2014-10-20  4:59     ` [gentoo-dev] " Duncan
  0 siblings, 1 reply; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-19 22:59 UTC (permalink / raw
  To: gentoo-dev

On 10/19/14 18:57, Jeroen Roovers wrote:
> On Sun, 19 Oct 2014 18:53:43 -0400
> "Anthony G. Basile" <blueness@gentoo.org> wrote:
>
>> we may want to inform users about breakage at the ABI level in case
>> they do something like add -std=c++11 to their global CXXFLAGS.
> You mean tell them they get to keep the pieces?
>
>
>       jer
>

Yes.  I'm saying it politely.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 22:53 [gentoo-dev] RFC: News item regarding c++98 vs c++11 Anthony G. Basile
  2014-10-19 22:57 ` Jeroen Roovers
@ 2014-10-19 23:08 ` Alex Xu
  2014-10-20 11:30   ` Anthony G. Basile
  2014-10-20  6:36 ` Luca Barbato
  2014-10-20 16:21 ` [gentoo-dev] " "Paweł Hajdan, Jr."
  3 siblings, 1 reply; 27+ messages in thread
From: Alex Xu @ 2014-10-19 23:08 UTC (permalink / raw
  To: gentoo-dev

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

On 19/10/14 06:53 PM, Anthony G. Basile wrote:
> the default is still gnu++98

what does this mean, how does it differ from c++98?

> in the older ABI, can lead to a crippled system.

what do you mean, will other packages break too? maybe "may lead to
non-functioning or possibly broken packages". adjust as necessary; I am
not familiar with what may break if incompatible libraries are linked
together.

> However, as c++11 gains in popularity and the number of packages using it
> increase, it is important that users understand these precautions.

what precautions? what am I supposed to do? is there a option to warn me
if I try to do something stupid? should I check some packages on my system?

remember that gcc-4.7 is literally all (standard) gentoo users, so a
news item needs to be clear about who exactly needs to care about the
issue, which here appears to be a small subset of "all (standard) gentoo
users"; namely, those who specifically opt in to using C++11 (or are
compiling such packages manually).

also, strictly speaking, last I checked, the name of the standard is
C++11; c++11 is just what gcc takes.

and maybe some links about what could break if I link incompatible
libraries together would be helpful, since the links don't seem to go
over that (at least apparently; I did not read the entire contents).


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-19 22:59   ` Anthony G. Basile
@ 2014-10-20  4:59     ` Duncan
  2014-10-20 11:54       ` Anthony G. Basile
  0 siblings, 1 reply; 27+ messages in thread
From: Duncan @ 2014-10-20  4:59 UTC (permalink / raw
  To: gentoo-dev

Anthony G. Basile posted on Sun, 19 Oct 2014 18:59:41 -0400 as excerpted:

> On 10/19/14 18:57, Jeroen Roovers wrote:
>> On Sun, 19 Oct 2014 18:53:43 -0400 "Anthony G. Basile"
>> <blueness@gentoo.org> wrote:
>>
>>> we may want to inform users about breakage at the ABI level in case
>>> they do something like add -std=c++11 to their global CXXFLAGS.
>> You mean tell them they get to keep the pieces?
> 
> Yes.  I'm saying it politely.

The news item seems to suggest that users will be fine if they switch 
/everything/ using C++ to the new standard, alto it might be a bit tough 
getting to that point, but I'd guess an emerge --emptytree @world should 
do it, keeping track of what breaks if anything and attempting a later 
remerge of that package, which is what I've done when I've gone a year or 
two between upgrades, for instance, and it has taken patience but has 
worked.

But here it looks like the intent is to say they're on their own if they 
do it, even if the do it /all/ (using emptytree or the like to ensure 
it's all done in at least recorded dependency order), which is a quite 
different message than what I got from reading the news item.

So if you really wish to say that people electing to try c++11 are on 
their own, even if they rebuild everything, the news item needs to be 
reworded to say that.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman



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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 22:53 [gentoo-dev] RFC: News item regarding c++98 vs c++11 Anthony G. Basile
  2014-10-19 22:57 ` Jeroen Roovers
  2014-10-19 23:08 ` [gentoo-dev] " Alex Xu
@ 2014-10-20  6:36 ` Luca Barbato
  2014-10-20  8:23   ` Alexander Berntsen
  2014-10-20 16:21 ` [gentoo-dev] " "Paweł Hajdan, Jr."
  3 siblings, 1 reply; 27+ messages in thread
From: Luca Barbato @ 2014-10-20  6:36 UTC (permalink / raw
  To: gentoo-dev

On 20/10/14 00:53, Anthony G. Basile wrote:
> Hi everyone,
> 
> I debated about whether to write a news item about c++11 abi. Usually
> our news items are about some change which requires user intervention. 
> But this is just precautionary.  With more packages needing c++11
> because of source changes, we may want to inform users about breakage at
> the ABI level in case they do something like add -std=c++11 to their
> global CXXFLAGS.
> 
> Let me know if you think its worth sending out and/or any other
> suggestions.

Shorter form:

Since gcc-4.7 there is a -std=c++11 option, do not use it since it
breaks the ABI, resulting in a non-functional system.

lu



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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20  6:36 ` Luca Barbato
@ 2014-10-20  8:23   ` Alexander Berntsen
  2014-10-20 10:58     ` Anthony G. Basile
  0 siblings, 1 reply; 27+ messages in thread
From: Alexander Berntsen @ 2014-10-20  8:23 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 20/10/14 08:36, Luca Barbato wrote:
> Since gcc-4.7 there is a -std=c++11 option, do not use it since it 
> breaks the ABI, resulting in a non-functional system.
Since gcc-4.7 there is a -std=c++11 option, do not use it {+yet+}
since it breaks the ABI, resulting in a non-functional system.
- -- 
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlRExnsACgkQRtClrXBQc7XyIAD/du6PRahrLuVuWO2tTUuxPbOs
ttGMwOpQc6zwU6W5yOEBAJa8u2YPnJxL6v6J3DEUA+js3u22a3JAopPTcd6Fua6H
=UhZq
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20  8:23   ` Alexander Berntsen
@ 2014-10-20 10:58     ` Anthony G. Basile
  2014-10-20 13:47       ` [gentoo-dev] " Martin Vaeth
  2014-10-20 18:35       ` [gentoo-dev] " Ian Stakenvicius
  0 siblings, 2 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 10:58 UTC (permalink / raw
  To: gentoo-dev

On 10/20/14 04:23, Alexander Berntsen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 20/10/14 08:36, Luca Barbato wrote:
>> Since gcc-4.7 there is a -std=c++11 option, do not use it since it
>> breaks the ABI, resulting in a non-functional system.
> Since gcc-4.7 there is a -std=c++11 option, do not use it {+yet+}
> since it breaks the ABI, resulting in a non-functional system.

Yes.  Eventually we'll have to clear the road for this.  However, I 
don't think we'll ever want to support a mixed abi system.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 23:08 ` [gentoo-dev] " Alex Xu
@ 2014-10-20 11:30   ` Anthony G. Basile
  0 siblings, 0 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 11:30 UTC (permalink / raw
  To: gentoo-dev

On 10/19/14 19:08, Alex Xu wrote:
> On 19/10/14 06:53 PM, Anthony G. Basile wrote:
>> the default is still gnu++98
> what does this mean, how does it differ from c++98?

Its a gnu dialect.  I'm not sure of the details of how it deviates from 
the strict standard.  I'm more familiar with how c++11 differs from 
c++98.  Google around and let me know what you find.

>
>> in the older ABI, can lead to a crippled system.
> what do you mean, will other packages break too? maybe "may lead to
> non-functioning or possibly broken packages". adjust as necessary; I am
> not familiar with what may break if incompatible libraries are linked
> together.

If you build a library in the "other" abi, then executables which link 
against it may fail.  I say "may" because you might get lucky and just 
miss one of the changes.  See 
https://gcc.gnu.org/wiki/Cxx11AbiCompatibility.  That's only for gcc-4.7 
though.  I got a feeling that list is not complete.

>
>> However, as c++11 gains in popularity and the number of packages using it
>> increase, it is important that users understand these precautions.
> what precautions? what am I supposed to do? is there a option to warn me
> if I try to do something stupid? should I check some packages on my system?

Do nothing.  A careful reading implies that you should not just add 
-std=c++11 or gnu++11 to your compiler flags without knowing that things 
can break.  I can emphasis that at this point.

>
> remember that gcc-4.7 is literally all (standard) gentoo users, so a
> news item needs to be clear about who exactly needs to care about the
> issue, which here appears to be a small subset of "all (standard) gentoo
> users"; namely, those who specifically opt in to using C++11 (or are
> compiling such packages manually).

User fool around with stuff all the time which I like.  This is a 
cautionary note which increases awareness especially when we get bug 
reports.  The real question to my colleagues is whether they think this 
is news worthy or not.  I don't want to turn it into a c++11 gentoo howto.

>
> also, strictly speaking, last I checked, the name of the standard is
> C++11; c++11 is just what gcc takes.
>
> and maybe some links about what could break if I link incompatible
> libraries together would be helpful, since the links don't seem to go
> over that (at least apparently; I did not read the entire contents).
>

Basically what happens is you get unresolved symbols. You will know them 
because of the charactarist c++ mangled names which you can demangle 
with c++filt.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-20  4:59     ` [gentoo-dev] " Duncan
@ 2014-10-20 11:54       ` Anthony G. Basile
  0 siblings, 0 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 11:54 UTC (permalink / raw
  To: gentoo-dev

On 10/20/14 00:59, Duncan wrote:
> Anthony G. Basile posted on Sun, 19 Oct 2014 18:59:41 -0400 as excerpted:
>
>> On 10/19/14 18:57, Jeroen Roovers wrote:
>>> On Sun, 19 Oct 2014 18:53:43 -0400 "Anthony G. Basile"
>>> <blueness@gentoo.org> wrote:
>>>
>>>> we may want to inform users about breakage at the ABI level in case
>>>> they do something like add -std=c++11 to their global CXXFLAGS.
>>> You mean tell them they get to keep the pieces?
>>
>> Yes.  I'm saying it politely.
>
> The news item seems to suggest that users will be fine if they switch
> /everything/ using C++ to the new standard, alto it might be a bit tough
> getting to that point, but I'd guess an emerge --emptytree @world should
> do it, keeping track of what breaks if anything and attempting a later
> remerge of that package, which is what I've done when I've gone a year or
> two between upgrades, for instance, and it has taken patience but has
> worked.

I have not tested emerge -e @world and would rather not suggest anything 
if someone wants c++11.  I plan on testing on fresh systems from our 
stage3's.

>
> But here it looks like the intent is to say they're on their own if they
> do it, even if the do it /all/ (using emptytree or the like to ensure
> it's all done in at least recorded dependency order), which is a quite
> different message than what I got from reading the news item.
>
> So if you really wish to say that people electing to try c++11 are on
> their own, even if they rebuild everything, the news item needs to be
> reworded to say that.
>

I do not want to make this into a c++11 howto.  I want people aware 
especially so they 1) don't inadvertantly break stuff and 2) the bug 
reports will be better informed.


-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


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

* [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-20 10:58     ` Anthony G. Basile
@ 2014-10-20 13:47       ` Martin Vaeth
  2014-10-20 15:10         ` Rich Freeman
  2014-10-20 18:35       ` [gentoo-dev] " Ian Stakenvicius
  1 sibling, 1 reply; 27+ messages in thread
From: Martin Vaeth @ 2014-10-20 13:47 UTC (permalink / raw
  To: gentoo-dev

Anthony G. Basile <blueness@gentoo.org> wrote:
>> Since gcc-4.7 there is a -std=c++11 option, do not use it {+yet+}
>> since it breaks the ABI, resulting in a non-functional system.
>
> Yes.  Eventually we'll have to clear the road for this.

Isn't Diego just starting a gcc-4.9 tinderbox run?

It might be worth to try with -std=gnu++11 immediately:
Most API incompatibilities which I experienced in my projects
were either name clashes (with symbols not existing yet in c++98)
or other trivial things (like some "char *" returns intead of
"const char *" returns etc.); cleanly written code is likely
to be upward compatible without any issues.



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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-20 13:47       ` [gentoo-dev] " Martin Vaeth
@ 2014-10-20 15:10         ` Rich Freeman
  0 siblings, 0 replies; 27+ messages in thread
From: Rich Freeman @ 2014-10-20 15:10 UTC (permalink / raw
  To: gentoo-dev

On Mon, Oct 20, 2014 at 9:47 AM, Martin Vaeth <martin@mvath.de> wrote:
> Anthony G. Basile <blueness@gentoo.org> wrote:
>>> Since gcc-4.7 there is a -std=c++11 option, do not use it {+yet+}
>>> since it breaks the ABI, resulting in a non-functional system.
>>
>> Yes.  Eventually we'll have to clear the road for this.
>
> Isn't Diego just starting a gcc-4.9 tinderbox run?
>
> It might be worth to try with -std=gnu++11 immediately:
> Most API incompatibilities which I experienced in my projects
> were either name clashes (with symbols not existing yet in c++98)
> or other trivial things (like some "char *" returns intead of
> "const char *" returns etc.); cleanly written code is likely
> to be upward compatible without any issues.
>

Probably worth doing in general, but I think it makes sense to get rid
of all the roadblocks to getting 4.9.1 working with the old ABI first.
Now excuse me while I got try to reproduce a tinderbox failure...  :)

--
Rich


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-19 22:53 [gentoo-dev] RFC: News item regarding c++98 vs c++11 Anthony G. Basile
                   ` (2 preceding siblings ...)
  2014-10-20  6:36 ` Luca Barbato
@ 2014-10-20 16:21 ` "Paweł Hajdan, Jr."
  2014-10-20 19:42   ` Anthony G. Basile
  3 siblings, 1 reply; 27+ messages in thread
From: "Paweł Hajdan, Jr." @ 2014-10-20 16:21 UTC (permalink / raw
  To: gentoo-dev

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

On 10/20/14 12:53 AM, Anthony G. Basile wrote:
> GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along
> with
> its GNU variant.  This new standard is not the default in GCC 4.7, 4.8
> or 4.9,
> the default is still gnu++98, but it can be enabled by passing
> -std=c++11 or
> -std=gnu++11 to CXXFLAGS.
> 
> Users that wish to try c++11 should exercise caution because it is not
> ABI-compatible with c++98.

This seems to focus on the Gentoo user adding -std=c++11 to CXXFLAGS.

Do we consider this #1 problem with gcc-4.8 or 4.7+?

As far as I'm concerned, the big issue is e.g.
<https://bugs.gentoo.org/show_bug.cgi?id=513386>, where having gcc-4.7
and gcc-4.8 installed on the same system (and using gcc-4.7 as the
active gcc version) is known to be broken.

Another concern I have with the above news item is it might actually
encourage "crazy" users to add -std=c++11 to CXXFLAGS, even though
otherwise they wouldn't even know about the flag.

To summarize, my suggestion is to make sure we clearly communicate known
bugs reported to Gentoo, like example above one.

Paweł


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20 10:58     ` Anthony G. Basile
  2014-10-20 13:47       ` [gentoo-dev] " Martin Vaeth
@ 2014-10-20 18:35       ` Ian Stakenvicius
  2014-10-20 19:49         ` Anthony G. Basile
  2014-10-21  8:45         ` [gentoo-dev] " Martin Vaeth
  1 sibling, 2 replies; 27+ messages in thread
From: Ian Stakenvicius @ 2014-10-20 18:35 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 20/10/14 06:58 AM, Anthony G. Basile wrote:
> On 10/20/14 04:23, Alexander Berntsen wrote:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> On 20/10/14 08:36, Luca Barbato wrote:
>>> Since gcc-4.7 there is a -std=c++11 option, do not use it since
>>> it breaks the ABI, resulting in a non-functional system.
>> Since gcc-4.7 there is a -std=c++11 option, do not use it
>> {+yet+} since it breaks the ABI, resulting in a non-functional
>> system.
> 
> Yes.  Eventually we'll have to clear the road for this.  However,
> I don't think we'll ever want to support a mixed abi system.
> 

Can we, even?  Would it be a mixed-abi system or a multi-abi system?


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iF4EAREIAAYFAlRFVgwACgkQ2ugaI38ACPCDYwD+JWeZv7wu0Ot4VmTUJ1pzLxzq
K/vRu9vBd+oYLzZLMm0A/1VMtKXCY5yD3pRJJKMB+Wx+g/1jN7XblluM1IIfrlNK
=1uAG
-----END PGP SIGNATURE-----


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20 16:21 ` [gentoo-dev] " "Paweł Hajdan, Jr."
@ 2014-10-20 19:42   ` Anthony G. Basile
  0 siblings, 0 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 19:42 UTC (permalink / raw
  To: gentoo-dev

On 10/20/14 12:21, "Paweł Hajdan, Jr." wrote:
> On 10/20/14 12:53 AM, Anthony G. Basile wrote:
>> GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along
>> with
>> its GNU variant.  This new standard is not the default in GCC 4.7, 4.8
>> or 4.9,
>> the default is still gnu++98, but it can be enabled by passing
>> -std=c++11 or
>> -std=gnu++11 to CXXFLAGS.
>>
>> Users that wish to try c++11 should exercise caution because it is not
>> ABI-compatible with c++98.
>
> This seems to focus on the Gentoo user adding -std=c++11 to CXXFLAGS.
>
> Do we consider this #1 problem with gcc-4.8 or 4.7+?
>
> As far as I'm concerned, the big issue is e.g.
> <https://bugs.gentoo.org/show_bug.cgi?id=513386>, where having gcc-4.7
> and gcc-4.8 installed on the same system (and using gcc-4.7 as the
> active gcc version) is known to be broken.
>

This is one step beyond the news item.  In addition to the 
incompatibility between c++98 abi and c++11, you can expect c++11 code 
compiled with gcc-4.7 to not work with c++11 compiled with 4.8 and vice 
versa.  But this is our problem, not the users'.  When we start to 
support c++11 in full force, we may need to block earlier versions of 
gcc on certain packages to avoid the above mismatch, maintain patches, 
etc.  Its premature to say.

> Another concern I have with the above news item is it might actually
> encourage "crazy" users to add -std=c++11 to CXXFLAGS, even though
> otherwise they wouldn't even know about the flag.

If you tell a child "don't touch!" they will.  I agree with you, and 
debated for exactly this reason, but in the end, I think its better to 
have a informed public.  We'll get better bug reports and better 
co-operation.

This is the problem with a "form source" distro.  We can't control how 
the users will build their executables and this is one case where you 
can break things.

>
> To summarize, my suggestion is to make sure we clearly communicate known
> bugs reported to Gentoo, like example above one.

I could add another sentence that the resulting abi is also gcc version 
dependant, but I don't want to go too far because we aren't supporting 
c++11 yet.

>
> Paweł
>


-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20 18:35       ` [gentoo-dev] " Ian Stakenvicius
@ 2014-10-20 19:49         ` Anthony G. Basile
  2014-10-20 19:50           ` Anthony G. Basile
  2014-10-21  8:45         ` [gentoo-dev] " Martin Vaeth
  1 sibling, 1 reply; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 19:49 UTC (permalink / raw
  To: gentoo-dev

On 10/20/14 14:35, Ian Stakenvicius wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On 20/10/14 06:58 AM, Anthony G. Basile wrote:
>> On 10/20/14 04:23, Alexander Berntsen wrote:
>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>>
>>> On 20/10/14 08:36, Luca Barbato wrote:
>>>> Since gcc-4.7 there is a -std=c++11 option, do not use it since
>>>> it breaks the ABI, resulting in a non-functional system.
>>> Since gcc-4.7 there is a -std=c++11 option, do not use it
>>> {+yet+} since it breaks the ABI, resulting in a non-functional
>>> system.
>>
>> Yes.  Eventually we'll have to clear the road for this.  However,
>> I don't think we'll ever want to support a mixed abi system.
>>
>
> Can we, even?  Would it be a mixed-abi system or a multi-abi system?
>
>

The correct thing for upstream to do is to bump the soname.  But right 
now, we have:

readelf -d /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6.0.17 | 
grep SONAME

readelf -d  /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/libstdc++.so.6.0.18 | 
grep SONAME

  readelf -d  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/libstdc++.so.6.0.20 
| grep SONAME

all yielding

  0x000000000000000e (SONAME)             Library soname: [libstdc++.so.6]

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA


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

* Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11
  2014-10-20 19:49         ` Anthony G. Basile
@ 2014-10-20 19:50           ` Anthony G. Basile
  0 siblings, 0 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-20 19:50 UTC (permalink / raw
  To: gentoo-dev

On 10/20/14 15:49, Anthony G. Basile wrote:
> On 10/20/14 14:35, Ian Stakenvicius wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> On 20/10/14 06:58 AM, Anthony G. Basile wrote:
>>> On 10/20/14 04:23, Alexander Berntsen wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>>>>
>>>> On 20/10/14 08:36, Luca Barbato wrote:
>>>>> Since gcc-4.7 there is a -std=c++11 option, do not use it since
>>>>> it breaks the ABI, resulting in a non-functional system.
>>>> Since gcc-4.7 there is a -std=c++11 option, do not use it
>>>> {+yet+} since it breaks the ABI, resulting in a non-functional
>>>> system.
>>>
>>> Yes.  Eventually we'll have to clear the road for this.  However,
>>> I don't think we'll ever want to support a mixed abi system.
>>>
>>
>> Can we, even?  Would it be a mixed-abi system or a multi-abi system?
>>
>>
>
> The correct thing for upstream to do is to bump the soname.  But right
> now, we have:
>
> readelf -d /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/libstdc++.so.6.0.17 |
> grep SONAME
>
> readelf -d  /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/libstdc++.so.6.0.18 |
> grep SONAME
>
>   readelf -d  /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/libstdc++.so.6.0.20
> | grep SONAME
>
> all yielding
>
>   0x000000000000000e (SONAME)             Library soname: [libstdc++.so.6]
>

Oh wait sorry, that's a confusion with the gcc-4.7 vs 4.8 problem.  As 
far as the c++98 vs c++11, I'm not sure.

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


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

* [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-20 18:35       ` [gentoo-dev] " Ian Stakenvicius
  2014-10-20 19:49         ` Anthony G. Basile
@ 2014-10-21  8:45         ` Martin Vaeth
  2014-10-21 14:25           ` Mike Gilbert
  1 sibling, 1 reply; 27+ messages in thread
From: Martin Vaeth @ 2014-10-21  8:45 UTC (permalink / raw
  To: gentoo-dev

Ian Stakenvicius <axs@gentoo.org> wrote:
> On 20/10/14 06:58 AM, Anthony G. Basile wrote:
>
>> I don't think we'll ever want to support a mixed abi system.
>
> Can we, even?  Would it be a mixed-abi system or a multi-abi system?

I am afraid, we *have* to, in the moment when at least one program
adds -std=c++11 or -std=gnu++11 by itself (which AFAIK chromium does;
also eix does, if it can).

If not all C++ dependencies of that program (e.g. chromium)
are compiled with -std=c++11, you "automatically" get ABI-mixture.
(For eix, this is not the case, since eix has no dependencies
on C++ programs).

That's why I am not sure whether it is a good idea to discourage
users from -std=gnu++11: It might in fact even increase stability
of such programs which require the new language standard, and if
all programs do compile with this flag, it is completely "safe".



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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-21  8:45         ` [gentoo-dev] " Martin Vaeth
@ 2014-10-21 14:25           ` Mike Gilbert
  2014-10-21 17:09             ` "Paweł Hajdan, Jr."
  2014-10-21 20:16             ` Martin Vaeth
  0 siblings, 2 replies; 27+ messages in thread
From: Mike Gilbert @ 2014-10-21 14:25 UTC (permalink / raw
  To: Gentoo Dev

On Tue, Oct 21, 2014 at 4:45 AM, Martin Vaeth <martin@mvath.de> wrote:
> Ian Stakenvicius <axs@gentoo.org> wrote:
>> On 20/10/14 06:58 AM, Anthony G. Basile wrote:
>>
>>> I don't think we'll ever want to support a mixed abi system.
>>
>> Can we, even?  Would it be a mixed-abi system or a multi-abi system?
>
> I am afraid, we *have* to, in the moment when at least one program
> adds -std=c++11 or -std=gnu++11 by itself (which AFAIK chromium does;
> also eix does, if it can).

FYI, Chromium currently has a ban on using C++ 11 library features. I
imagine that helps on a system/toolchain with C++ 98 libs.

http://chromium-cpp.appspot.com/


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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-21 14:25           ` Mike Gilbert
@ 2014-10-21 17:09             ` "Paweł Hajdan, Jr."
  2014-10-21 20:16             ` Martin Vaeth
  1 sibling, 0 replies; 27+ messages in thread
From: "Paweł Hajdan, Jr." @ 2014-10-21 17:09 UTC (permalink / raw
  To: gentoo-dev

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

On 10/21/14 4:25 PM, Mike Gilbert wrote:
> On Tue, Oct 21, 2014 at 4:45 AM, Martin Vaeth <martin@mvath.de> wrote:
>> Ian Stakenvicius <axs@gentoo.org> wrote:
>>> On 20/10/14 06:58 AM, Anthony G. Basile wrote:
>>>
>>>> I don't think we'll ever want to support a mixed abi system.
>>>
>>> Can we, even?  Would it be a mixed-abi system or a multi-abi system?
>>
>> I am afraid, we *have* to, in the moment when at least one program
>> adds -std=c++11 or -std=gnu++11 by itself (which AFAIK chromium does;
>> also eix does, if it can).
> 
> FYI, Chromium currently has a ban on using C++ 11 library features. I
> imagine that helps on a system/toolchain with C++ 98 libs.
> 
> http://chromium-cpp.appspot.com/

Good catch. Two more observations:

1. The ban on C++11 library features will eventually get lifted as
toolchain support on all platforms improves.

2. We may be linking against C++ libraries like ICU. I'd need to check
that, and in many cases it would be Gentoo-specific thing since upstream
uses bundled libs by default.

Paweł



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

* [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-21 14:25           ` Mike Gilbert
  2014-10-21 17:09             ` "Paweł Hajdan, Jr."
@ 2014-10-21 20:16             ` Martin Vaeth
  2014-10-24 14:31               ` Anthony G. Basile
  1 sibling, 1 reply; 27+ messages in thread
From: Martin Vaeth @ 2014-10-21 20:16 UTC (permalink / raw
  To: gentoo-dev

Mike Gilbert <floppym@gentoo.org> wrote:
>
> FYI, Chromium currently has a ban on using C++ 11 library features.

I do not see how this would help to avoid the problem:
If a function with the same name returns a different type
in c++98 than in c++11, you could only avoid the problem by
not using the function at all (neither in the c++11 code
nor in the c++98 code, since each may refer to the "wrong"
symbol).

Of course, if all C++ dependencies are bundled,
as is apparently the case for "original" chromium,
the problem does not occur at all,  because in this
case everything just uses the c++11 library.



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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-21 20:16             ` Martin Vaeth
@ 2014-10-24 14:31               ` Anthony G. Basile
  2014-10-24 15:10                 ` Alex Xu
  2014-10-24 15:31                 ` "Paweł Hajdan, Jr."
  0 siblings, 2 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-24 14:31 UTC (permalink / raw
  To: gentoo-dev

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

HI everyone,

I've update the c++ news item for your consideration.  I incorporated 
suggestions, in particular a note about incompatibility between c++11 
compiled with different version of gcc differing in minor number (eg 4.7 
and 4.8).


-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197

[-- Attachment #2: c++11.txt --]
[-- Type: text/plain, Size: 1671 bytes --]

Title: GCC 4.7 Introduces New c++11 ABI 
Author: Anthony G. Basile <blueness@gentoo.org>
Content-Type: text/plain
Posted: 2014-10-20
Revision: 1
News-Item-Format: 1.0
Display-If-Installed: >=sys-devel/gcc-4.7.0
Display-If-Keyword: amd64
Display-If-Keyword: arm
Display-If-Keyword: mips
Display-If-Keyword: ppc
Display-If-Keyword: ppc64
Display-If-Keyword: x86
Display-If-Keyword: amd64-fbsd
Display-If-Keyword: x86-fbsd

GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along with
its GNU variant.  This new standard is not the default in GCC 4.7, 4.8 or 4.9,
the default is still gnu++98, but it can be enabled by passing -std=c++11 or
-std=gnu++11 to CXXFLAGS.

Users that wish to try c++11 should exercise caution because it is not
ABI-compatible with c++98.  Nor is c++11 code compiled with gcc-4.7 ABI-compatible
with c++11 compiled with 4.8, and vice versa.  Thus linking c++98 and c++11, or
c++11 compiled with different versions of gcc, is likely to cause breakage.  For
packages which are self-contained or do not link against any libraries written
in C++, there is no problem.  However, switching to c++11 and then building
packages which link against any of the numerous libraries in an incompatible
ABI can lead to a broken system.

This is a precautionary news item and the typical user need not do anything.
However, as c++11 gains in popularity and the number of packages using it
increase, it is important that users understand these issues.

For an ABI compliance checker, and more information about C++ ABIs, see [2].  

Ref.
[1] http://www.stroustrup.com/C++11FAQ.html
[2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker

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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-24 14:31               ` Anthony G. Basile
@ 2014-10-24 15:10                 ` Alex Xu
  2014-10-24 15:31                 ` "Paweł Hajdan, Jr."
  1 sibling, 0 replies; 27+ messages in thread
From: Alex Xu @ 2014-10-24 15:10 UTC (permalink / raw
  To: gentoo-dev

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

On 24/10/14 10:31 AM, Anthony G. Basile wrote:
> HI everyone,
> 
> I've update the c++ news item for your consideration.  I incorporated
> suggestions, in particular a note about incompatibility between c++11
> compiled with different version of gcc differing in minor number (eg 4.7
> and 4.8).
> 
> 
lgtm. also mime attachments are hard to comment on.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-24 14:31               ` Anthony G. Basile
  2014-10-24 15:10                 ` Alex Xu
@ 2014-10-24 15:31                 ` "Paweł Hajdan, Jr."
  2014-10-24 17:29                   ` Anthony G. Basile
  1 sibling, 1 reply; 27+ messages in thread
From: "Paweł Hajdan, Jr." @ 2014-10-24 15:31 UTC (permalink / raw
  To: gentoo-dev

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

On 10/24/14 4:31 PM, Anthony G. Basile wrote:
> I've update the c++ news item for your consideration.  I incorporated
> suggestions, in particular a note about incompatibility between c++11
> compiled with different version of gcc differing in minor number (eg 4.7
> and 4.8).

Thanks, I think this is an improvement.

I'd still prefer an explicit mention that having gcc-4.7 and 4.8
installed simultaneously leads to known breakages, especially if 4.7 is
the active gcc version. The text of the news item implies this, but it's
just not obvious.

Also consider explicitly mentioning
<https://bugs.gentoo.org/show_bug.cgi?id=513386>. Obviously this
wouldn't be a complete list of issues, but from the CC list it's a
pretty common bug.

If in doubt, consider this question: what would be bad about including
the info I suggested above?

Paweł

> Title: GCC 4.7 Introduces New c++11 ABI 
> Author: Anthony G. Basile <blueness@gentoo.org>
> Content-Type: text/plain
> Posted: 2014-10-20
> Revision: 1
> News-Item-Format: 1.0
> Display-If-Installed: >=sys-devel/gcc-4.7.0
> Display-If-Keyword: amd64
> Display-If-Keyword: arm
> Display-If-Keyword: mips
> Display-If-Keyword: ppc
> Display-If-Keyword: ppc64
> Display-If-Keyword: x86
> Display-If-Keyword: amd64-fbsd
> Display-If-Keyword: x86-fbsd
> 
> GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1], along with
> its GNU variant.  This new standard is not the default in GCC 4.7, 4.8 or 4.9,
> the default is still gnu++98, but it can be enabled by passing -std=c++11 or
> -std=gnu++11 to CXXFLAGS.
> 
> Users that wish to try c++11 should exercise caution because it is not
> ABI-compatible with c++98.  Nor is c++11 code compiled with gcc-4.7 ABI-compatible
> with c++11 compiled with 4.8, and vice versa.  Thus linking c++98 and c++11, or
> c++11 compiled with different versions of gcc, is likely to cause breakage.  For
> packages which are self-contained or do not link against any libraries written
> in C++, there is no problem.  However, switching to c++11 and then building
> packages which link against any of the numerous libraries in an incompatible
> ABI can lead to a broken system.
> 
> This is a precautionary news item and the typical user need not do anything.
> However, as c++11 gains in popularity and the number of packages using it
> increase, it is important that users understand these issues.
> 
> For an ABI compliance checker, and more information about C++ ABIs, see [2].  
> 
> Ref.
> [1] http://www.stroustrup.com/C++11FAQ.html
> [2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-24 15:31                 ` "Paweł Hajdan, Jr."
@ 2014-10-24 17:29                   ` Anthony G. Basile
  2014-10-25  9:32                     ` "Paweł Hajdan, Jr."
  0 siblings, 1 reply; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-24 17:29 UTC (permalink / raw
  To: gentoo-dev

On 10/24/14 11:31, "Paweł Hajdan, Jr." wrote:
> On 10/24/14 4:31 PM, Anthony G. Basile wrote:
>> I've update the c++ news item for your consideration.  I incorporated
>> suggestions, in particular a note about incompatibility between c++11
>> compiled with different version of gcc differing in minor number (eg 4.7
>> and 4.8).
>
> Thanks, I think this is an improvement.
>
> I'd still prefer an explicit mention that having gcc-4.7 and 4.8
> installed simultaneously leads to known breakages, especially if 4.7 is
> the active gcc version. The text of the news item implies this, but it's
> just not obvious.
>
> Also consider explicitly mentioning
> <https://bugs.gentoo.org/show_bug.cgi?id=513386>. Obviously this
> wouldn't be a complete list of issues, but from the CC list it's a
> pretty common bug.
>

I agree, this bug is an example of the issues we'll have to face moving 
forward with 4.8/4.9 and c++.  I can reference it.

> If in doubt, consider this question: what would be bad about including
> the info I suggested above?

You don't need to convince me.  Its a good example.  There's no 
particular reason I didn't mention it.

>
> Paweł
>

So I don't have to keep email the entire item to the list, how about 
just adding it as follows:

"Nor is c++11 code compiled with gcc-4.7 ABI-compatible with c++11 
compiled with 4.8, and vice versa.  An example can be see in ref. [2]"

Ref.
[2] https://bugs.gentoo.org/show_bug.cgi?id=513386


-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-24 17:29                   ` Anthony G. Basile
@ 2014-10-25  9:32                     ` "Paweł Hajdan, Jr."
  2014-10-26 11:19                       ` Anthony G. Basile
  0 siblings, 1 reply; 27+ messages in thread
From: "Paweł Hajdan, Jr." @ 2014-10-25  9:32 UTC (permalink / raw
  To: gentoo-dev

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

On 10/24/14 7:29 PM, Anthony G. Basile wrote:
> So I don't have to keep email the entire item to the list, how about 
> just adding it as follows:
> 
> "Nor is c++11 code compiled with gcc-4.7 ABI-compatible with c++11 
> compiled with 4.8, and vice versa.  An example can be see in ref.
> [2]"
> 
> Ref. [2] https://bugs.gentoo.org/show_bug.cgi?id=513386

I think this could still be clearer about the user/sysadmin perspective
more than a developer perspective, i.e. present this more like "both
gcc-4.7 and 4.8 installed with 4.7 being active" than "not
ABI-compatible with C++11 compiled with 4.8".

Here's my suggested draft:

-----%<----- CUT HERE -----%<-----
GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1].

Users that wish to try enabling C++11 globally (e.g. using CXXFLAGS)
should exercise caution because it is not ABI-compatible with C++98.
Packages which are self-contained or do not link against any libraries
written in C++ are not affected. Note that some packages like
www-client/chromium and net-libs/webkit-gtk among others are already
using C++11 features.

Even having different versions of gcc installed simultaneously might
lead to problems, especially if the active version of gcc is older.
Please see [2] for example known bug with webkit-gtk. It is recommended
to set the latest installed version of gcc as active; some packages may
work when an older version is selected, but GCC upstream provides no
guarantees of C++11 ABI stability for code compiled with gcc-4.x and 4.y
for any x != y [3].

Ref.
[1] http://www.stroustrup.com/C++11FAQ.html
[2] https://bugs.gentoo.org/show_bug.cgi?id=513386
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61758
-----%<----- CUT HERE -----%<-----

Paweł


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

* Re: [gentoo-dev] Re: RFC: News item regarding c++98 vs c++11
  2014-10-25  9:32                     ` "Paweł Hajdan, Jr."
@ 2014-10-26 11:19                       ` Anthony G. Basile
  0 siblings, 0 replies; 27+ messages in thread
From: Anthony G. Basile @ 2014-10-26 11:19 UTC (permalink / raw
  To: gentoo-dev

On 10/25/14 05:32, "Paweł Hajdan, Jr." wrote:
> On 10/24/14 7:29 PM, Anthony G. Basile wrote:
>> So I don't have to keep email the entire item to the list, how about
>> just adding it as follows:
>>
>> "Nor is c++11 code compiled with gcc-4.7 ABI-compatible with c++11
>> compiled with 4.8, and vice versa.  An example can be see in ref.
>> [2]"
>>
>> Ref. [2] https://bugs.gentoo.org/show_bug.cgi?id=513386
>
> I think this could still be clearer about the user/sysadmin perspective
> more than a developer perspective, i.e. present this more like "both
> gcc-4.7 and 4.8 installed with 4.7 being active" than "not
> ABI-compatible with C++11 compiled with 4.8".
>
> Here's my suggested draft:
>
> -----%<----- CUT HERE -----%<-----
> GCC 4.7 introduced the new experimental 2011 ISO C++ standard [1].
>
> Users that wish to try enabling C++11 globally (e.g. using CXXFLAGS)
> should exercise caution because it is not ABI-compatible with C++98.
> Packages which are self-contained or do not link against any libraries
> written in C++ are not affected. Note that some packages like
> www-client/chromium and net-libs/webkit-gtk among others are already
> using C++11 features.
>
> Even having different versions of gcc installed simultaneously might
> lead to problems, especially if the active version of gcc is older.
> Please see [2] for example known bug with webkit-gtk. It is recommended
> to set the latest installed version of gcc as active; some packages may
> work when an older version is selected, but GCC upstream provides no
> guarantees of C++11 ABI stability for code compiled with gcc-4.x and 4.y
> for any x != y [3].
>
> Ref.
> [1] http://www.stroustrup.com/C++11FAQ.html
> [2] https://bugs.gentoo.org/show_bug.cgi?id=513386
> [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61758
> -----%<----- CUT HERE -----%<-----
>
> Paweł
>

I incorporated these points, but did not replace my original language. 
Both perspectives are now in there.

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197


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

end of thread, other threads:[~2014-10-26 11:18 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-19 22:53 [gentoo-dev] RFC: News item regarding c++98 vs c++11 Anthony G. Basile
2014-10-19 22:57 ` Jeroen Roovers
2014-10-19 22:59   ` Anthony G. Basile
2014-10-20  4:59     ` [gentoo-dev] " Duncan
2014-10-20 11:54       ` Anthony G. Basile
2014-10-19 23:08 ` [gentoo-dev] " Alex Xu
2014-10-20 11:30   ` Anthony G. Basile
2014-10-20  6:36 ` Luca Barbato
2014-10-20  8:23   ` Alexander Berntsen
2014-10-20 10:58     ` Anthony G. Basile
2014-10-20 13:47       ` [gentoo-dev] " Martin Vaeth
2014-10-20 15:10         ` Rich Freeman
2014-10-20 18:35       ` [gentoo-dev] " Ian Stakenvicius
2014-10-20 19:49         ` Anthony G. Basile
2014-10-20 19:50           ` Anthony G. Basile
2014-10-21  8:45         ` [gentoo-dev] " Martin Vaeth
2014-10-21 14:25           ` Mike Gilbert
2014-10-21 17:09             ` "Paweł Hajdan, Jr."
2014-10-21 20:16             ` Martin Vaeth
2014-10-24 14:31               ` Anthony G. Basile
2014-10-24 15:10                 ` Alex Xu
2014-10-24 15:31                 ` "Paweł Hajdan, Jr."
2014-10-24 17:29                   ` Anthony G. Basile
2014-10-25  9:32                     ` "Paweł Hajdan, Jr."
2014-10-26 11:19                       ` Anthony G. Basile
2014-10-20 16:21 ` [gentoo-dev] " "Paweł Hajdan, Jr."
2014-10-20 19:42   ` 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