[RPM] Add pie and delete rpath in libgfortran

(cherry picked from commit d1eef1aca9003ee64cd3d50b9bdc566a1e3486ac)
This commit is contained in:
huang-xiaoquan 2023-03-09 15:23:41 +08:00 committed by openeuler-sync-bot
parent 0f3c849db8
commit 3691b150f1

View File

@ -61,7 +61,7 @@
Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc
Version: %{gcc_version}
Release: 23
Release: 24
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
URL: https://gcc.gnu.org
@ -798,7 +798,7 @@ enablelgo=,go
enableld=,d
%endif
OPT_FLAGS="$OPT_FLAGS -O2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE -Wl,-z,relro,-z,now"
OPT_LDFLAGS="$OPT_LDFLAGS -Wl,-z,relro,-z,now"
OPT_LDFLAGS="$OPT_LDFLAGS -pie -Wl,-z,relro,-z,now"
export extra_ldflags_libobjc="-Wl,-z,relro,-z,now"
export FCFLAGS="$OPT_FLAGS"
CC="$CC" CFLAGS="$OPT_FLAGS" \
@ -1568,6 +1568,7 @@ strip -g `find . \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
-a -type f`
popd
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgfortran.so.5.*
chrpath -d %{buildroot}%{_prefix}/%{_lib}/libgfortran.so.5.*
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgomp.so.1.*
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libcc1.so.0.*
%if %{build_libquadmath}
@ -2771,6 +2772,12 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
* Thu Mar 9 2023 huangxiaoquan <huangxiaoquan1@huawei.com> - 10.3.1-24
- Type:Fix
- ID:NA
- SUG:NA
- DESC:Add pie and delete rpath in libgfortran
* Sun Feb 26 2023 huitailang <804544223@qq.com> - 10.3.1-23
- Type:Sync
- ID:NA