Skip to content

Commit 8a307e8

Browse files
kxxtfelixonmars
authored andcommitted
addpatch: nodejs-lts-jod 22.22.0-1
- Backport chromium-review.googlesource.com/c/v8/v8/+/7540554 to fix the long-standing nodejs heisenbug Sporadic Nodejs segfault on sg2042 revyos/revyos#27. Upstream PR: nodejs/node#61688 - `--nocheck` is needed. There are test failures. - Patch configure to accept python 3.14.
1 parent 4c26ef9 commit 8a307e8

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- configure.orig 2026-01-12 22:55:23.000000000 +0000
2+
+++ configure 2026-02-04 05:27:17.040677777 +0000
3+
@@ -23,7 +23,7 @@
4+
from distutils.spawn import find_executable as which
5+
6+
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
7+
-acceptable_pythons = ((3, 13), (3, 12), (3, 11), (3, 10), (3, 9), (3, 8))
8+
+acceptable_pythons = ((3, 14), (3, 13), (3, 12), (3, 11), (3, 10), (3, 9), (3, 8))
9+
if sys.version_info[:2] in acceptable_pythons:
10+
import configure
11+
else:
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From b7ecaa8f7e903f7cf5190aa1e3150e739fffa1cc Mon Sep 17 00:00:00 2001
2+
From: Vivian Wang <wangruikang@iscas.ac.cn>
3+
Date: Tue, 3 Feb 2026 16:46:02 +0800
4+
Subject: [PATCH] deps: V8: backport 6a0a25abaed3
5+
6+
Original commit message:
7+
8+
[riscv] Fix sp handling in MacroAssembler::LeaveFrame
9+
10+
Keep sp <= fp to ensure that data right above fp doesn't get clobbered
11+
by an inopportune signal and its handler.
12+
13+
Such clobbering can happen in e.g. Node.js when JIT-compiled code is
14+
interrupted by a SIGCHLD handler.
15+
16+
Bug: None
17+
Change-Id: Ief0836032ada7942e89f081f7605f61632c4d414
18+
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7540554
19+
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
20+
Commit-Queue: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
21+
Reviewed-by: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
22+
Cr-Commit-Position: refs/heads/main@{#105069}
23+
24+
Refs: https://github.com/v8/v8/commit/6a0a25abaed397f83eb0d92e4b33a5e18204f8bc
25+
Co-authored-by: kxxt <rsworktech@outlook.com>
26+
---
27+
deps/v8/AUTHORS | 1 +
28+
deps/v8/src/codegen/riscv/macro-assembler-riscv.cc | 3 ++-
29+
3 files changed, 4 insertions(+), 2 deletions(-)
30+
31+
diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS
32+
index 54fb45992db..93b3d9d5b23 100644
33+
--- a/deps/v8/AUTHORS
34+
+++ b/deps/v8/AUTHORS
35+
@@ -282,6 +282,7 @@ Vadim Gorbachev <bmsdave@gmail.com>
36+
Varun Varada <varuncvarada@gmail.com>
37+
Victor Costan <costan@gmail.com>
38+
Victor Polevoy <fx@thefx.co>
39+
+Vivian Wang <wangruikang@iscas.ac.cn>
40+
Vlad Burlik <vladbph@gmail.com>
41+
Vladimir Krivosheev <develar@gmail.com>
42+
Vladimir Shutoff <vovan@shutoff.ru>
43+
diff --git a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
44+
index fd5e97339b4..dc4e3aafcdb 100644
45+
--- a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
46+
+++ b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc
47+
@@ -6036,9 +6036,10 @@ void MacroAssembler::EnterFrame(StackFrame::Type type) {
48+
49+
void MacroAssembler::LeaveFrame(StackFrame::Type type) {
50+
ASM_CODE_COMMENT(this);
51+
- addi(sp, fp, 2 * kSystemPointerSize);
52+
+ Move(sp, fp);
53+
LoadWord(ra, MemOperand(fp, 1 * kSystemPointerSize));
54+
LoadWord(fp, MemOperand(fp, 0 * kSystemPointerSize));
55+
+ AddWord(sp, sp, 2 * kSystemPointerSize);
56+
}
57+
58+
void MacroAssembler::EnterExitFrame(int stack_space,
59+
--
60+
2.53.0
61+

nodejs-lts-jod/riscv64.patch

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--- PKGBUILD
2+
+++ PKGBUILD
3+
@@ -19,10 +19,14 @@ options=(!lto)
4+
source=(
5+
"https://nodejs.org/dist/v${pkgver}/node-v${pkgver}.tar.xz"
6+
update-icu-tests.patch
7+
+ configure-py314.diff
8+
+ riscv-v8-fix-sp.patch
9+
)
10+
# https://nodejs.org/download/release/latest-jod/SHASUMS256.txt.asc
11+
sha256sums=('4c138012bb5352f49822a8f3e6d1db71e00639d0c36d5b6756f91e4c6f30b683'
12+
- '43da0fb7469e34a239b2711876475f303a4012151e44f72e636a5a7fcf21bff8')
13+
+ '43da0fb7469e34a239b2711876475f303a4012151e44f72e636a5a7fcf21bff8'
14+
+ '9eefe84d90cedffd47878cfd4f027d18fd8724ce2f798ba11cc2b3b861d1f10d'
15+
+ 'c3ecf573ef238c4d97fb051eefe0d4d47cdac8d6282f13cad69b04ec564460af')
16+
17+
_set_flags() {
18+
# /usr/lib/libnode.so uses malloc_usable_size, which is incompatible with fortification level 3
19+
@@ -32,6 +36,8 @@ _set_flags() {
20+
21+
prepare() {
22+
cd node-v${pkgver}
23+
+ patch -Np0 -i ../configure-py314.diff
24+
+ patch -Np1 -i ../riscv-v8-fix-sp.patch
25+
# Update ICU tests https://github.com/nodejs/node/pull/60523
26+
patch -Np1 -i ../update-icu-tests.patch
27+
}

0 commit comments

Comments
 (0)