From 3b89f9d836c1eaaf21c7e0e43daacf4cf8df0b77 Mon Sep 17 00:00:00 2001 From: Michael Petlan Date: Fri, 14 Jan 2022 16:54:02 +0100 Subject: [PATCH] Harden linking to meet annocheck requirements The %install phase resets the flags unfortunately. That wouldn't matter, however, in this case, second "building pass" clobbers the binaries that come from the first pass. If we use the flags only in %build phase, they will take no effect. Resolves: rhbz#2037125 Signed-off-by: Michael Petlan --- libtraceevent.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libtraceevent.spec b/libtraceevent.spec index 4de3c4e..a28d01a 100644 --- a/libtraceevent.spec +++ b/libtraceevent.spec @@ -5,7 +5,7 @@ Name: libtraceevent Version: 1.1.1 -Release: 7%{?dist} +Release: 8%{?dist} License: LGPLv2+ and GPLv2+ Summary: Library to parse raw trace event formats @@ -44,9 +44,14 @@ MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-style-xsl | grep manpages/docbook.xsl` %set_build_flags #looks like CFLAGS is ignored when compiling plugins, but not EXTRA_CFLAGS export EXTRA_CFLAGS="%{optflags}" +export LDFLAGS="-Wl,-z,now" %make_build prefix=%{_prefix} libdir=%{_libdir} MANPAGE_XSL=%{MANPAGE_DOCBOOK_XSL} all doc %install +%set_build_flags +#looks like CFLAGS is ignored when compiling plugins, but not EXTRA_CFLAGS +export EXTRA_CFLAGS="%{optflags}" +export LDFLAGS="-Wl,-z,now" %make_install prefix=%{_prefix} libdir=%{_libdir} install doc-install rm -rf %{buildroot}/%{_libdir}/libtraceevent.a @@ -67,6 +72,10 @@ rm -rf %{buildroot}/%{_libdir}/libtraceevent.a %{_libdir}/pkgconfig/libtraceevent.pc %changelog +* Fri Jan 14 2022 Michael Petlan - 1.1.1-8 +- Harden linking to meet annocheck requirements + Related: rhbz#2037125 + * Fri Nov 19 2021 Jerome Marchand - 1.1.1-7 - Fix rpminspect annocheck issue.