Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 900713 - sys-devel/crossdev: arm-none-eabi builds stage3, not stage4 (no C++ compiler)
Summary: sys-devel/crossdev: arm-none-eabi builds stage3, not stage4 (no C++ compiler)
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-10 12:05 UTC by Sam James
Modified: 2024-11-30 04:46 UTC (History)
4 users (show)

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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-10 12:05:26 UTC
In crossdev, we have:
```
[...]
                # Bare metal targets
                *-newlib|*-elf|*-eabi|*-rtems*)
                        LPKG="newlib"
                        KPKG="[none]"
                        STAGE_DEFAULT=${STAGE_LIBC}
[...]
                        ;;     
```

which means we only build a C compiler (-s3) with 'crossdev arm-none-eabi'. This ended up confusing a user in #gentoo.

I'd say it's probably common for users to not want a freestanding C++ compiler, but I'm not sure if we should warn on it or what.
Comment 1 Gil Kloepfer 2024-05-01 05:13:54 UTC
I was looking at https://forums.gentoo.org/viewtopic-p-8734819.html and this is related to what that user experienced.  It looks like when crossdev was developed, it may have been assumed that USE flags were processed such that the first one takes precedence.

It's hard to tell what is actually intended behavior in some places in crossdev and what is being done for other reasons.

In the case of the forum post above, I see clearly that cross-arm-none-abi contains:

cross-arm-none-eabi/gcc cxx -openmp -fortran -hardened -default-stack-clash-protection -ssp -sanitize -vtv -selinux -boundschecking -d -gcj -gtk -libffi -mudflap -objc -objc++ -objc-gc -fortran -go -jit -cxx -mpx -openmp -sanitize -vtv multilib

In the crossdev script, line 387, cxx is added to GUSE for -eabi, and later when the use flags are combined in line 1790:

USE="${GUSE} ${USE} ${GUSE_DISABLE_STAGE_1}"

So the GUSE flags defined are overridden by GUSE_DISABLE_STAGE_1 (which contains -cxx).  I wonder if it was intended that the GUSE flags were placed after GUSE_DISABLE_STAGE_1 flags.

Not knowing for sure what the intent of these variables are, it is impossible to determine if this was what was meant here...
Comment 2 Gil Kloepfer 2024-05-01 16:05:30 UTC
(In reply to Gil Kloepfer from comment #1)
> Not knowing for sure what the intent of these variables are, it is
> impossible to determine if this was what was meant here...

Looking at this a bit more, and with a clearer head, I retract my previous comments.  I think the forum comment, while well-intentioned (and brings-up a good point) misses the purpose of the --stage4 option.  It is definitely more efficient to build the c++ compiler at the same time as the c compiler, but whether this is the right thing to do or not is probably something the crossdev team should decide.