public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: global USE c++11
@ 2017-01-02 21:34 Justin <jlec>
  2017-01-02 23:16 ` Anthony G. Basile
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Justin <jlec> @ 2017-01-02 21:34 UTC (permalink / raw
  To: Gentoo Dev


[-- Attachment #1.1: Type: text/plain, Size: 698 bytes --]

Hi all

How about making USE="c++11" a global USE?

Description: Build using the C++11 standard.

Current situation:
    sci-libs/dealii: Compile the library with -std=c++11
    sci-physics/herwig++: Build Herwig++ using the C++11 standard.
    sci-astronomy/casacore: Build casacore using the C++11 standard
    sci-libs/ceres-solver: Build ceres-solver using the C++11 standard
    sci-physics/herwig++: Build Herwig++ using the C++11 standard.
    sci-physics/root: Build ROOT using the C++11 standard
    sci-physics/thepeg: Build ThePEG using the C++11 standard.
    sci-physics/yoda: Build using the C++11 standard


Seems to be very consistent in usage.

Best,
Justin


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

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

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-02 21:34 [gentoo-dev] RFC: global USE c++11 Justin <jlec>
@ 2017-01-02 23:16 ` Anthony G. Basile
  2017-01-02 23:40   ` Vadim A. Misbakh-Soloviov
  2017-01-03  8:51 ` Kristian Fiskerstrand
  2017-01-04  8:55 ` Michał Górny
  2 siblings, 1 reply; 8+ messages in thread
From: Anthony G. Basile @ 2017-01-02 23:16 UTC (permalink / raw
  To: gentoo-dev

On 1/2/17 4:34 PM, Justin <jlec> wrote:
> Hi all
> 
> How about making USE="c++11" a global USE?
> 
> Description: Build using the C++11 standard.
> 
> Current situation:
>     sci-libs/dealii: Compile the library with -std=c++11
>     sci-physics/herwig++: Build Herwig++ using the C++11 standard.
>     sci-astronomy/casacore: Build casacore using the C++11 standard
>     sci-libs/ceres-solver: Build ceres-solver using the C++11 standard
>     sci-physics/herwig++: Build Herwig++ using the C++11 standard.
>     sci-physics/root: Build ROOT using the C++11 standard
>     sci-physics/thepeg: Build ThePEG using the C++11 standard.
>     sci-physics/yoda: Build using the C++11 standard
> 
> 
> Seems to be very consistent in usage.
> 
> Best,
> Justin
> 

You really shouldn't start mixing different c++ abis, that's just asking
for trouble.  Since I'm not sure why the flag is there in those pkgs, I
feel uneasy about making it a global flag.  See

https://blogs.gentoo.org/blueness/2015/03/10/the-c11-abi-incompatibility-problem-in-gentoo/

-- 
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] 8+ messages in thread

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-02 23:16 ` Anthony G. Basile
@ 2017-01-02 23:40   ` Vadim A. Misbakh-Soloviov
  2017-01-03  8:00     ` Andrew Savchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2017-01-02 23:40 UTC (permalink / raw
  To: gentoo-dev

I bet it is not about ABIs, but about a vallue for '-std' flag for gcc/clang 
compiler. Some packages allows to select between -std=c++1{1,4,7} (and some - 
defaults with older ones otherwise).



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

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-02 23:40   ` Vadim A. Misbakh-Soloviov
@ 2017-01-03  8:00     ` Andrew Savchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Savchenko @ 2017-01-03  8:00 UTC (permalink / raw
  To: gentoo-dev

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

On Tue, 03 Jan 2017 06:40:44 +0700 Vadim A. Misbakh-Soloviov wrote:
> I bet it is not about ABIs, but about a vallue for '-std' flag for gcc/clang 
> compiler. Some packages allows to select between -std=c++1{1,4,7} (and some - 
> defaults with older ones otherwise).

Yes, -std and some package-related defines. Basically this flag
controls what features of the language package should be allowed to
use.

So +1 for a global USE.


Best regards,
Andrew Savchenko

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

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

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-02 21:34 [gentoo-dev] RFC: global USE c++11 Justin <jlec>
  2017-01-02 23:16 ` Anthony G. Basile
@ 2017-01-03  8:51 ` Kristian Fiskerstrand
  2017-01-03  9:08   ` Justin <jlec>
  2017-01-04  8:55 ` Michał Górny
  2 siblings, 1 reply; 8+ messages in thread
From: Kristian Fiskerstrand @ 2017-01-03  8:51 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 820 bytes --]

On 01/02/2017 10:34 PM, Justin <jlec> wrote:
> 
> Seems to be very consistent in usage.

But I'm not convinced it is a correct approach to have use flag changing
this. First thing that springs to mind is if introducing something like
that it should be done consistently across Gentoo, so a GLEP. But
presumably a lot of packages are already built using C++11 without a use
flag given Qt5.7 requiring it etc.

If using C++11 enables different features the feature should be the use
flag rather than C++11. Couldn't this just be determined using Autotools
etc? What is the gain of the use flag? Immediately it sounds like it
adds complexity without much gain.

-- 
Kristian Fiskerstrand
OpenPGP keyblock reachable at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3


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

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

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-03  8:51 ` Kristian Fiskerstrand
@ 2017-01-03  9:08   ` Justin <jlec>
  2017-01-03 14:36     ` Anthony G. Basile
  0 siblings, 1 reply; 8+ messages in thread
From: Justin <jlec> @ 2017-01-03  9:08 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1024 bytes --]

On 03/01/2017 08:51, Kristian Fiskerstrand wrote:
> On 01/02/2017 10:34 PM, Justin <jlec> wrote:
>>
>> Seems to be very consistent in usage.
> 
> But I'm not convinced it is a correct approach to have use flag changing
> this. First thing that springs to mind is if introducing something like
> that it should be done consistently across Gentoo, so a GLEP. But
> presumably a lot of packages are already built using C++11 without a use
> flag given Qt5.7 requiring it etc.
> 
> If using C++11 enables different features the feature should be the use
> flag rather than C++11. Couldn't this just be determined using Autotools
> etc? What is the gain of the use flag? Immediately it sounds like it
> adds complexity without much gain.
> 

I tried to find some example usages from upstream. Two things I found

* Most upstreams dropped the flag in recent versions
* If present, it is used to append -std=c++11

Probably we should keep it local and wait until it is gone everywhere
upstream.

Justin


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

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

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-03  9:08   ` Justin <jlec>
@ 2017-01-03 14:36     ` Anthony G. Basile
  0 siblings, 0 replies; 8+ messages in thread
From: Anthony G. Basile @ 2017-01-03 14:36 UTC (permalink / raw
  To: gentoo-dev

On 1/3/17 4:08 AM, Justin <jlec> wrote:
> On 03/01/2017 08:51, Kristian Fiskerstrand wrote:
>> On 01/02/2017 10:34 PM, Justin <jlec> wrote:
>>>
>>> Seems to be very consistent in usage.
>>
>> But I'm not convinced it is a correct approach to have use flag changing
>> this. First thing that springs to mind is if introducing something like
>> that it should be done consistently across Gentoo, so a GLEP. But
>> presumably a lot of packages are already built using C++11 without a use
>> flag given Qt5.7 requiring it etc.
>>
>> If using C++11 enables different features the feature should be the use
>> flag rather than C++11. Couldn't this just be determined using Autotools
>> etc? What is the gain of the use flag? Immediately it sounds like it
>> adds complexity without much gain.
>>
> 
> I tried to find some example usages from upstream. Two things I found
> 
> * Most upstreams dropped the flag in recent versions
> * If present, it is used to append -std=c++11
> 
> Probably we should keep it local and wait until it is gone everywhere
> upstream.
> 
> Justin
> 

Agreed.  Keep it local.

-- 
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] 8+ messages in thread

* Re: [gentoo-dev] RFC: global USE c++11
  2017-01-02 21:34 [gentoo-dev] RFC: global USE c++11 Justin <jlec>
  2017-01-02 23:16 ` Anthony G. Basile
  2017-01-03  8:51 ` Kristian Fiskerstrand
@ 2017-01-04  8:55 ` Michał Górny
  2 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-01-04  8:55 UTC (permalink / raw
  To: Justin <jlec>; +Cc: gentoo-dev

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

On Mon, 2 Jan 2017 21:34:03 +0000
"Justin <jlec>" <jlec@gentoo.org> wrote:

> Hi all
> 
> How about making USE="c++11" a global USE?
> 
> Description: Build using the C++11 standard.
> 
> [...]
> 
> Seems to be very consistent in usage.

...and yet a very bad idea.

As blueness pointed out, there's a major ABI incompatibility problem
going on here. For gcc < 5, packages built with -std=c++11 were
frequently ABI-incompatible with those built with -std=c++98. In gcc-5
the ABI compatibility was improved but then packages built with gcc-5
are incompatible with those built with earlier gcc versions ;-).

So the flag really makes sense only for gcc < 5 world where it could be
used to solve the ABI incompatibility problem by enforcing consistent
standard throughout dependency chains. Which means adding the flag to
pretty much every C++ library that exposes stdlib types in ABI, and all
their reverse dependencies using those ABIs including appropriate USE
dependencies.

This is a lot of work with potential confusion of users included for
a temporary benefit. It's usually better to just bump the C++ standard
consistently throughout the dependency chain and use subslots to force
rebuilds. This avoids the necessity of explicit action on user part,
and adding flags that will eventually be removed in the future.

Plus, it may save us from some of the usual 'why did you remove
support for this nice old C++ standard from this package?! Upstream
still supports it! I don't like new standards, the old one worked
fine for me and now the crappy program I wrote breaks!' bikeshed.

Also note that in order to solve the problem properly we'd really use
flags to control/expose ABI rather than the C++ standard alone.
Something like one-of [ gcc4-c++98 gcc4-c++11 gcc5 [gcc6?] libcxx-1 ].
However, that's a lot of work, and really will just move the burden
from developers to users having to play with ABIs post gcc upgrades
(well, maybe gcc-config could handle that by default...).

In any case, nobody really volunteered to do the work on that or even
perform the complete research.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

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

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

end of thread, other threads:[~2017-01-04  8:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-02 21:34 [gentoo-dev] RFC: global USE c++11 Justin <jlec>
2017-01-02 23:16 ` Anthony G. Basile
2017-01-02 23:40   ` Vadim A. Misbakh-Soloviov
2017-01-03  8:00     ` Andrew Savchenko
2017-01-03  8:51 ` Kristian Fiskerstrand
2017-01-03  9:08   ` Justin <jlec>
2017-01-03 14:36     ` Anthony G. Basile
2017-01-04  8:55 ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox