Nodejs: Upgrade to 18.12.1

Node-18 is the current LTS release, node-19 is a development release and
node-20 is scheduled to be released until 2023-04-18 which is too late for YP-4.2
https://github.com/nodejs/release

* Refresh below two patches
   - 0001-Using-native-binaries.patch
   - 0001-liftoff-Correct-function-signatures.patch

* Copy openssl.cnf from sysroot_native to nodejs-openssl.cnf
  otherwise do_compile failed:
     make[1]: *** No rule to make target '../deps/openssl/nodejs-openssl.cnf',
     needed by 'Release/obj.target/deps/openssl/openssl.cnf'.  Stop.

* Add initial ptest support using ctest only, it covered 20% of the nodejs tests.
  There are some more tests exist to add but will require additional work.

Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Archana Polampalli
2023-01-24 15:52:39 +00:00
committed by Khem Raj
parent c3e6365aea
commit 75a836190a
5 changed files with 43 additions and 30 deletions
@@ -5,32 +5,24 @@ Subject: [PATCH] Using native binaries
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
--- ---
node.gyp | 2 ++ node.gyp | 1 +
tools/v8_gypfiles/v8.gyp | 5 +++++ tools/v8_gypfiles/v8.gyp | 5 +++++
2 files changed, 7 insertions(+) 2 files changed, 6 insertions(+)
diff --git a/node.gyp b/node.gyp diff --git a/node.gyp b/node.gyp
index 24505da7ba..7d41bd52db 100644 index e8e1d9f9..e60ccc10 100644
--- a/node.gyp --- a/node.gyp
+++ b/node.gyp +++ b/node.gyp
@@ -319,6 +319,7 @@ @@ -320,6 +320,7 @@
'action_name': 'run_mkcodecache',
'process_outputs_as_sources': 1,
'inputs': [
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
'<(mkcodecache_exec)',
],
'outputs': [
@@ -366,6 +367,7 @@
'action_name': 'node_mksnapshot', 'action_name': 'node_mksnapshot',
'process_outputs_as_sources': 1, 'process_outputs_as_sources': 1,
'inputs': [ 'inputs': [
+ '<(PRODUCT_DIR)/v8-qemu-wrapper.sh', + '<(PRODUCT_DIR)/v8-qemu-wrapper.sh',
'<(node_mksnapshot_exec)', '<(node_mksnapshot_exec)',
'<(node_snapshot_main)',
], ],
'outputs': [
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index ed042f8829..371b8e02c2 100644 index 42e26cd9..bc721991 100644
--- a/tools/v8_gypfiles/v8.gyp --- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp
@@ -68,6 +68,7 @@ @@ -68,6 +68,7 @@
@@ -57,7 +49,7 @@ index ed042f8829..371b8e02c2 100644
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
], ],
'outputs': [ 'outputs': [
@@ -395,6 +398,7 @@ @@ -400,6 +403,7 @@
], ],
}, },
'inputs': [ 'inputs': [
@@ -65,7 +57,7 @@ index ed042f8829..371b8e02c2 100644
'<(mksnapshot_exec)', '<(mksnapshot_exec)',
], ],
'outputs': [ 'outputs': [
@@ -1513,6 +1517,7 @@ @@ -1539,6 +1543,7 @@
{ {
'action_name': 'run_gen-regexp-special-case_action', 'action_name': 'run_gen-regexp-special-case_action',
'inputs': [ 'inputs': [
@@ -9,14 +9,20 @@ Fixes builds on mips where clang reports an error
^~~~ ^~~~
Upstream-Status: Submitted [https://chromium-review.googlesource.com/c/v8/v8/+/3235674] Upstream-Status: Submitted [https://chromium-review.googlesource.com/c/v8/v8/+/3235674]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/wasm/baseline/liftoff-assembler.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
---
deps/v8/src/wasm/baseline/liftoff-assembler.h | 6 +++---
deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h | 2 +-
deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h | 2 +-
.../src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/deps/v8/src/wasm/baseline/liftoff-assembler.h b/deps/v8/src/wasm/baseline/liftoff-assembler.h
index 22c7f73a..db4cb168 100644
--- a/deps/v8/src/wasm/baseline/liftoff-assembler.h --- a/deps/v8/src/wasm/baseline/liftoff-assembler.h
+++ b/deps/v8/src/wasm/baseline/liftoff-assembler.h +++ b/deps/v8/src/wasm/baseline/liftoff-assembler.h
@@ -613,7 +613,7 @@ class LiftoffAssembler : public TurboAss @@ -646,7 +646,7 @@ class LiftoffAssembler : public TurboAssembler {
void FinishCall(const ValueKindSig*, compiler::CallDescriptor*); void FinishCall(const ValueKindSig*, compiler::CallDescriptor*);
// Move {src} into {dst}. {src} and {dst} must be different. // Move {src} into {dst}. {src} and {dst} must be different.
@@ -25,7 +31,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
// Parallel register move: For a list of tuples <dst, src, kind>, move the // Parallel register move: For a list of tuples <dst, src, kind>, move the
// {src} register of kind {kind} into {dst}. If {src} equals {dst}, ignore // {src} register of kind {kind} into {dst}. If {src} equals {dst}, ignore
@@ -759,8 +759,8 @@ class LiftoffAssembler : public TurboAss @@ -795,8 +795,8 @@ class LiftoffAssembler : public TurboAssembler {
inline void MoveStackValue(uint32_t dst_offset, uint32_t src_offset, inline void MoveStackValue(uint32_t dst_offset, uint32_t src_offset,
ValueKind); ValueKind);
@@ -36,10 +42,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
inline void Spill(int offset, LiftoffRegister, ValueKind); inline void Spill(int offset, LiftoffRegister, ValueKind);
inline void Spill(int offset, WasmValue); inline void Spill(int offset, WasmValue);
diff --git a/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h b/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
index c76fd2f4..0fffe231 100644
--- a/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h --- a/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
+++ b/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h +++ b/deps/v8/src/wasm/baseline/mips/liftoff-assembler-mips.h
@@ -658,7 +658,7 @@ void LiftoffAssembler::Store(Register ds @@ -661,7 +661,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
pinned = pinned | LiftoffRegList::ForRegs(dst_op.rm(), src); pinned = pinned | LiftoffRegList{dst_op.rm(), src};
LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned); LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
// Save original value. // Save original value.
- Move(tmp, src, type.value_type()); - Move(tmp, src, type.value_type());
@@ -47,9 +55,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
src = tmp; src = tmp;
pinned.set(tmp); pinned.set(tmp);
diff --git a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
index 36413545..48207337 100644
--- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h --- a/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
+++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h +++ b/deps/v8/src/wasm/baseline/mips64/liftoff-assembler-mips64.h
@@ -596,7 +596,7 @@ void LiftoffAssembler::Store(Register ds @@ -593,7 +593,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
pinned.set(dst_op.rm()); pinned.set(dst_op.rm());
LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned); LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
// Save original value. // Save original value.
@@ -58,9 +68,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
src = tmp; src = tmp;
pinned.set(tmp); pinned.set(tmp);
diff --git a/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h b/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
index 642a7d2a..56ffcc2a 100644
--- a/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h --- a/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
+++ b/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h +++ b/deps/v8/src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h
@@ -580,7 +580,7 @@ void LiftoffAssembler::Store(Register ds @@ -589,7 +589,7 @@ void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
pinned.set(dst_op.rm()); pinned.set(dst_op.rm());
LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned); LiftoffRegister tmp = GetUnusedRegister(src.reg_class(), pinned);
// Save original value. // Save original value.
@@ -69,3 +81,5 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
src = tmp; src = tmp;
pinned.set(tmp); pinned.set(tmp);
--
2.34.1
@@ -1,13 +1,13 @@
DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript" DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
HOMEPAGE = "http://nodejs.org" HOMEPAGE = "http://nodejs.org"
LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0" LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=6e54852cd826c41e80c6d80f6db00a85" LIC_FILES_CHKSUM = "file://LICENSE;md5=dfd7ae796baf5326016a3865ee1dc632"
DEPENDS = "openssl" DEPENDS = "openssl"
DEPENDS:append:class-target = " qemu-native" DEPENDS:append:class-target = " qemu-native"
DEPENDS:append:class-native = " c-ares-native" DEPENDS:append:class-native = " c-ares-native"
inherit pkgconfig python3native qemu inherit pkgconfig python3native qemu ptest
COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*" COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*"
COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*" COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*"
@@ -26,6 +26,7 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
file://0001-liftoff-Correct-function-signatures.patch \ file://0001-liftoff-Correct-function-signatures.patch \
file://0001-mips-Use-32bit-cast-for-operand-on-mips32.patch \ file://0001-mips-Use-32bit-cast-for-operand-on-mips32.patch \
" "
SRC_URI:append:class-target = " \ SRC_URI:append:class-target = " \
file://0001-Using-native-binaries.patch \ file://0001-Using-native-binaries.patch \
" "
@@ -35,7 +36,7 @@ SRC_URI:append:toolchain-clang:x86 = " \
SRC_URI:append:toolchain-clang:powerpc64le = " \ SRC_URI:append:toolchain-clang:powerpc64le = " \
file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \
" "
SRC_URI[sha256sum] = "1f8051a88f86f42064f4415fe7a980e59b0a502ecc8def583f6303bc4d445238" SRC_URI[sha256sum] = "4fa406451bc52659a290e52cfdb2162a760bd549da4b8bbebe6a29f296d938df"
S = "${WORKDIR}/node-v${PV}" S = "${WORKDIR}/node-v${PV}"
@@ -151,6 +152,7 @@ do_configure () {
do_compile () { do_compile () {
export LD="${CXX}" export LD="${CXX}"
install -D ${RECIPE_SYSROOT_NATIVE}/etc/ssl/openssl.cnf ${B}/deps/openssl/nodejs-openssl.cnf
install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh
oe_runmake BUILDTYPE=Release oe_runmake BUILDTYPE=Release
} }
@@ -159,10 +161,15 @@ do_install () {
oe_runmake install DESTDIR=${D} oe_runmake install DESTDIR=${D}
} }
do_install_ptest () {
cp -r ${B}/out/Release/cctest ${D}${PTEST_PATH}/
cp -r ${B}/test ${D}${PTEST_PATH}
chown -R root:root ${D}${PTEST_PATH}
}
BINARIES = " \ BINARIES = " \
bytecode_builtins_list_generator \ bytecode_builtins_list_generator \
${@bb.utils.contains('PACKAGECONFIG', 'icu', 'gen-regexp-special-case', '', d)} \ ${@bb.utils.contains('PACKAGECONFIG', 'icu', 'gen-regexp-special-case', '', d)} \
mkcodecache \
node_mksnapshot \ node_mksnapshot \
torque \ torque \
" "