Filter out LTO flags from %%extension flags macros

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1877652
This commit is contained in:
Miro Hrončok 2020-09-11 20:42:36 +02:00
parent ee8888f636
commit 0d621460ce
2 changed files with 8 additions and 2 deletions

4
macros
View File

@ -111,7 +111,9 @@
%__extension_strip_flags() %{lua:
local name = rpm.expand("%{1}")
local value = " " .. rpm.expand("%{build_" .. name .. "}")
local result = string.gsub(value, "%s+-specs=[^%s]+", " ")
local specs_pattern = "%s+-specs=[^%s]+"
local lto_flags_pattern = rpm.expand("%{?_lto_cflags}"):gsub("[%-%.]", "%%%1")
local result = value:gsub(specs_pattern, " "):gsub(lto_flags_pattern, "")
print(result)
}

View File

@ -6,7 +6,7 @@
Summary: Red Hat specific rpm configuration files
Name: redhat-rpm-config
Version: 171
Version: 172
Release: 1%{?dist}
# No version specified.
License: GPL+
@ -213,6 +213,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
%{_rpmconfigdir}/macros.d/macros.kmp
%changelog
* Fri Sep 11 2020 Miro Hrončok <mhroncok@redhat.com> - 172-1
- Filter out LTO flags from %%extension flags macros
- Fixes: rhbz#1877652
* Wed Sep 2 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 171-1
- Add Requires: lua-srpm-macros