Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions nodejs-lts-krypton/riscv64.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- PKGBUILD
+++ PKGBUILD
@@ -44,7 +44,14 @@ provides=(
@@ -44,7 +44,15 @@ provides=(
conflicts=(nodejs)
options=('!lto')
source=("git+https://github.com/nodejs/node.git#tag=v$pkgver?signed")
Expand All @@ -12,11 +12,12 @@
+ 'ae8fc401ef3bedf0e90bf6d9ff116aac911f20fc075fd35de06c5f538be3eea49f5f5803628ef292a7fc25f9ead2c75c2cbce765fe78ed9062f1859876966766'
+ '9d1a5fffd988d2aa5227a1c226a772c94d1c4c1a2e32fef1a7ba40e000c3873010e3e4017b9dda6b10667fa9832fd8f6c72a290636681b397069e5e309bb0722'
+ '706f0be85025b9fd23a341d99d134e0e020ccc2df3ca4ac28a0b9e1fde878ea64aa269293e9661812fb3d06249b8d8aea461e2a23d4f48fe2951905304341b4b'
+ 'f1ad5e9efed34da853427b8aa1857d08f8856f0ec2c60feeb1d810dcc1f0d60f03570c0e40ee066e3a995e9be3de5115284b34aa2301bd7b15f100efb7caff23'
+ '74c0a6873d289a4f3e904d1c63b7f01c835098690245b52e3fd144061a977b01263d896e850ee8914fd999348d685ba85c949df57c266002cf529fef7d53196c')
validpgpkeys=(
'8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600' # Michaël Zasso (Targos) <targos@protonmail.com>
'890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4' # RafaelGSS <rafael.nunu@hotmail.com>
@@ -58,12 +65,21 @@ _set_flags() {
@@ -58,12 +66,22 @@ _set_flags() {
# /usr/lib/libnode.so uses malloc_usable_size, which is incompatible with fortification level 3
CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
Expand All @@ -36,10 +37,11 @@
+ patch -Np1 -i ../60591.diff
+ patch -Np1 -i ../v8-riscv-fix-trampoline.patch
+ patch -Np1 -i ../v8-riscv-fix-trampoline-release.patch
+ patch -Np1 -i ../v8-riscv-fix-sp.patch
}

build() {
@@ -95,6 +111,8 @@ build() {
@@ -95,6 +113,8 @@ build() {
check() {
_set_flags
cd node
Expand All @@ -48,7 +50,7 @@
rm test/parallel/test-http2-client-set-priority.js
rm test/parallel/test-http2-client-unescaped-path.js
rm test/parallel/test-http2-max-invalid-frames.js
@@ -119,4 +137,12 @@ package() {
@@ -119,4 +139,13 @@ package() {
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}

Expand All @@ -59,5 +61,6 @@
+ "60588.diff"
+ "60591.diff"
+ v8-riscv-fix-trampoline{,-release}.patch
+ v8-riscv-fix-sp.patch
+ https://github.com/nodejs/node/commit/5afe4cd716cbf7699f6abc99338f44db3b1424d5.diff)
# vim:set ts=2 sw=2 et:
61 changes: 61 additions & 0 deletions nodejs-lts-krypton/v8-riscv-fix-sp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 4a6c726c1445890f3f40b6cf01eb635a6ac13827 Mon Sep 17 00:00:00 2001
From: Vivian Wang <wangruikang@iscas.ac.cn>
Date: Tue, 3 Feb 2026 16:46:02 +0800
Subject: [PATCH] deps: V8: backport 6a0a25abaed3

Original commit message:

[riscv] Fix sp handling in MacroAssembler::LeaveFrame

Keep sp <= fp to ensure that data right above fp doesn't get clobbered
by an inopportune signal and its handler.

Such clobbering can happen in e.g. Node.js when JIT-compiled code is
interrupted by a SIGCHLD handler.

Bug: None
Change-Id: Ief0836032ada7942e89f081f7605f61632c4d414
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7540554
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
Commit-Queue: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
Reviewed-by: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#105069}

Refs: https://github.com/v8/v8/commit/6a0a25abaed397f83eb0d92e4b33a5e18204f8bc
Co-authored-by: kxxt <rsworktech@outlook.com>
---
deps/v8/AUTHORS | 1 +
deps/v8/src/codegen/riscv/macro-assembler-riscv.cc | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS
index 280e33e6841..b7e6fac8f83 100644
--- a/deps/v8/AUTHORS
+++ b/deps/v8/AUTHORS
@@ -294,6 +294,7 @@ Vadim Gorbachev <bmsdave@gmail.com>
Varun Varada <varuncvarada@gmail.com>
Victor Costan <costan@gmail.com>
Victor Polevoy <fx@thefx.co>
+Vivian Wang <wangruikang@iscas.ac.cn>
Vlad Burlik <vladbph@gmail.com>
Vladimir Kempik <vladimir.kempik@syntacore.com>
Vladimir Krivosheev <develar@gmail.com>
diff --git a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
index 12379ec0ff6..203b2bcd61c 100644
--- a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
+++ b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
@@ -6709,9 +6709,10 @@ void MacroAssembler::EnterFrame(StackFrame::Type type) {

void MacroAssembler::LeaveFrame(StackFrame::Type type) {
ASM_CODE_COMMENT(this);
- addi(sp, fp, 2 * kSystemPointerSize);
+ Move(sp, fp);
LoadWord(ra, MemOperand(fp, 1 * kSystemPointerSize));
LoadWord(fp, MemOperand(fp, 0 * kSystemPointerSize));
+ AddWord(sp, sp, 2 * kSystemPointerSize);
}

void MacroAssembler::EnterExitFrame(Register scratch, int stack_space,
--
2.53.0