From 10a3feb3b3b84292a84758b874808490f2b7a7fc Mon Sep 17 00:00:00 2001 From: "yan.yihao 10263201" Date: Tue, 22 Apr 2025 16:46:26 +0800 Subject: [PATCH 1/2] add support for RISC-V build --- macros | 2 +- macros.java-srpm | 2 +- macros.nodejs-srpm | 2 +- rpmrc | 2 ++ 4 files changed, 5 insertions(+), 3 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" : "" ] -- Gitee From e0810c3a1554eee224af0e4a86fa99100cd91202 Mon Sep 17 00:00:00 2001 From: yAn1hCDc Date: Tue, 22 Apr 2025 10:49:10 +0000 Subject: [PATCH 2/2] Revert "add support for RISC-V build" This reverts commit 10a3feb3b3b84292a84758b874808490f2b7a7fc. --- macros | 2 +- macros.java-srpm | 2 +- macros.nodejs-srpm | 2 +- rpmrc | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/macros b/macros index b6ae6b9..ae41866 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 %[ "%{_target_cpu}" == "riscv64" ? "" : "-flto" ] +%_clang_lto_cflags -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 125efd5..f31d492 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 riscv64 +%java_arches aarch64 x86_64 loongarch64 diff --git a/macros.nodejs-srpm b/macros.nodejs-srpm index c212943..0a2e89b 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 riscv64 +%nodejs_arches x86_64 aarch64 loongarch64 diff --git a/rpmrc b/rpmrc index fb44aff..c504d87 100644 --- a/rpmrc +++ b/rpmrc @@ -5,5 +5,3 @@ 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" : "" ] -- Gitee