From 3abcb265bbce6cfee60e34289bbe75718cd313d6 Mon Sep 17 00:00:00 2001 From: yueyuankun Date: Fri, 15 Mar 2024 11:24:57 +0800 Subject: [PATCH] Loongsarch64 SW_64 architecture adds optflags macro to enhance the robustness of compiled programs and prevent common security issues (cherry picked from commit 047495a7f779f4074a2fda87499b4f843d3ad44e) --- ...d-optflags-for-loongarch64-and-sw_64.patch | 26 +++++++++++++++++++ openEuler-rpm-config.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 openEuler-rpm-config-add-optflags-for-loongarch64-and-sw_64.patch diff --git a/openEuler-rpm-config-add-optflags-for-loongarch64-and-sw_64.patch b/openEuler-rpm-config-add-optflags-for-loongarch64-and-sw_64.patch new file mode 100644 index 0000000..a50dd54 --- /dev/null +++ b/openEuler-rpm-config-add-optflags-for-loongarch64-and-sw_64.patch @@ -0,0 +1,26 @@ +From ed8b90665c3bda8ca6bea1bf541e0232f03fb371 Mon Sep 17 00:00:00 2001 +From: yueyuankun +Date: Fri, 15 Mar 2024 11:17:38 +0800 +Subject: [PATCH] add optflags for loongarch64 and sw_64 + +--- + rpmrc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/rpmrc b/rpmrc +index 10d7c86..45840e6 100644 +--- a/rpmrc ++++ b/rpmrc +@@ -8,6 +8,9 @@ optflags: x86_64 %{__global_compiler_flags} -m64 -mtune=generic -fasynchronous-u + optflags: aarch64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection + optflags: riscv64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection + ++optflags: loongarch64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection ++optflags: sw_64 %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection ++ + optflags: ppc64le %{__global_compiler_flags} -fasynchronous-unwind-tables -fstack-clash-protection + + buildarchtranslate: athlon: i686 +-- +2.43.0 + diff --git a/openEuler-rpm-config.spec b/openEuler-rpm-config.spec index 8b07262..3d3947a 100644 --- a/openEuler-rpm-config.spec +++ b/openEuler-rpm-config.spec @@ -3,7 +3,7 @@ Name: %{vendor}-rpm-config Version: 30 -Release: 50 +Release: 51 License: GPL+ Summary: specific rpm configuration files URL: https://gitee.com/openeuler/openEuler-rpm-config @@ -37,6 +37,7 @@ Patch23: add-powerpc64le-and-ppc64le-support.patch Patch24: Delete-the-commented-code.patch 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 Provides: python-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} Provides: python2-rpm-macros = %{?epoch:%{epoch}:}%{version}-%{release} @@ -148,6 +149,9 @@ sed -i "s/__vendor/%{vendor}/g" `grep "__vendor" -rl %{buildroot}%{_rpmconfigdir %{rpmvdir}/find-requires.ksyms %changelog +* Fri Mar 15 2024 yueyuankun - 30-51 +- Add optflags for loongarch64 and sw_64 + * Tue Mar 12 2024 liyunfei - 30-50 - Add clang toolchain support -- Gitee