summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2024-03-17 10:17:28 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-03-17 10:18:17 +0100
commit394aed402f624e26ad0e422fd9ddcaeac8ec3772 (patch)
tree690b6892e948115dce36c3c8a6869c2db2c457d3 /eclass
parentgui-apps/wf-shell: inherit xdg eclass to update icon cache (diff)
downloadgentoo-394aed402f624e26ad0e422fd9ddcaeac8ec3772.tar.gz
gentoo-394aed402f624e26ad0e422fd9ddcaeac8ec3772.tar.bz2
gentoo-394aed402f624e26ad0e422fd9ddcaeac8ec3772.zip
toolchain.eclass: Make CET auto-apply x86-64 flags also outside hardened
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2acfad8162ac..59d51d9c1e38 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -677,6 +677,11 @@ tc_enable_hardened_gcc() {
hardened_gcc_flags+=" -DDEF_GENTOO_ZNOW"
fi
+ if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux-gnu* ]] ; then
+ einfo "Updating gcc to use x86-64 control flow protection by default ..."
+ hardened_gcc_flags+=" -DEXTRA_OPTIONS_CF"
+ fi
+
if _tc_use_if_iuse hardened ; then
# Will add some hardened options as default, e.g. for gcc-12
# * -fstack-clash-protection
@@ -688,10 +693,6 @@ tc_enable_hardened_gcc() {
# Add -D_GLIBCXX_ASSERTIONS
hardened_gcc_flags+=" -DDEF_GENTOO_GLIBCXX_ASSERTIONS"
- if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux* ]] ; then
- hardened_gcc_flags+=" -DEXTRA_OPTIONS_CF"
- fi
-
# Rebrand to make bug reports easier
BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
fi