From c8c92f07dafccdf790e314d24d28af0921fff6c0 Mon Sep 17 00:00:00 2001 From: "yan.yihao 10263201" Date: Tue, 22 Apr 2025 18:56:58 +0800 Subject: [PATCH] add support for RISC-V build --- macros | 2 +- macros.java-srpm | 2 +- macros.nodejs-srpm | 2 +- rpmrc | 2 ++ system-rpm-config.spec | 6 +++++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/macros b/macros index ae41866..b6ae6b9 100644 --- a/macros +++ b/macros @@ -369,7 +369,7 @@ print(result) # way we can detect installing an unusable .o/.a file. This is on the TODO # list for F34. %_gcc_lto_cflags -flto=auto -ffat-lto-objects -%_clang_lto_cflags -flto +%_clang_lto_cflags %[ "%{_target_cpu}" == "riscv64" ? "" : "-flto" ] %_lto_cflags %{expand:%%{_%{toolchain}_lto_cflags}} # Some linkers default to a build-id algoritim that is not supported by rpmbuild, diff --git a/macros.java-srpm b/macros.java-srpm index f31d492..125efd5 100644 --- a/macros.java-srpm +++ b/macros.java-srpm @@ -1,2 +1,2 @@ # Arches that OpenJDK and dependent packages run on -%java_arches aarch64 x86_64 loongarch64 +%java_arches aarch64 x86_64 loongarch64 riscv64 diff --git a/macros.nodejs-srpm b/macros.nodejs-srpm index 0a2e89b..c212943 100644 --- a/macros.nodejs-srpm +++ b/macros.nodejs-srpm @@ -2,5 +2,5 @@ # Enabling Node.js on other arches requires porting the V8 JavaScript JIT to # those arches. -%nodejs_arches x86_64 aarch64 loongarch64 +%nodejs_arches x86_64 aarch64 loongarch64 riscv64 diff --git a/rpmrc b/rpmrc index c504d87..fb44aff 100644 --- a/rpmrc +++ b/rpmrc @@ -5,3 +5,5 @@ optflags: x86_64 %{__global_compiler_flags} -m64 %{__cflags_arch_x86_64} -mtune= optflags: aarch64 %{__global_compiler_flags} -mbranch-protection=standard -fasynchronous-unwind-tables %[ "%{toolchain}" == "gcc" ? "-fstack-clash-protection" : "" ] optflags: loongarch64 %{__global_compiler_flags} -fasynchronous-unwind-tables %[ "%{toolchain}" == "gcc" ? "-fstack-clash-protection" : "" ] + +optflags: riscv64 %{__global_compiler_flags} -fasynchronous-unwind-tables %[ "%{toolchain}" == "gcc" ? "-fstack-clash-protection" : "" ] diff --git a/system-rpm-config.spec b/system-rpm-config.spec index 48b2e68..a1c44b5 100644 --- a/system-rpm-config.spec +++ b/system-rpm-config.spec @@ -1,4 +1,4 @@ -%define anolis_release 37 +%define anolis_release 38 Summary: Anolis OS specific rpm configuration files Name: system-rpm-config @@ -211,6 +211,10 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/anolis/srpm forge.lua %license MulanPSL %changelog +* Tue Apr 22 2025 Yihao Yan - 1:23-38 +- add riscv64 for java and nodejs macros +- add optflags for riscv64 + * Wed Jul 24 2024 Wenlong Zhang - 1:23-37 - add timeout when create option.list -- Gitee