1 |
commit: 718448f923ae9302df1290f46ffea4d9198edd73 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 28 23:57:10 2022 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 29 00:00:08 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=718448f9 |
7 |
|
8 |
toolchain.eclass: Split -z now and -fstack-clash-protection out for gcc13 |
9 |
|
10 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
11 |
|
12 |
eclass/toolchain.eclass | 14 +++++++++++++- |
13 |
1 file changed, 13 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
16 |
index 2bed15110ece..f5230821cfde 100644 |
17 |
--- a/eclass/toolchain.eclass |
18 |
+++ b/eclass/toolchain.eclass |
19 |
@@ -277,6 +277,8 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then |
20 |
tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd ) |
21 |
tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=( valgrind ) |
22 |
tc_version_is_at_least 11 && IUSE+=" custom-cflags" |
23 |
+ tc_version_is_at_least 12.99 && IUSE+=" default-znow" |
24 |
+ tc_version_is_at_least 12.99 && IUSE+=" default-stack-clash-protection" |
25 |
fi |
26 |
|
27 |
if tc_version_is_at_least 10; then |
28 |
@@ -798,8 +800,18 @@ make_gcc_hard() { |
29 |
if _tc_use_if_iuse ssp ; then |
30 |
einfo "Updating gcc to use automatic SSP building ..." |
31 |
fi |
32 |
+ if _tc_use_if_iuse default-stack-clash-protection ; then |
33 |
+ # The define DEF_GENTOO_SCP is checked in 24_all_DEF_GENTOO_SCP-fstack-clash-protection.patch |
34 |
+ einfo "Updating gcc to use automatic stack clash protection ..." |
35 |
+ gcc_hard_flags+=" -DDEF_GENTOO_SCP" |
36 |
+ fi |
37 |
+ if _tc_use_if_iuse default-znow ; then |
38 |
+ # The define DEF_GENTOO_NZOW is checked in 23_all_DEF_GENTOO_ZNOW-z-now.patch |
39 |
+ einfo "Updating gcc to request symbol resolution at start (-z now) ..." |
40 |
+ gcc_hard_flags+=" -DDEF_GENTOO_ZNOW" |
41 |
+ fi |
42 |
if _tc_use_if_iuse hardened ; then |
43 |
- # Will add some hardened options as default, like: |
44 |
+ # Will add some hardened options as default, e.g. for gcc-12 |
45 |
# * -fstack-clash-protection |
46 |
# * -z now |
47 |
# See gcc *_all_extra-options.patch patches. |