Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171821 - sys-devel/gcc doesn't build C++ compiler when USE="build" is enabled
Summary: sys-devel/gcc doesn't build C++ compiler when USE="build" is enabled
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Release Team
Depends on:
Reported: 2007-03-22 16:58 UTC by John W Eckhart
Modified: 2007-03-23 15:26 UTC (History)
1 user (show)

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

[PATCH] Correct is_cxx to build c++ when USE="build" (toolchain-build-cxx.patch,291 bytes, patch)
2007-03-22 17:03 UTC, John W Eckhart
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John W Eckhart 2007-03-22 16:58:42 UTC
The "build" use flag is used to bootstrap the system or build a stage1 snapshot. This limits the certain packages to build only the minimum necessary to build the rest of the system. Presently, the "toolchain.eclass" will instruct the system NOT to build a C++ compiler when USE="build" is enabled because of the function is_cxx (which is used when computing the languages to build):

is_cxx() {
    gcc-lang-supported 'c++' || return 1
    use build && return 0
    ! use nocxx

However, I believe that this is an error, because elsewhere in toolchain.eclass there is logic checking that C++ IS built when bootstrapping, for example:

should_we_gcc_config() {
    # we only want to switch compilers if installing to / or /tmp/stage1root
    [[ ${ROOT} == "/" || ${ROOT} == "/tmp/stage1root" ]] || return 1

    # we always want to run gcc-config if we're bootstrapping, otherwise
    # we might get stuck with the c-only stage1 compiler
    use bootstrap && return 0
    use build && return 0

I know of at least one part of the base system that requires C++ (dev-libs/popt, which is required by rsync, will fail to configure without a C++ compiler).

Reproducible: Always

Steps to Reproduce:
This was reproduced when I was using catalyst to build a stage1. I had modified the stage1 to update the seed stage with the stage1 binaries and then export all the stage1 binaries into a separate root (required to build the stage1 using the 2006.1 seed stage, I think). I can provide a more detailed setup if required.
Actual Results:  
GCC builds without C++ support

Expected Results:  
GCC should be built with C,C++ support for bootstrapping/stage1
Comment 1 John W Eckhart 2007-03-22 17:03:39 UTC
Created attachment 114068 [details, diff]
[PATCH] Correct is_cxx to build c++ when USE="build"
Comment 2 SpanKY gentoo-dev 2007-03-22 22:41:30 UTC
Comment on attachment 114068 [details, diff]
[PATCH] Correct is_cxx to build c++ when USE="build"

no, either it's "use build && return 1" or it's nothing ... you cant have USE=build force ignore USE=nocxx
Comment 3 SpanKY gentoo-dev 2007-03-22 22:44:52 UTC
let the release team figure out if they want to change the behavior

it's always been:
stage1: C only (USE=build)
stage2: C/C++ (USE=bootstrap)

in other words, the current code is correct by design ... you've interpreted the should_we_gcc_config logic incorrectly
Comment 4 John W Eckhart 2007-03-23 03:12:41 UTC
The reason I encountered this bug was that rsync requires popt, which requires c++. Should I open a new bug against the release team to resolve the C++ dependency?
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2007-03-23 14:55:02 UTC
I could barely follow what you said that you've done, but building stages from a 2006.1 seed stage3 requires no modifications to said seed stage.

Release Engineering does *not* want the meaning of USE=build to change *at all* and see no "bug" here.  If your stages didn't build, it is likel ybecause of an error that you have made, seeing as how I've had 9 architectures build stages for 2007.0 just fine using the latest versions of catalyst and the default settings.
Comment 6 John W Eckhart 2007-03-23 15:26:50 UTC
I'll move this to the mailing list for now, I must have missed something important.