From 1b98c066424131ffb9a421a6e77ee5c2f9ca8164 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 16 Jan 2023 11:04:09 -0500 Subject: [PATCH] Consolidate the _FORTIFY_SOURCE switches The double undefine was unnecessary and exposed a bug in ccache. Club the undefine and define into a single -Wp instead, which works for all redefinitions of _FORTIFY_SOURCE. --- macros | 5 ++++- redhat-rpm-config.spec | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/macros b/macros index 6740c43..d2a4508 100644 --- a/macros +++ b/macros @@ -369,8 +369,11 @@ print(result) # Default fortification level. # "%define _fortify_level 2" to downgrade and # "%define _fortify_level 0" or "%undefine _fortify_level" to disable +# +# We use a single -Wp here to enforce order so that ccache does not ever +# reorder them. %_fortify_level 3 -%_fortify_level_flags %[ 0%{?_fortify_level} > 0 ? "-U_FORTIFY_SOURCE -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=%{_fortify_level}" : "" ] +%_fortify_level_flags %[ 0%{?_fortify_level} > 0 ? "-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=%{_fortify_level}" : "" ] # Some linkers default to a build-id algoritim that is not supported by rpmbuild, # so we need to specify the right algorithm to use. diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index a24e1e4..2cb04db 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 242 +%global baserelease 243 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -221,6 +221,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %doc buildflags.md %changelog +* Mon Jan 16 2023 Siddhesh Poyarekar - 243-1 +- Consolidate the _FORTIFY_SOURCE switches. + * Fri Jan 13 2023 Miro HronĨok - 242-1 - Don't use %%[ ] expressions with %%{undefined} - Fixes: rhbz#2160716