From ee8fb9da7019ce9e0e8b05b03e94212d5eba692d Mon Sep 17 00:00:00 2001 From: xujing Date: Wed, 10 Jul 2024 19:22:09 +0800 Subject: [PATCH] openEuler-rpm-config: Enable --as-needed by default --- backport-Enable-as-needed-by-default.patch | 31 ++++++++++++++++++++++ openEuler-rpm-config.spec | 6 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-Enable-as-needed-by-default.patch diff --git a/backport-Enable-as-needed-by-default.patch b/backport-Enable-as-needed-by-default.patch new file mode 100644 index 0000000..182e388 --- /dev/null +++ b/backport-Enable-as-needed-by-default.patch @@ -0,0 +1,31 @@ +From 210649d3a50eb862eb95caec54c52cd1513a1dda Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Wed, 15 Aug 2018 07:00:14 +0200 +Subject: [PATCH] Enable --as-needed by default + +Conflict:adapt context +Reference:https://src.fedoraproject.org/rpms/redhat-rpm-config/c/357550f7ba4495b01399c904d389369eb0666837 + +Signed-off-by: Igor Gnatenko +--- + macros | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/macros b/macros +index cb96614..0d54994 100644 +--- a/macros ++++ b/macros +@@ -257,8 +257,8 @@ + #%_ld_strict_symbol_defs 1 + %_ld_symbols_flags %{?_ld_strict_symbol_defs:-Wl,-z,defs} + +-# use "%define _ld_as_needed 1" to enable. +-#%_ld_as_needed 1 ++# use "%undefine _ld_as_needed" to disable. ++%_ld_as_needed 1 + %_ld_as_needed_flags %{?_ld_as_needed:-Wl,--as-needed} + + %_general_options -O2 -g -grecord-gcc-switches -pipe -fstack-protector-strong %[ "%{toolchain}" == "clang" ? "-fgcc-compatible" : "" ] +-- +2.33.0 + diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 896bca5..5abd954 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 30 -Release: 56 +Release: 57 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -39,6 +39,7 @@ Patch25: Add-support-for-selecting-clang-as-a-toolchain.patch Patch26: Call-set_build_flags-cc-before-build-check-and-insta.patch Patch27: openEuler-rpm-config-add-optflags-for-loongarch64-and-sw_64.patch Patch28: add-riscv64-to-some-arches-macro.patch +Patch29: backport-Enable-as-needed-by-default.patch Provides: python-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} Provides: python2-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} @@ -150,6 +151,9 @@ sed -i "s/__vendor/%{vendor}/g" `grep "__vendor" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Wed Jul 10 2024 xujing - 30-57 +- enable --as-needed by default + * Mon Apr 29 2024 xujing - 30-56 - don't delete the commented code in macros -- Gitee