From 44b4ba37c33d89067146da3c1046550680bbe64d Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 30 Oct 2023 07:13:17 +0000 Subject: [PATCH] eclass/toolchain: Sync with Gentoo It's from Gentoo commit 52f4e8653f56ce713659dfe7880b5c272cc5a817. --- .../portage-stable/eclass/toolchain.eclass | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass index 8df8b506b0..bf5e512703 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass @@ -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