Don't use %[ ] expressions with %{undefined rhel}, it breaks macro opt evaluation

Fixes https://bugzilla.redhat.com/2160716
This commit is contained in:
Miro Hrončok 2023-01-13 14:37:12 +01:00
parent 771fcecf48
commit 6ef1a40e16
2 changed files with 9 additions and 5 deletions

8
macros
View File

@ -338,10 +338,10 @@ print(result)
# https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer
# Use "%undefine _include_frame_pointers" to disable.
%_include_frame_pointers %{undefined rhel}
%_frame_pointers_cflags %[ 0%{?_include_frame_pointers} ? "-fno-omit-frame-pointer" : "" ]
%_frame_pointers_cflags_x86_64 %[ 0%{?_include_frame_pointers} ? "-mno-omit-leaf-frame-pointer" : "" ]
%_frame_pointers_cflags_aarch64 %[ 0%{?_include_frame_pointers} ? "-mno-omit-leaf-frame-pointer" : "" ]
%_frame_pointers_cflags_s390x %[ 0%{?_include_frame_pointers} ? "-mbackchain" : "" ]
%_frame_pointers_cflags %{expr:0%{?_include_frame_pointers} ? "-fno-omit-frame-pointer" : ""}
%_frame_pointers_cflags_x86_64 %{expr:0%{?_include_frame_pointers} ? "-mno-omit-leaf-frame-pointer" : ""}
%_frame_pointers_cflags_aarch64 %{expr:0%{?_include_frame_pointers} ? "-mno-omit-leaf-frame-pointer" : ""}
%_frame_pointers_cflags_s390x %{expr:0%{?_include_frame_pointers} ? "-mbackchain" : ""}
# Fail linking if there are undefined symbols. Required for proper
# ELF symbol versioning support. Disabled by default.

View File

@ -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 241
%global baserelease 242
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
@ -221,6 +221,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%doc buildflags.md
%changelog
* Fri Jan 13 2023 Miro Hrončok <mhroncok@redhat.com> - 242-1
- Don't use %%[ ] expressions with %%{undefined}
- Fixes: rhbz#2160716
* Thu Jan 12 2023 Stephen Gallagher <sgallagh@redhat.com> - 241-1
- Do not include frame pointers on RHEL