From dcaab8c1db8a33cfc110c1aecfef799b26be65ae Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 23 Feb 2025 03:57:57 +0000 Subject: [PATCH] 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 --- eclass/toolchain.eclass | 1 + 1 file changed, 1 insertion(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 458105d7a56ca..693a356d54a82 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -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