Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723478 - sys-devel/crossdev: building gcc fails when AR, NM & RANLIB set in /etc/portage/make.conf
Summary: sys-devel/crossdev: building gcc fails when AR, NM & RANLIB set in /etc/porta...
Status: UNCONFIRMED
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: 2020-05-17 11:07 UTC by Mike Lothian
Modified: 2021-10-27 09:13 UTC (History)
2 users (show)

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


Attachments
Stage 2 build error (ktQRx9S1.txt,53.24 KB, text/plain)
2020-05-17 11:07 UTC, Mike Lothian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2020-05-17 11:07:06 UTC
Stage 2 gcc fails with missing symbols 

I eventually figured out it was because these were set in my /etc/portage/make.conf

AR="gcc-ar"
NM="gcc-nm"
RANLIB="gcc-ranlib"

Is there a way crossdev could warn they are set, or override them to the correct values, this took a very long time to figure out what was causing the failure

Error attached

It happened with gcc-9.3.0 too

I also had issues if default-gold was set on binutils, I think gcc normally forces ld.bfd when it's built

Reproducible: Always
Comment 1 Mike Lothian 2020-05-17 11:07:37 UTC
Created attachment 639802 [details]
Stage 2 build error
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-24 10:41:06 UTC
Yeah, cross-x86_64-w64-mingw32/gcc is tricky. It's techicaly a package that is not cross-compiled, but is a cross-compiler itself. It has to distinct between AR_FOR_BOUL/AR_FOR_HOST/AR_FOR_TARGET. I think AR= makes all 3 being lumped together.

I need to explore it a bit more but it's probably 2 things:
- toolchain.eclass assumes AR= to be applied for HOST
- toolchain-funcs.eclass's tc-getAR has a nasty fallback from CTARGET to CHOST of CTARGET is not present.