From f22366b3b03f06c67ab926de852569af3e87560b Mon Sep 17 00:00:00 2001 From: eastb233 Date: Wed, 13 Dec 2023 16:45:13 +0800 Subject: [PATCH] Delete rpath (cherry picked from commit 84d52904c67812cc9b46f891afa529f28196d85e) --- gcc-7.spec | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc-7.spec b/gcc-7.spec index c1e70c2..bbab1d4 100644 --- a/gcc-7.spec +++ b/gcc-7.spec @@ -11,6 +11,11 @@ %define debug_package %{nil} +%if 0%{?__brp_strip:1} +# Something wrong with strip, so ignore errors +%global __brp_strip %{__brp_strip} || : +%endif + %if 0%{?scl:1} %global scl_prefix gcc-toolset-7- %global _prefix /opt/%{vendor}/gcc-toolset-7/root/usr @@ -87,7 +92,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: %{?scl_prefix}gcc%{gcc_ver} Version: 7.3.0 -Release: 1 +Release: 2 # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -98,7 +103,7 @@ URL: http://gcc.gnu.org BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: binutils >= 2.24 BuildRequires: glibc-headers -BuildRequires: libtool, zlib-devel, texinfo, gettext, flex, bison +BuildRequires: libtool, zlib-devel, texinfo, gettext, flex, bison, chrpath BuildRequires: gmp-devel >= 4.1.2, mpfr-devel >= 2.2.1, libmpc-devel >= 0.8.1, isl-devel >= 0.15.0 BuildRequires: python3-devel BuildRequires: gdb @@ -1640,7 +1645,12 @@ rm -f %{buildroot}%{mandir}/man3/ffi* # Help plugins find out nvra. echo gcc-%{version}-%{release}.%{_arch} > $FULLPATH/rpmver - + +# Delete rpath +for file in `find %{buildroot}%{_prefix}/%{_lib} -name lib*.so.*`; do + chrpath -d $file +done + %check %if 0 cd obj-%{gcc_target_platform} @@ -2719,5 +2729,8 @@ end %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog -* Thu June 08 2023 zhangwuji1995 7.3.0-1 -- Init gcc toolset gcc 7.3.0 \ No newline at end of file +* Wed Dec 13 2023 eastb233 7.3.0-2 +- Delete rpath + +* Thu Jun 08 2023 zhangwuji1995 7.3.0-1 +- Init gcc toolset gcc 7.3.0 -- Gitee