diff options
author | 2024-12-07 23:21:14 +0000 | |
---|---|---|
committer | 2024-12-07 23:21:14 +0000 | |
commit | ec6ccd63bb77770eeeb8eb220d66efafc91ac572 (patch) | |
tree | 408635c4a1474049d1de779c4c74ce127ac89209 /eclass | |
parent | dev-db/pg-gvm: add 22.6.6 (diff) | |
download | gentoo-ec6ccd63bb77770eeeb8eb220d66efafc91ac572.tar.gz gentoo-ec6ccd63bb77770eeeb8eb220d66efafc91ac572.tar.bz2 gentoo-ec6ccd63bb77770eeeb8eb220d66efafc91ac572.zip |
toolchain.eclass: pass -fcf-protection=none for stage1 builds with Clang
GCC's host_detect_local_cpu returns NULL when built with Clang (see bug
for details) so pass -fcf-protection=none for stage1 (where it doesn't
really matter anyway) to avoid a failure when -march=native ends up
resolving to nothing (b/c NULL) and then erroring out as CET isn't supported
for the baseline -m32 CPU.
Bug: https://gcc.gnu.org/PR117952
Closes: https://bugs.gentoo.org/933772
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/toolchain.eclass | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index be8bfcddfafd..565a2f359488 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -2261,6 +2261,13 @@ gcc_do_make() { STAGE1_CXXFLAGS="-O2" fi + # Workaround -march=native not working for stage1 with + # non-GCC (bug #933772). + if ! tc-is-gcc ; then + STAGE1_CFLAGS+=" $(test-flags-CC -fcf-protection=none)" + STAGE1_CXXFLAGS+=" $(test-flags-CXX -fcf-protection=none)" + fi + # We only want to use the system's CFLAGS if not building a # cross-compiler. STAGE1_CFLAGS=${STAGE1_CFLAGS-"$(get_abi_CFLAGS ${TARGET_DEFAULT_ABI}) ${CFLAGS}"} |