From 98e481cd2d539c32a7a094d0e5ca6de36f9a0639 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 27 Nov 2021 19:41:34 +0000 Subject: toolchain.eclass: enable CET by default on hardened for >= gcc 11.2.1 11.2.1 will include a patch to enable CET by default if: - USE=cet is enabled, and - USE=hardened is enabled, and - building for x86_64. See: https://github.com/gentoo/gentoo/pull/21588 Signed-off-by: Sam James --- eclass/toolchain.eclass | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eclass/toolchain.eclass') diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index d80873fcd2e7..f2f16b7f804e 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -626,6 +626,11 @@ make_gcc_hard() { # -z now # see *_all_extra-options.patch gcc patches. gcc_hard_flags+=" -DEXTRA_OPTIONS" + + if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux* ]] ; then + gcc_hard_flags+=" -DEXTRA_OPTIONS_CF" + fi + # rebrand to make bug reports easier BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} fi -- cgit v1.2.3-65-gdbad