Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Luca Barbato
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




Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Alexander Berntsen
-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
berna...@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-



Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Anthony G. Basile

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: bluen...@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA




Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Anthony G. Basile

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: bluen...@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA




Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Paweł Hajdan, Jr.
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ł



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Ian Stakenvicius
-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-



Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Anthony G. Basile

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



Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Anthony G. Basile

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

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

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



Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Anthony G. Basile

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

  0x000e (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



[gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-19 Thread Anthony G. Basile

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 bluen...@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: bluen...@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA




Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-19 Thread Jeroen Roovers
On Sun, 19 Oct 2014 18:53:43 -0400
Anthony G. Basile bluen...@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



Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-19 Thread Anthony G. Basile

On 10/19/14 18:57, Jeroen Roovers wrote:

On Sun, 19 Oct 2014 18:53:43 -0400
Anthony G. Basile bluen...@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: bluen...@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA




Re: [gentoo-dev] RFC: News item regarding c++98 vs c++11

2014-10-19 Thread Alex Xu
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).



signature.asc
Description: OpenPGP digital signature