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



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 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.
, 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 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 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.
, 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] Re: RFC: News item regarding c++98 vs c++11

2014-10-20 Thread Rich Freeman
On Mon, Oct 20, 2014 at 9:47 AM, Martin Vaeth  wrote:
> Anthony G. Basile  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



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

2014-10-20 Thread Martin Vaeth
Anthony G. Basile  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.




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

2014-10-20 Thread Anthony G. Basile

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"
 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



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 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 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-