Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670474 - sys-devel/gcc-7.3.0: cxx USE flag shouldn't be optional
Summary: sys-devel/gcc-7.3.0: cxx USE flag shouldn't be optional
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 10:45 UTC by Raymond Jennings
Modified: 2018-11-07 07:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Jennings 2018-11-06 10:45:23 UTC
Since GCC itself is written in C++, shouldn't C++ support be considered mandatory?

I'm curious why the cxx use flag is toggleable in the gcc package in this case.

Relatedly, should libstdc++ be part of the @system set?
Comment 1 Raymond Jennings 2018-11-06 11:59:32 UTC
Also to note that gcc itself is a system package
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2018-11-06 19:16:13 UTC
libstdc++ (virtual/libstdc++, sys-libs/libstdc++-v3 and sys-libs/libstdc++-v3-bin) in gentoo is a libstdc++v3 from gcc-3.3. It should not be in @system set as it's used only by old binary-only packages. I suggest ignoring this question in this bug.

C++ is optional for bare-metal and cross-compiler targets without need for c++ support like 'crossdev -t avr' (optional C++) or 'crossdev -t mmix' (not implemented C++).

Today C++ is not optional for non-cross-compilers:
 https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n2334

  is_cxx() {
    gcc-lang-supported 'c++' || return 1
    ! is_crosscompile && tc_version_is_at_least 4.8 && return 0
    use_if_iuse cxx
  }

Note: it always returns success for non-crosscompilers.

Did you break your system as a result of USE=-cxx? Why it's a problem in practice?
Comment 3 Raymond Jennings 2018-11-07 05:28:55 UTC
My logic is that if gcc (or for that matter any other package) is a system package that is written in C++, then C++ support in gcc is required to build it shouldn't be conditioned on a USE flag.

If this USE flag is disabled in gcc then you'd be unable to compile C++ source code, including for gcc itself, which, as a system package, would seem to be an erroneous state of affairs.

The question of libstdc++ is for the same reason.

That said I just ran a test in a fresh stage3 chroot and apparently even with USE=-cxx, it still uses C++ internally to compile itself during its own merge, so apparently, surprisingly, USE=cxx is not required to build gcc itself.

What about other packages with C++ source?