commit: 83344561685a21cf36b2349b94f3a579537a506d Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Aug 16 16:42:19 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Aug 16 17:21:22 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83344561
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 <AT> gentoo.org> eclass/toolchain-funcs.eclass | 2 ++ 1 file changed, 2 insertions(+) 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 }
