From 288bc9aff2e91f6a443e8c09f080ffc9f633b07e Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 28 Dec 2022 19:17:12 +0000 Subject: toolchain.eclass: prepare for USE=hardened => FORTIFY_SOURCE=3, assertions USE=hardened will now imply: - default -D_FORTIFY_SOURCE=3 (instead of 2 for normal profiles) - default -D_GLIBCXX_ASSERTIONS Bug: https://bugs.gentoo.org/876895 Bug: https://bugs.gentoo.org/884417 Bug: https://bugs.gentoo.org/847148 Bug: https://bugs.gentoo.org/876893 Signed-off-by: Sam James --- eclass/toolchain.eclass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 021db270828c..0dd23d93e383 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -820,6 +820,10 @@ make_gcc_hard() { # * -z now # See gcc *_all_extra-options.patch patches. gcc_hard_flags+=" -DEXTRA_OPTIONS" + # Default to -D_FORTIFY_SOURCE=3 instead of -D_FORTIFY_SOURCE=2 + gcc_hard_flags+=" -DGENTOO_FORTIFY_SOURCE_LEVEL=3" + # Add -D_GLIBCXX_ASSERTIONS + gcc_hard_flags+=" -DDEF_GENTOO_GLIBCXX_ASSERTIONS" if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux* ]] ; then gcc_hard_flags+=" -DEXTRA_OPTIONS_CF" -- cgit v1.2.3-65-gdbad