From 6f8342d2b4fd9dd0a349221af283b64e52e220c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Tue, 21 Nov 2023 02:17:25 +0200 Subject: - 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 --- NEWS | 3 +++ macros.in | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1