diff --git a/0004-Add-check-for-mold-before-use-it.patch b/0004-Add-check-for-mold-before-use-it.patch new file mode 100644 index 0000000000000000000000000000000000000000..46c24c20031f2044584a7fe5275f5ba04d338bc5 --- /dev/null +++ b/0004-Add-check-for-mold-before-use-it.patch @@ -0,0 +1,33 @@ +From a9f3c5a05792c8581f62b2cd0c3a92f69761888c Mon Sep 17 00:00:00 2001 +From: yinchuang +Date: Fri, 28 Feb 2025 10:45:22 +0800 +Subject: [PATCH] Add check for mold before use it + +--- + check_pkg_in_whitelist | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/check_pkg_in_whitelist b/check_pkg_in_whitelist +index 63d6ebb..a4c5616 100755 +--- a/check_pkg_in_whitelist ++++ b/check_pkg_in_whitelist +@@ -1,5 +1,14 @@ + #!/bin/sh + +-if grep -Fxq $2 $1;then +- echo "-fuse-ld=mold" ++binary_name="mold" ++# Enable build with mold when the mold binary exists. ++if which "$binary_name" > /dev/null 2>&1; then ++ mold_path=$(which "$binary_name") ++ if [ ! -x $mold_path ]; then ++ exit 0 ++ fi ++ ++ if grep -Fxq $2 $1;then ++ echo "-fuse-ld=mold" ++ fi + fi +-- +2.33.0 + diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 44064da2e493e9551665c18243a92d9bd73c5879..afea1c5607a5ee30e665e6839a66945514532f87 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 31 -Release: 16 +Release: 17 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/src-openeuler/openEuler-rpm-config @@ -50,6 +50,7 @@ Source501: config.sub Patch0001: 0001-support-sw_64-arch.patch Patch0002: 0002-Enable-mold-links-through-whitelist.patch Patch0003: 0003-Remove-packages-affected-by-mold.patch +Patch0004: 0004-Add-check-for-mold-before-use-it.patch # BRPs Source700: brp-chrpath Source701: brp-digest-list @@ -190,6 +191,9 @@ sed -i "s/@VENDOR@/%{vendor}/g" `grep "@VENDOR@" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Fri Feb 28 2025 yinchuang - 31-17 +- Add check for mold before use it + * Tue Feb 18 2025 Jun He - 31-16 - Add compile flag (-mbranch-protection=standard) to enable PAC/BTI features on aarch64 as default