From: Guilherme Amadio <amadio@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [RFC] C++ standard in ebuilds
Date: Mon, 17 Sep 2018 17:37:40 +0200 [thread overview]
Message-ID: <20180917153738.GA5402@gentoo.org> (raw)
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
next reply other threads:[~2018-09-17 15:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 15:37 Guilherme Amadio [this message]
2018-09-17 16:40 ` [gentoo-dev] [RFC] C++ standard in ebuilds 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180917153738.GA5402@gentoo.org \
--to=amadio@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox