eclass/toolchain: Sync with Gentoo

It's from Gentoo commit 52f4e8653f56ce713659dfe7880b5c272cc5a817.
This commit is contained in:
Flatcar Buildbot 2023-10-30 07:13:17 +00:00 committed by Krzesimir Nowak
parent 46bbed9282
commit 44b4ba37c3

View File

@ -1535,6 +1535,18 @@ gcc_do_filter_flags() {
fi
fi
if ver_test -lt 13.6 ; then
# These aren't supported by the just-built compiler either.
filter-flags -fharden-compares -fharden-conditional-branches \
-fharden-control-flow-redundancy -fno-harden-control-flow-redundancy \
-fhardcfr-skip-leaf -fhardcfr-check-exceptions \
-fhardcfr-check-returning-calls '-fhardcfr-check-noreturn-calls=*'
else
# Makes things painfully slow and no real benefit for the compiler.
append-flags $(test-flags-CC -fno-harden-control-flow-redundancy)
fi
# Please use USE=lto instead (bug #906007).
filter-lto