aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--macros.in3
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index d7d363b..0068a70 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- macros: make _FORTIFY_SOURCE flags configurable via %_fortify_level variable
+- macros: undefine _FORTIFY_SOURCE before defining it to avoid build warnings on some packages defining it already
+
Version 2.72 - 18 November 2023, by Jani Välimaa
- macros: define _use_weak_usergroup_deps to only add user() and group() requires as recommends
diff --git a/macros.in b/macros.in
index 094d5c0..79c5327 100644
--- a/macros.in
+++ b/macros.in
@@ -240,7 +240,8 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} -
%debugcflags %{?_enable_debug_packages:-g}
-%_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2
+%_fortify_level 2
+%_fortify_cflags %[ 0%{?_fortify_level} > 0 ? "-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=%{_fortify_level}" : "" ]
# cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments
%Werror_cflags -Wformat -Werror=format-security