diff options
author | 2024-08-16 17:42:19 +0100 | |
---|---|---|
committer | 2024-08-16 18:21:22 +0100 | |
commit | 83344561685a21cf36b2349b94f3a579537a506d (patch) | |
tree | e4968ab70d0b4af83614bf4e330f6b1d90fc5d00 /eclass | |
parent | toolchain-funcs.eclass: _tc-has-openmp: tweak style a bit (diff) | |
download | gentoo-83344561685a21cf36b2349b94f3a579537a506d.tar.gz gentoo-83344561685a21cf36b2349b94f3a579537a506d.tar.bz2 gentoo-83344561685a21cf36b2349b94f3a579537a506d.zip |
toolchain-funcs.eclass: tc-ld-force-bfd: mangle CFLAGS, CXXFLAGS too
This is kind of related to what Ionen mentioned at https://github.com/gentoo/gentoo/pull/28355#discussion_r1033001927
but a bit different.
Makefile rules are inconsistent, as are users, and -fuse-ld= might appear
in C{,XX}FLAGS, not just LDFLAGS.
Append -fuse-ld=bfd there too if asked to force bfd. This might
cause problems with Clang because the argument is unused. See the
mess in ddba1d149e82dba88b72f992729ad4158f640e32.
Not having flag-o-matic here makes things a bit awkward. Let's try
the naive approach first because it seemed OK for me with Clang
with a quick test.
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/toolchain-funcs.eclass | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 5c15f4fb93a1..bc1fb064fc45 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -615,6 +615,8 @@ tc-ld-force-bfd() { # Set up LDFLAGS to select bfd based on the gcc / clang version. if tc-is-gcc || tc-is-clang ; then + export CFLAGS="${CFLAGS} -fuse-ld=bfd" + export CXXFLAGS="${CXXFLAGS} -fuse-ld=bfd" export LDFLAGS="${LDFLAGS} -fuse-ld=bfd" fi } |