[redhat-rpm-config: 210/215] Update libtool hardening hack and re-enable (#978949)
Panu Matilainen
pmatilai at fedoraproject.org
Wed Apr 2 10:36:05 UTC 2014
commit 6c38f18be256412bfaadf5271275a0acd357c86f
Author: Kevin Fenzi <kevin at scrye.com>
Date: Mon Jan 13 12:45:57 2014 -0700
Update libtool hardening hack and re-enable (#978949)
macros | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/macros b/macros
index 20abe4e..a2f5d8a 100644
--- a/macros
+++ b/macros
@@ -29,8 +29,9 @@
#==============================================================================
# ---- configure and makeinstall.
#
+%_configure_libtool_hardening_hack 1
%_configure ./configure
-%configure(--:-:ChnqV) \
+%configure \
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
@@ -39,6 +40,10 @@
for i in $(find . -name config.guess -o -name config.sub) ; do \
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
done ; \
+ [ "%_configure_libtool_hardening_hack" = 1 ] && [ x != "x%{_hardened_ldflags}" ] && \
+ for i in $(find . -name ltmain.sh) ; do \
+ %{__sed} -i.backup -e 's~compiler_flags=$~compiler_flags="%{_hardened_ldflags}"~' $i \
+ done ; \
%{_configure} --build=%{_build} --host=%{_host} \\\
--program-prefix=%{?_program_prefix} \\\
--disable-dependency-tracking \\\
@@ -54,12 +59,7 @@
--localstatedir=%{_localstatedir} \\\
--sharedstatedir=%{_sharedstatedir} \\\
--mandir=%{_mandir} \\\
- --infodir=%{_infodir} \\\
- %{**} ; \
- [[ -f ./libtool && "x%{?%_hardened_ldflags}" != "x" ]] && \\\
- sed -i \\\
- -e 's! \\\\\\$compiler_flags !&%{?%_hardened_ldflags} !g' \\\
- ./libtool ;
+ --infodir=%{_infodir}
%makeinstall \
%{__make} \\\
@@ -179,6 +179,7 @@ package or when debugging this package.\
%__find_requires /usr/lib/rpm/redhat/find-requires
%_hardening_cflags -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
+# we don't escape symbols '~', '"', etc. so be careful when changing this
%_hardening_ldflags -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
#_hardened_build 0
More information about the scm-commits
mailing list