Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 27 Nov 2021 19:47:39
Message-Id: 1638042388.98e481cd2d539c32a7a094d0e5ca6de36f9a0639.sam@gentoo
1 commit: 98e481cd2d539c32a7a094d0e5ca6de36f9a0639
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 27 19:41:34 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 27 19:46:28 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98e481cd
7
8 toolchain.eclass: enable CET by default on hardened for >= gcc 11.2.1
9
10 11.2.1 will include a patch to enable CET by default if:
11 - USE=cet is enabled, and
12 - USE=hardened is enabled, and
13 - building for x86_64.
14
15 See: https://github.com/gentoo/gentoo/pull/21588
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 eclass/toolchain.eclass | 5 +++++
19 1 file changed, 5 insertions(+)
20
21 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
22 index d80873fcd2e7..f2f16b7f804e 100644
23 --- a/eclass/toolchain.eclass
24 +++ b/eclass/toolchain.eclass
25 @@ -626,6 +626,11 @@ make_gcc_hard() {
26 # -z now
27 # see *_all_extra-options.patch gcc patches.
28 gcc_hard_flags+=" -DEXTRA_OPTIONS"
29 +
30 + if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux* ]] ; then
31 + gcc_hard_flags+=" -DEXTRA_OPTIONS_CF"
32 + fi
33 +
34 # rebrand to make bug reports easier
35 BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
36 fi