fix linking to use hardening flags (#1547522)

This commit is contained in:
Miroslav Lichvar 2018-02-21 18:00:45 +01:00
parent c8674422ce
commit e24787ebee

View File

@ -71,8 +71,8 @@ export CFLAGS="$RPM_OPT_FLAGS -Wno-format-contains-nul"
%configure
# Fix Libtool to remove rpaths.
rm -f ./libtool
cp %{_bindir}/libtool .
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# Omit unused direct shared library dependencies.
sed --in-place --expression 's! -shared ! -Wl,--as-needed\0!g' ./libtool