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

2014-10-26 Thread Anthony G. Basile

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



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

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



signature.asc
Description: OpenPGP digital signature


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

2014-10-24 Thread Anthony G. Basile

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


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

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



signature.asc
Description: OpenPGP digital signature


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

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




signature.asc
Description: OpenPGP digital signature


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

2014-10-24 Thread Anthony G. Basile

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



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

2014-10-21 Thread Martin Vaeth
Ian Stakenvicius a...@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.




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

2014-10-21 Thread Mike Gilbert
On Tue, Oct 21, 2014 at 4:45 AM, Martin Vaeth mar...@mvath.de wrote:
 Ian Stakenvicius a...@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/



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

2014-10-21 Thread Paweł Hajdan, Jr.
On 10/21/14 4:25 PM, Mike Gilbert wrote:
 On Tue, Oct 21, 2014 at 4:45 AM, Martin Vaeth mar...@mvath.de wrote:
 Ian Stakenvicius a...@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ł




signature.asc
Description: OpenPGP digital signature


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

2014-10-21 Thread Martin Vaeth
Mike Gilbert flop...@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.




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


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



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

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




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 mar...@mvath.de wrote:
 Anthony G. Basile bluen...@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



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

2014-10-19 Thread Duncan
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
 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?
 
 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