From 85f2c6dbe719dc05b8d888c84d1378c4d191859f Mon Sep 17 00:00:00 2001 From: "yan.yihao 10263201" Date: Wed, 19 Nov 2025 17:38:53 +0800 Subject: [PATCH] enable riscv64 --- 0002-turn-off-lto-for-riscv.patch | 20 ++++++++++++++++++++ nodejs.spec | 9 +++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 0002-turn-off-lto-for-riscv.patch diff --git a/0002-turn-off-lto-for-riscv.patch b/0002-turn-off-lto-for-riscv.patch new file mode 100644 index 0000000..37d8c5e --- /dev/null +++ b/0002-turn-off-lto-for-riscv.patch @@ -0,0 +1,20 @@ +diff -ru a/common.gypi b/common.gypi +--- a/common.gypi 2025-05-21 00:12:46.000000000 -0400 ++++ b/common.gypi 2025-11-26 22:43:08.975621917 -0500 +@@ -189,8 +189,14 @@ + ['clang==1', { + 'lto': ' -flto ', # Clang + }, { +- 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC +- }], ++ 'conditions': [ ++ ['target_arch=="riscv64"', { ++ 'lto': ' -fno-lto -fuse-linker-plugin -ffat-lto-objects', ++ },{ ++ 'lto': ' -flto=4 -fuse-linker-plugin -ffat-lto-objects ', # GCC ++ }] ++ ] ++ }], + ], + }, + 'cflags': [ '-O3' ], diff --git a/nodejs.spec b/nodejs.spec index 622cc1d..899685f 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -39,7 +39,7 @@ # This is used by both the nodejs package and the npm subpackage that # has a separate version - the name is special so that rpmdev-bumpspec # will bump this rather than adding .1 to the end. -%global baserelease 2 +%global baserelease 3 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -179,9 +179,6 @@ License: MIT and ASL 2.0 and ISC and BSD Group: Development/Languages URL: http://nodejs.org/ -# for now, these two arches build failed -ExcludeArch: riscv64 - # nodejs bundles openssl, but we use the system version in Fedora # because openssl contains prohibited code, we remove openssl completely from # the tarball, using the script in Source100 @@ -201,6 +198,7 @@ Source300: test-runner.sh Source301: test-should-pass.txt Patch: 0001-Remove-unused-OpenSSL-config.patch +Patch1: 0002-turn-off-lto-for-riscv.patch %global pkgname nodejs @@ -879,6 +877,9 @@ end %changelog +* Thu Nov 27 2025 Yihao Yan - 1:22.16.0-3 +- enable riscv64 + * Wed Aug 13 2025 Wenlong Zhang - 1:22.16.0-2 - enable loongarch64 -- Gitee