Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 659766 - sys-devel/crossdev:Users must have some control over CFLAGSs of static libraries of the toolchain.
Summary: sys-devel/crossdev:Users must have some control over CFLAGSs of static librar...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-01 17:23 UTC by dE
Modified: 2020-09-20 12:58 UTC (History)
3 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 dE 2018-07-01 17:23:56 UTC
The toolchain copies static libraries from the host system's crossdev toolchain. For e.g. it uses against libstdc++.a.

Since objects from these archives are a part of the host system, users must have control over the CFLAGS/CXXFLAGS of these static libraries or they must be copied from the guest system instead from the crossdev's toolchain.
Comment 1 Sergei Trofimovich gentoo-dev 2018-07-09 19:36:25 UTC
(In reply to dE from comment #0)
> The toolchain copies static libraries from the host system's crossdev
> toolchain. For e.g. it uses against libstdc++.a.

> Since objects from these archives are a part of the host system, users must
> have control over the CFLAGS/CXXFLAGS of these static libraries or they must
> be copied from the guest system instead from the crossdev's toolchain.

I agree Gentoo needs to improve here by handling CFLAGS_${CTARGET} or similar.

One clarification: gcc does not copy c++ libraries into target. Those are installed on host only:

$ ia64-unknown-linux-gnu-gcc --print-file-name=libstdc++.a
/usr/lib/gcc/ia64-unknown-linux-gnu/8.1.0/libstdc++.a

Note path does not point to /usr/${CTARGET} (and should not as long as $SYSROOT has no this file either).

Today you can cross-buld g++ with cross-emerge into target to control flags. Unfortunately cross-gcc will not automatically use libstdc++.a files from $SYSROOT. I'll try to check why.
Comment 2 Sergei Trofimovich gentoo-dev 2020-06-14 13:17:11 UTC
Internally gcc calls these variable CFLAGS_FOR_TARGET.
Comment 3 dE 2020-09-20 12:58:21 UTC
(In reply to Sergei Trofimovich from comment #2)
> Internally gcc calls these variable CFLAGS_FOR_TARGET.

Is this an env variable? Will settings this make a difference?