mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-07-25 17:11:16 +00:00
Upgraded nodejs from 16.14.0 to 21.1.0
This commit is contained in:
@ -1,35 +1,61 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Node.js
|
||||
# Source: https://nodejs.org/dist/v16.14.0/node-v16.14.0.tar.gz
|
||||
# Source: https://nodejs.org/dist/v21.1.0/node-v21.1.0.tar.xz
|
||||
#
|
||||
# $BUILD = Directory to temporarily install
|
||||
# $PKGS = Directory to store built packages
|
||||
#
|
||||
# DEPS
|
||||
# Required: Which, c-ares
|
||||
# Recommended: ICU, libuv, nghttp2
|
||||
# Recommended: ICU, libuv, nghttp2, brotli
|
||||
# Optional: http-parser, NPM
|
||||
#
|
||||
# Node.js does not compile with LibreSSL. Use the bundled openssl.
|
||||
# NOTE: Node.js does not compile with LibreSSL. Use the bundled openssl OR OpenSSL
|
||||
# in /opt/openssl
|
||||
|
||||
# NOTE: Fails to compile with clanf. Must use GCC
|
||||
|
||||
# Apply patches from Chimera Linux
|
||||
patch -Np1 -i ../patches/nodejs-chimera/clang-ppc64.patch
|
||||
patch -Np1 -i ../patches/nodejs-chimera/disable-running-gyp-on-shared-deps.patch
|
||||
patch -Np1 -i ../patches/nodejs-chimera/riscv-backport-refactor.patch
|
||||
patch -Np1 -i ../patches/nodejs-chimera/shared-uv.patch
|
||||
|
||||
case $(uname -m) in
|
||||
i686) export LDFLAGS="-Wl,--no-keep-memory" ;;
|
||||
esac
|
||||
export CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" &&
|
||||
export CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" &&
|
||||
|
||||
#rm -rvf deps/brotli deps/cares deps/uv deps/zlib &&
|
||||
for d in brotli cares zlib
|
||||
do
|
||||
rm -rf deps/$d
|
||||
done
|
||||
rm -rf deps/v8/third_party/jinja2
|
||||
rm -rf tools/inspector_protocol/jinja2
|
||||
|
||||
# If using OpenSSL in /opt/openssl, add these aguments to configure:
|
||||
export EOSSL="--shared-openssl-includes /opt/openssl/include "
|
||||
export EOSSL+="--shared-openssl-libpath /optn/openssl/lib "
|
||||
|
||||
# If GCC is not in /usr, set the path (CMLFS)
|
||||
PATH=/opt/gnu/bin:$PATH CC=gcc CXX=g++ \
|
||||
./configure --prefix=/usr --shared-zlib \
|
||||
--with-intl=system-icu \
|
||||
--shared-libuv \
|
||||
--shared-nghttp2 \
|
||||
--shared-cares &&
|
||||
--shared-cares \
|
||||
--shared-brotli $EOSSL &&
|
||||
|
||||
# If GCC is not in /usr, set the path & library path (CMLFS)
|
||||
PATH=/opt/gnu/bin:$PATH LD_LIBRARY_PATH=/opt/gnu/lib:/usr/lib \
|
||||
make BUILDTYPE=Release -j2
|
||||
|
||||
sudo -S -E make DESTDIR=$BUILD install &&
|
||||
#sudo -S -E make DESTDIR=$BUILD install &&
|
||||
|
||||
# If GCC is not in /usr, set the path & library path (CMLFS)
|
||||
sudo -S -E PATH=/opt/gnu/bin:$PATH LD_LIBRARY_PATH=/opt/gnu/lib:/usr/lib \
|
||||
make DESTDIR=$BUILD install
|
||||
|
||||
sudo -S mkdir -pv /BMAN/install /BMAN/usr/share && \
|
||||
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/ && \
|
||||
unset CXXFLAGS CFLAGS LDFLAGS &&
|
||||
@ -57,7 +83,10 @@ nodejs:
|
||||
nodejs:
|
||||
EOF
|
||||
sudo -S mv -v /tmp/slack-desc install/ &&
|
||||
sudo -S makepkg -l y -c n $PKGS/nodejs-16.14.0-$(uname -m)-mlfs.txz && \
|
||||
# If GCC is not in /usr, add runpaths via pathcelf
|
||||
sudo patchelf --add-rpath /opt/gnu/lib usr/bin/node
|
||||
|
||||
sudo -S makepkg -l y -c n $PKGS/nodejs-21.1.0-$PSUFFIX && \
|
||||
cd /BMAN && \
|
||||
cat > /tmp/slack-desc << "EOF"
|
||||
nodejs-doc: Manuals for nodejs
|
||||
@ -69,5 +98,5 @@ nodejs-doc: https://nodejs.org/
|
||||
nodejs-doc:
|
||||
EOF
|
||||
sudo -S mv -v /tmp/slack-desc install/ && \
|
||||
sudo -S makepkg -l y -c n $PKGS/nodejs-doc-16.14.0-noarch-mlfs.txz && \
|
||||
sudo -S makepkg -l y -c n $PKGS/nodejs-doc-21.1.0-$NOPSUFFIX && \
|
||||
sudo -S rm -rf ${BUILD}/* /BMAN/*
|
||||
|
20
patches/nodejs-chimera/clang-ppc64.patch
Normal file
20
patches/nodejs-chimera/clang-ppc64.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -426,7 +426,7 @@
|
||||
'ldflags': [ '-m32' ],
|
||||
}],
|
||||
[ 'host_arch=="ppc64" and OS not in "aix os400"', {
|
||||
- 'cflags': [ '-m64', '-mminimal-toc' ],
|
||||
+ 'cflags': [ '-m64' ],
|
||||
'ldflags': [ '-m64' ],
|
||||
}],
|
||||
[ 'host_arch=="s390x" and OS=="linux"', {
|
||||
@@ -450,7 +450,7 @@
|
||||
'ldflags': [ '-m32' ],
|
||||
}],
|
||||
[ 'target_arch=="ppc64" and OS not in "aix os400"', {
|
||||
- 'cflags': [ '-m64', '-mminimal-toc' ],
|
||||
+ 'cflags': [ '-m64' ],
|
||||
'ldflags': [ '-m64' ],
|
||||
}],
|
||||
[ 'target_arch=="s390x" and OS=="linux"', {
|
@ -0,0 +1,20 @@
|
||||
From: Jakub Jirutka <jakub@jirutka.cz>
|
||||
Date: Sat, 26 Nov 2016 01:32:00 +0200
|
||||
Subject: Disable running gyp on shared deps
|
||||
|
||||
Author: Stephen Gallagher <sgallagh@redhat.com>
|
||||
|
||||
Modified 2016-11-26 by Jakub Jirutka <jakub@jirutka.cz> to update for
|
||||
Node.js 7.2.0
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -141,7 +141,7 @@
|
||||
echo "'test-code-cache' target is a noop"
|
||||
|
||||
out/Makefile: config.gypi common.gypi node.gyp \
|
||||
- deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
|
||||
+ deps/uv/uv.gyp deps/llhttp/llhttp.gyp \
|
||||
deps/simdutf/simdutf.gyp deps/ada/ada.gyp \
|
||||
tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
|
||||
tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
|
38
patches/nodejs-chimera/no-libatomic.patch
Normal file
38
patches/nodejs-chimera/no-libatomic.patch
Normal file
@ -0,0 +1,38 @@
|
||||
commit 77fdabaebe1db7ac3af8f7ab6ec75e143982b4d4
|
||||
Author: Daniel Kolesa <daniel@octaforge.org>
|
||||
Date: Fri Apr 21 18:47:37 2023 +0200
|
||||
|
||||
drop -latomic (none in pure-llvm env)
|
||||
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index f092c332..ddbd8085 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -418,9 +418,6 @@
|
||||
'-Wl,-bnoerrmsg',
|
||||
],
|
||||
}],
|
||||
- ['OS == "linux" and llvm_version != "0.0"', {
|
||||
- 'libraries': ['-latomic'],
|
||||
- }],
|
||||
],
|
||||
},
|
||||
|
||||
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
|
||||
index 4ed21761..b00c158b 100644
|
||||
--- a/tools/v8_gypfiles/v8.gyp
|
||||
+++ b/tools/v8_gypfiles/v8.gyp
|
||||
@@ -1084,13 +1084,6 @@
|
||||
['v8_enable_third_party_heap', {
|
||||
# TODO(targos): add values from v8_third_party_heap_libs to link_settings.libraries
|
||||
}],
|
||||
- # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
|
||||
- # to implement atomic memory access
|
||||
- ['v8_current_cpu in ["mips64", "mips64el", "ppc", "arm", "riscv64", "loong64"]', {
|
||||
- 'link_settings': {
|
||||
- 'libraries': ['-latomic', ],
|
||||
- },
|
||||
- }],
|
||||
],
|
||||
}, # v8_base_without_compiler
|
||||
{
|
145
patches/nodejs-chimera/riscv-backport-refactor.patch
Normal file
145
patches/nodejs-chimera/riscv-backport-refactor.patch
Normal file
@ -0,0 +1,145 @@
|
||||
From 13192d6e10fa726858056e49fc9bca6201401171 Mon Sep 17 00:00:00 2001
|
||||
From: Lu Yahan <yahan@iscas.ac.cn>
|
||||
Date: Tue, 5 Sep 2023 09:31:56 +0800
|
||||
Subject: [PATCH] [riscv][tagged-ptr] Convert more Objects to Tagged<>
|
||||
|
||||
Port commit 064b9a7903b793734b6c03a86ee53a2dc85f0f80
|
||||
|
||||
Bug: v8:12710
|
||||
|
||||
Change-Id: If076ca5cd9e9d175c20fc3611e03d39c0260404d
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4837830
|
||||
Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
|
||||
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
|
||||
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
|
||||
Cr-Commit-Position: refs/heads/main@{#89780}
|
||||
---
|
||||
src/builtins/riscv/builtins-riscv.cc | 2 +-
|
||||
src/codegen/riscv/assembler-riscv-inl.h | 15 ++++++++-------
|
||||
src/codegen/riscv/assembler-riscv.h | 2 +-
|
||||
src/execution/riscv/simulator-riscv.cc | 8 ++++----
|
||||
src/regexp/riscv/regexp-macro-assembler-riscv.cc | 2 +-
|
||||
5 files changed, 15 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/builtins/riscv/builtins-riscv.cc b/src/builtins/riscv/builtins-riscv.cc
|
||||
index 326001fdd18..638001f9054 100644
|
||||
--- a/deps/v8/src/builtins/riscv/builtins-riscv.cc
|
||||
+++ b/deps/v8/src/builtins/riscv/builtins-riscv.cc
|
||||
@@ -1673,7 +1673,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
|
||||
// Set the return address to the correct point in the interpreter entry
|
||||
// trampoline.
|
||||
Label builtin_trampoline, trampoline_loaded;
|
||||
- Smi interpreter_entry_return_pc_offset(
|
||||
+ Tagged<Smi> interpreter_entry_return_pc_offset(
|
||||
masm->isolate()->heap()->interpreter_entry_return_pc_offset());
|
||||
DCHECK_NE(interpreter_entry_return_pc_offset, Smi::zero());
|
||||
|
||||
diff --git a/src/codegen/riscv/assembler-riscv-inl.h b/src/codegen/riscv/assembler-riscv-inl.h
|
||||
index 773dc560da1..8abf4b3239f 100644
|
||||
--- a/deps/v8/src/codegen/riscv/assembler-riscv-inl.h
|
||||
+++ b/deps/v8/src/codegen/riscv/assembler-riscv-inl.h
|
||||
@@ -128,9 +128,9 @@ Handle<HeapObject> Assembler::compressed_embedded_object_handle_at(
|
||||
}
|
||||
|
||||
void Assembler::deserialization_set_special_target_at(
|
||||
- Address instruction_payload, Code code, Address target) {
|
||||
+ Address instruction_payload, Tagged<Code> code, Address target) {
|
||||
set_target_address_at(instruction_payload,
|
||||
- !code.is_null() ? code.constant_pool() : kNullAddress,
|
||||
+ !code.is_null() ? code->constant_pool() : kNullAddress,
|
||||
target);
|
||||
}
|
||||
|
||||
@@ -159,12 +159,13 @@ void Assembler::deserialization_set_target_internal_reference_at(
|
||||
}
|
||||
}
|
||||
|
||||
-HeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
|
||||
+Tagged<HeapObject> RelocInfo::target_object(PtrComprCageBase cage_base) {
|
||||
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
|
||||
if (IsCompressedEmbeddedObject(rmode_)) {
|
||||
- return HeapObject::cast(Object(V8HeapCompressionScheme::DecompressTagged(
|
||||
- cage_base,
|
||||
- Assembler::target_compressed_address_at(pc_, constant_pool_))));
|
||||
+ return HeapObject::cast(
|
||||
+ Tagged<Object>(V8HeapCompressionScheme::DecompressTagged(
|
||||
+ cage_base,
|
||||
+ Assembler::target_compressed_address_at(pc_, constant_pool_))));
|
||||
} else {
|
||||
return HeapObject::cast(
|
||||
Object(Assembler::target_address_at(pc_, constant_pool_)));
|
||||
@@ -186,7 +187,7 @@ Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
|
||||
}
|
||||
}
|
||||
|
||||
-void RelocInfo::set_target_object(HeapObject target,
|
||||
+void RelocInfo::set_target_object(Tagged<HeapObject> target,
|
||||
ICacheFlushMode icache_flush_mode) {
|
||||
DCHECK(IsCodeTarget(rmode_) || IsEmbeddedObjectMode(rmode_));
|
||||
if (IsCompressedEmbeddedObject(rmode_)) {
|
||||
diff --git a/src/codegen/riscv/assembler-riscv.h b/src/codegen/riscv/assembler-riscv.h
|
||||
index 65c317ad018..ced4dd8aee8 100644
|
||||
--- a/deps/v8/src/codegen/riscv/assembler-riscv.h
|
||||
+++ b/deps/v8/src/codegen/riscv/assembler-riscv.h
|
||||
@@ -288,7 +288,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase,
|
||||
// This is for calls and branches within generated code. The serializer
|
||||
// has already deserialized the lui/ori instructions etc.
|
||||
inline static void deserialization_set_special_target_at(Address location,
|
||||
- Code code,
|
||||
+ Tagged<Code> code,
|
||||
Address target);
|
||||
|
||||
// Get the size of the special target encoded at 'instruction_payload'.
|
||||
diff --git a/src/execution/riscv/simulator-riscv.cc b/src/execution/riscv/simulator-riscv.cc
|
||||
index 1baf9eb6c66..5b5411cb3e2 100644
|
||||
--- a/deps/v8/src/execution/riscv/simulator-riscv.cc
|
||||
+++ b/deps/v8/src/execution/riscv/simulator-riscv.cc
|
||||
@@ -1889,7 +1889,7 @@ void RiscvDebugger::Debug() {
|
||||
sreg_t value;
|
||||
StdoutStream os;
|
||||
if (GetValue(arg1, &value)) {
|
||||
- Object obj(value);
|
||||
+ Tagged<Object> obj(value);
|
||||
os << arg1 << ": \n";
|
||||
#ifdef DEBUG
|
||||
Print(obj, os);
|
||||
@@ -1938,7 +1938,7 @@ void RiscvDebugger::Debug() {
|
||||
PrintF(" 0x%012" PRIxPTR " : 0x%016" REGIx_FORMAT
|
||||
" %14" REGId_FORMAT " ",
|
||||
reinterpret_cast<intptr_t>(cur), *cur, *cur);
|
||||
- Object obj(*cur);
|
||||
+ Tagged<Object> obj(*cur);
|
||||
Heap* current_heap = sim_->isolate_->heap();
|
||||
if (IsSmi(obj) ||
|
||||
IsValidHeapObject(current_heap, HeapObject::cast(obj))) {
|
||||
@@ -4815,7 +4815,7 @@ bool Simulator::DecodeRvvVS() {
|
||||
Builtin Simulator::LookUp(Address pc) {
|
||||
for (Builtin builtin = Builtins::kFirst; builtin <= Builtins::kLast;
|
||||
++builtin) {
|
||||
- if (builtins_.code(builtin).contains(isolate_, pc)) return builtin;
|
||||
+ if (builtins_.code(builtin)->contains(isolate_, pc)) return builtin;
|
||||
}
|
||||
return Builtin::kNoBuiltinId;
|
||||
}
|
||||
@@ -4832,7 +4832,7 @@ void Simulator::DecodeRVIType() {
|
||||
if (builtin != Builtin::kNoBuiltinId) {
|
||||
auto code = builtins_.code(builtin);
|
||||
if ((rs1_reg() != ra || imm12() != 0)) {
|
||||
- if ((Address)get_pc() == code.instruction_start()) {
|
||||
+ if ((Address)get_pc() == code->instruction_start()) {
|
||||
sreg_t arg0 = get_register(a0);
|
||||
sreg_t arg1 = get_register(a1);
|
||||
sreg_t arg2 = get_register(a2);
|
||||
diff --git a/src/regexp/riscv/regexp-macro-assembler-riscv.cc b/src/regexp/riscv/regexp-macro-assembler-riscv.cc
|
||||
index 3b57e613eef..f60f03e5eee 100644
|
||||
--- a/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc
|
||||
+++ b/deps/v8/src/regexp/riscv/regexp-macro-assembler-riscv.cc
|
||||
@@ -1216,7 +1216,7 @@ static T* frame_entry_address(Address re_frame, int frame_offset) {
|
||||
int64_t RegExpMacroAssemblerRISCV::CheckStackGuardState(Address* return_address,
|
||||
Address raw_code,
|
||||
Address re_frame) {
|
||||
- InstructionStream re_code = InstructionStream::cast(Object(raw_code));
|
||||
+ Tagged<InstructionStream> re_code = InstructionStream::cast(Object(raw_code));
|
||||
return NativeRegExpMacroAssembler::CheckStackGuardState(
|
||||
frame_entry<Isolate*>(re_frame, kIsolateOffset),
|
||||
static_cast<int>(frame_entry<int64_t>(re_frame, kStartIndexOffset)),
|
12
patches/nodejs-chimera/shared-uv.patch
Normal file
12
patches/nodejs-chimera/shared-uv.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/deps/uvwasi/uvwasi.gyp
|
||||
+++ b/deps/uvwasi/uvwasi.gyp
|
||||
@@ -33,6 +33,9 @@
|
||||
'../uv/uv.gyp:libuv',
|
||||
],
|
||||
}],
|
||||
+ [ 'node_shared_libuv=="true"', {
|
||||
+ 'libraries': [ '-luv' ],
|
||||
+ }]
|
||||
],
|
||||
}
|
||||
]
|
Reference in New Issue
Block a user