commit: bc7f9e5b77e202ba568eaaf0f6a5638e5c0f6f23
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 17 03:21:13 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 18 01:30:46 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc7f9e5b
flag-o-matic.eclass: handle C++ assertions and FORTIFY_SOURCE in
_filter-hardened
Signed-off-by: Sam James <sam <AT> gentoo.org>
eclass/flag-o-matic.eclass | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 70d39d034388..b4c27bf89d92 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -181,6 +181,16 @@ _filter-hardened() {
is-flagq -fstrict-overflow || append-flags
$(test-flags -fstrict-overflow)
;;
+
-D_GLIBCXX_ASSERTIONS|-D_LIBCPP_ENABLE_ASSERTIONS|-D_LIBCPP_ENABLE_HARDENED_MODE)
+ tc-enables-cxx-assertions || continue
+
+ append-cppflags -U_GLIBCXX_ASSERTIONS
-U_LIBCPP_ENABLE_ASSERTIONS -U_LIBCPP_ENABLE_HARDENED_MODE
+ ;;
+ -D_FORTIFY_SOURCE=*)
+ tc-enables-fortify-source || continue
+
+ append-cppflags -U_FORTIFY_SOURCE
+ ;;
esac
done
}