Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 659766 - sys-devel/crossdev: provide control over CFLAGSs of toolchain target libraries
Summary: sys-devel/crossdev: provide control over CFLAGSs of toolchain target libraries
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:
: 659752 (view as bug list)
Depends on: 461874
Blocks:
  Show dependency tree
 
Reported: 2018-07-01 17:23 UTC by dE
Modified: 2021-11-06 04:41 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 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 (RETIRED) 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 (RETIRED) 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?
Comment 4 dE 2021-07-21 04:00:51 UTC
*** Bug 659752 has been marked as a duplicate of this bug. ***