From d45656ca5bdcd7e6cdfe8bd1dce681d919916557 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Thu, 22 Dec 2022 10:43:50 +0100 Subject: [PATCH 1/2] nodejs: update to 18.16.0. --- ...s-v8-src-trap-handler-trap-handler.h.patch | 31 ------------ srcpkgs/nodejs/patches/cross-aarch64.patch | 48 ++++++++++++------- srcpkgs/nodejs/template | 8 ++-- 3 files changed, 35 insertions(+), 52 deletions(-) delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch deleted file mode 100644 index 56529af9722300..00000000000000 --- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch +++ /dev/null @@ -1,31 +0,0 @@ -https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch - ---- a/deps/v8/src/trap-handler/trap-handler.h -+++ b/deps/v8/src/trap-handler/trap-handler.h -@@ -17,19 +17,16 @@ namespace v8 { - namespace internal { - namespace trap_handler { - --// X64 on Linux, Windows, MacOS, FreeBSD. --#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \ -- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \ -- V8_OS_FREEBSD) -+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID - #define V8_TRAP_HANDLER_SUPPORTED true --// Arm64 (non-simulator) on Mac. --#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX -+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN - #define V8_TRAP_HANDLER_SUPPORTED true --// Arm64 simulator on x64 on Linux or Mac. --#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX) --#define V8_TRAP_HANDLER_VIA_SIMULATOR -+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX -+#define V8_TRAP_HANDLER_SUPPORTED true -+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD -+#define V8_TRAP_HANDLER_SUPPORTED true -+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX - #define V8_TRAP_HANDLER_SUPPORTED true --// Everything else is unsupported. - #else - #define V8_TRAP_HANDLER_SUPPORTED false - #endif diff --git a/srcpkgs/nodejs/patches/cross-aarch64.patch b/srcpkgs/nodejs/patches/cross-aarch64.patch index 3b96c87f2fdb06..fa05cb15813e89 100644 --- a/srcpkgs/nodejs/patches/cross-aarch64.patch +++ b/srcpkgs/nodejs/patches/cross-aarch64.patch @@ -1,29 +1,43 @@ -From 4ac90c41065d338c4305cf6dc39e3084b21a7f79 Mon Sep 17 00:00:00 2001 -From: Michal Vasilek -Date: Sun, 20 Nov 2022 19:22:03 +0100 -Subject: [PATCH] Revert "build: enable pointer authentication for branch - protection on arm64" +From 6bdf9dc3ec7dbff00acef081f4e3dd3e061fd744 Mon Sep 17 00:00:00 2001 +From: Ben Noordhuis +Date: Tue, 6 Dec 2022 11:27:49 +0100 +Subject: [PATCH] build: fix arm64 cross-compilation -This reverts commit 938212f3e74a74d0b436941aa24e71425ff666c5. +Commit 938212f added -msign-return-address=all to _all_ cflags but that +is wrong when cross-compiling, it should only be added to the target's +cflags. + +Fixes: https://github.com/nodejs/node/issues/42888 --- - configure.py | 4 ---- - 1 file changed, 4 deletions(-) + configure.py | 2 -- + node.gyp | 3 +++ + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py -index d3192ca04c..2d049eb938 100755 +index 40e0395e..9de3148f 100755 --- a/configure.py +++ b/configure.py -@@ -1241,10 +1241,6 @@ def configure_node(o): +@@ -1294,9 +1294,7 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) - # Enable branch protection for arm64 -- if target_arch == 'arm64': + if target_arch == 'arm64': - o['cflags']+=['-msign-return-address=all'] -- + o['variables']['arm_fpu'] = options.arm_fpu or 'neon' + if options.node_snapshot_main is not None: - if options.shared: - # This should be possible to fix, but we will need to refactor the --- -2.38.1 - +diff --git a/node.gyp b/node.gyp +index cf52281b..5218d941 100644 +--- a/node.gyp ++++ b/node.gyp +@@ -112,6 +112,9 @@ + }, + + 'conditions': [ ++ ['target_arch=="arm64"', { ++ 'cflags': ['-msign-return-address=all'], # Pointer authentication. ++ }], + ['OS in "aix os400"', { + 'ldflags': [ + '-Wl,-bnoerrmsg', diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template index a53792a6544fd4..46364d382448d5 100644 --- a/srcpkgs/nodejs/template +++ b/srcpkgs/nodejs/template @@ -1,7 +1,7 @@ # Template file for 'nodejs' pkgname=nodejs -version=16.19.0 -revision=2 +version=18.16.0 +revision=1 # Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079 hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel $(vopt_if icu icu-devel) $(vopt_if ssl openssl-devel) $(vopt_if libuv libuv-devel) @@ -15,7 +15,7 @@ maintainer="Enno Boland " license="MIT" homepage="https://nodejs.org/" distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz" -checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d +checksum=6a4f5c5d76e5c50cef673099e56f19bc3266ae363f56ca0ab77dd2f3c5088c6d python_version=3 build_options="ssl libuv icu nghttp2 cares" @@ -41,7 +41,7 @@ fi case "$XBPS_TARGET_MACHINE" in ppc64*) ;; - ppc*) broken="Node 16.x does not support 32-bit ppc" ;; + ppc*) broken="Node 18.x does not support 32-bit ppc" ;; esac CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" From 18991356611d25c9f9fa0c2ff32d38263648e8c9 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Fri, 2 Jun 2023 21:44:36 +0200 Subject: [PATCH 2/2] Signal-Desktop: remove nodejs 16 workaround --- srcpkgs/Signal-Desktop/template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srcpkgs/Signal-Desktop/template b/srcpkgs/Signal-Desktop/template index 4c672205598793..ed9d4b94851e47 100644 --- a/srcpkgs/Signal-Desktop/template +++ b/srcpkgs/Signal-Desktop/template @@ -21,8 +21,7 @@ post_extract() { # git-lfs hook needs to be installed for one of the dependencies git lfs install - #vsed 's/"node": "/&>=/' -i package.json - vsed 's/"node": "18.14.0"/"node": ">=16.19.0"/' -i package.json + vsed 's/"node": "/&>=/' -i package.json # Dependencies have to be installed before applying patch yarn install --ignore-engines --frozen-lockfile