toolchain.eclass: strip -march=native when building with Clang

-march=native doesn't work correctly in the stage2 compiler when the
stage1 compiler is Clang (see PR117952 for details). We have two options
until that is fixed:
1) strip -march=native, or
2) do 'bootstrap4' (which isn't super well-tested at the moment, see
   e.g. https://trofi.github.io/posts/301-another-gcc-profiling-bug.html)

Choose 1). Thanks to immolo for testing.

Bug: https://gcc.gnu.org/PR117952
Bug: https://bugs.gentoo.org/933772
Closes: https://bugs.gentoo.org/947752
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-02-23 05:09:00 +00:00
parent 75fac43ba3
commit dcaab8c1db
+1
View File
@@ -695,6 +695,7 @@ toolchain_src_prepare() {
# Workaround -march=native not working for stage1 with non-GCC (bug #933772).
if ! tc-is-gcc && [[ "${CFLAGS}${CXXFLAGS}" == *-march=native* ]] ; then
CLANG_DISABLE_CET_HACK=1
filter-flags '-march=native'
fi
if ! use vanilla ; then