Skip to content

Commit

Permalink
nodejs: Bump to 16.11.0 (termux#7710)
Browse files Browse the repository at this point in the history
Other changes done:

- Removed `no-android-log.patch` since Node.js uses GYP and not GN to
  build itself. This patch must be having no effect at all
- Added patch to force `V8_TRAP_HANDLER_SUPPORTED` to always false which
  fixes builds for x86_64 which started reproducing even on aarch64
- Removed `x86_64` as blacklisted arch
  • Loading branch information
thunder-coding authored and Yan committed Nov 28, 2021
1 parent ad95697 commit 8a0034b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
16 changes: 2 additions & 14 deletions packages/nodejs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://nodejs.org/
TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environment"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Yaksh Bariya <yakshbari4@gmail.com>"
TERMUX_PKG_VERSION=16.10.0
TERMUX_PKG_VERSION=16.11.0
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=97dc1aca232b4911e0b9e5a23a03200ab8ef05157e03c732315b579481bf7912
TERMUX_PKG_SHA256=d3f631bd0d215ded26b49b2eae42c84de2ba1b46f00cc2930809900a0f7165ae
# Note that we do not use a shared libuv to avoid an issue with the Android
# linker, which does not use symbols of linked shared libraries when resolving
# symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.
Expand All @@ -16,18 +16,6 @@ TERMUX_PKG_SUGGESTS="clang, make, pkg-config, python"
TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_HOSTBUILD=true
# Build fails on x86_64 with:
# g++ -rdynamic -m64 -pthread -m64 -fPIC -o /home/builder/.termux-build/nodejs/src/out/Release/mksnapshot ...
# /usr/bin/ld: /home/builder/.termux-build/nodejs/src/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/api/api.o:
# in function `v8::TryHandleWebAssemblyTrapPosix(int, siginfo_t*, void*)':
# api.cc:(.text._ZN2v829TryHandleWebAssemblyTrapPosixEiP9siginfo_tPv+0x5):
# undefined reference to `v8::internal::trap_handler::TryHandleSignal(int, siginfo_t*, void*)'
# /usr/bin/ld: /home/builder/.termux-build/nodejs/src/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/trap-handler/handler-outside.o:
# in function `v8::internal::trap_handler::EnableTrapHandler(bool)':
# handler-outside.cc:(.text._ZN2v88internal12trap_handler17EnableTrapHandlerEb+0x25):
# undefined reference to `v8::internal::trap_handler::RegisterDefaultTrapHandler()'
# collect2: error: ld returned 1 exit status
TERMUX_PKG_BLACKLISTED_ARCHES="x86_64"

termux_step_post_get_source() {
# Prevent caching of host build:
Expand Down
25 changes: 25 additions & 0 deletions packages/nodejs/deps-v8-src-trap-handler-trap-handler.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- ./deps/v8/src/trap-handler/trap-handler.h 2021-10-08 19:08:46.000000000 +0530
+++ ./deps/v8/src/trap-handler/trap-handler.h.mod 2021-10-09 19:43:08.715641214 +0530
@@ -17,22 +17,7 @@
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)
-#define V8_TRAP_HANDLER_SUPPORTED true
-// Arm64 (non-simulator) on Mac.
-#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-#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
-#define V8_TRAP_HANDLER_SUPPORTED true
-// Everything else is unsupported.
-#else
#define V8_TRAP_HANDLER_SUPPORTED false
-#endif

// Setup for shared library export.
#if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN)
11 changes: 0 additions & 11 deletions packages/nodejs/no-android-log.patch

This file was deleted.

0 comments on commit 8a0034b

Please sign in to comment.