From 51e3232865706bdc134ff343bc5fde3b1f0601f8 Mon Sep 17 00:00:00 2001 From: nicholastao Date: Wed, 13 Sep 2023 16:17:33 +0800 Subject: [PATCH] use _find_debuginfo_opts -strip_a to reduce build time --- gmp.spec | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/gmp.spec b/gmp.spec index 55f0839..5779c64 100644 --- a/gmp.spec +++ b/gmp.spec @@ -1,4 +1,5 @@ %global ENABLE_RLOC 1 +%define _find_debuginfo_opts -strip_a Name: gmp Version: 6.3.0 @@ -59,28 +60,21 @@ fi export CXXFLAGS=$(echo %{optflags} | sed -e "s/-mtune=[^ ]*//g" | sed -e "s/-march=[^ ]*/-march=i686/g") %endif +CONFIGURE_OPTS=( + --enable-cxx %if %{?ENABLE_RLOC} -mkdir rloc && \ - (cd rloc && ln -s ../configure || exit 1 -%configure --enable-cxx LDFLAGS=-Wl,--emit-relocs -sed -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ - -e 's|-lstdc++ -lm|-lstdc++|' \ - -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ - -i libtool -export LD_LIBRARY_PATH=`pwd`/.libs -%make_build -objreloc $(readlink -f .libs/libgmp.so) -) +LDFLAGS=-Wl,--emit-relocs %endif +) -%configure --enable-cxx - +%configure "${CONFIGURE_OPTS[@]}" sed -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ -e 's|-lstdc++ -lm|-lstdc++|' \ -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -i libtool export LD_LIBRARY_PATH=`pwd`/.libs %make_build +objreloc $(readlink -f .libs/libgmp.so) %install export LD_LIBRARY_PATH=`pwd`/.libs @@ -93,7 +87,8 @@ ln -sf libgmpxx.so.4 $RPM_BUILD_ROOT%{_libdir}/libgmpxx.so %if %{?ENABLE_RLOC} mkdir -p ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} -install -pD $RPM_BUILD_DIR/%{name}-%{version}/rloc/.libs/*.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +objreloc $(readlink -f $RPM_BUILD_ROOT%{_libdir}/libgmp.so) +mv $RPM_BUILD_ROOT%{_libdir}/*.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} %endif basearch=%{_arch} @@ -131,6 +126,9 @@ export LD_LIBRARY_PATH=`pwd`/.libs %endif %changelog +* Wed Sep 13 2023 taoyuxiang 1:6.3.0-3 +- use _find_debuginfo_opts -strip_a to reduce build time + * Tue Sep 12 2023 taoyuxiang 1:6.3.0-3 - add sub rpm coreutils-relocation -- Gitee