aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2023-11-21 02:17:25 +0200
committerJani Välimaa <wally@mageia.org>2023-11-21 02:17:25 +0200
commit6f8342d2b4fd9dd0a349221af283b64e52e220c5 (patch)
tree78fd4d8b2cfa587b2657bff83d869999fd27c541
parent2e4a0ce8ef7fb61b896835752e6da3d49a97a48a (diff)
downloadrpm-setup-6f8342d2b4fd9dd0a349221af283b64e52e220c5.tar
rpm-setup-6f8342d2b4fd9dd0a349221af283b64e52e220c5.tar.gz
rpm-setup-6f8342d2b4fd9dd0a349221af283b64e52e220c5.tar.bz2
rpm-setup-6f8342d2b4fd9dd0a349221af283b64e52e220c5.tar.xz
rpm-setup-6f8342d2b4fd9dd0a349221af283b64e52e220c5.zip
- macros: make _FORTIFY_SOURCE flags configurable via %_fortify_level variable
and undefine _FORTIFY_SOURCE before defining it to avoid build warnings on some packages defining it already
-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