public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] C++ standard in ebuilds
@ 2018-09-17 15:37 Guilherme Amadio
  2018-09-17 16:40 ` Vadim A. Misbakh-Soloviov
  2018-09-17 17:24 ` Matt Turner
  0 siblings, 2 replies; 8+ messages in thread
From: Guilherme Amadio @ 2018-09-17 15:37 UTC (permalink / raw
  To: gentoo-dev

Hi everyone,

I would like to discuss a system-wide way to handle C++ standard setting
in Gentoo. We currently have many packages appending -std=c++XX to their
flags, and it's hard to keep track of which packages use which version
of the standard. This is a problem when packages force dependencies to
use the same version of the standard, or if certain combinations cause
ABI or other breakage (i.e., due to backports conflicting with standard
classes). We currently have the page below with some documentation, but
I have not found much else on the topic:
https://wiki.gentoo.org/wiki/Project:C%2B%2B/Maintaining_ABI

One problem is that depending on the compiler version, the right option
may change (e.g. -std=c++1y vs -std=c++14 and -std=c++1z vs -std=c++17).
This isn't a big problem when using recent compilers, but may be it will
if you want to test some package you develop with an older compiler you
still need to support (out of Gentoo), or if you use ICC, which lags a
bit behind in standards support. For CMake projects, we could set
CMAKE_CXX_STANDARD in cmake-utils.eclass. For other projects we could
use other means. In any case, it might make sense to have global USE
flags like c++11 (already a local USE flag), c++14, etc, along with a
small eclass that C++ projects can inherit to get the right setting
instead of using append-cxxflags with a hard-coded standard version.
Hard-coding the standard flag may create problems because we will have a
mix of the default and the hard-coded ones. The USE flags would also
allow depending on a package with the same standard configuration or
setting the standard globally to something different than the compiler
default (i.e. either stay with C++11 because that's what you need to
work with, or use C++17 since you are on ~arch and your system compiler
supports it, etc).

What are your thoughts on the matter? This has been discussed in the
past¹, but it doesn't seem we have a global solution yet. I think
another discussion happened more recently, but I didn't find the thread.

Cheers,
—Guilherme

1. https://archives.gentoo.org/gentoo-dev/message/eab0dc92cb8adb1457ff368c5a033eaf


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

end of thread, other threads:[~2018-09-21  7:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-17 15:37 [gentoo-dev] [RFC] C++ standard in ebuilds Guilherme Amadio
2018-09-17 16:40 ` Vadim A. Misbakh-Soloviov
2018-09-18 12:46   ` Richard Yao
2018-09-18 14:26     ` Guilherme Amadio
2018-09-17 17:24 ` Matt Turner
2018-09-17 18:38   ` Georg Rudoy
2018-09-18 14:31   ` Guilherme Amadio
2018-09-21  7:17     ` Dennis Schridde

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