diff options
author | adam <adam@pkgsrc.org> | 2022-03-30 06:51:30 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2022-03-30 06:51:30 +0000 |
commit | 3d364da49bcdfddc3e70e75d42495ea4e315b5cd (patch) | |
tree | 284d1d5fdd24890fb7795aef3a47036690bdd9f5 | |
parent | a65236e7f21f33cdc94c565e2d393d6f3feb02f7 (diff) | |
download | pkgsrc-3d364da49bcdfddc3e70e75d42495ea4e315b5cd.tar.gz |
nodejs14: updated to 14.19.1 and moved to lang/nodejs14
Version 14.19.1 'Fermium' (LTS)
This is a security release.
Notable Changes
Update to OpenSSL 1.1.1n, which addresses the following vulnerability:
Infinite loop in BN_mod_sqrt() reachable when parsing certificates (High)(CVE-2022-0778) More details are available at https://www.openssl.org/news/secadv/20220315.txt
27 files changed, 639 insertions, 1 deletions
diff --git a/lang/Makefile b/lang/Makefile index 86a8a8538b2..78b5a3bb826 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.642 2022/03/17 07:10:08 wiz Exp $ +# $NetBSD: Makefile,v 1.643 2022/03/30 06:51:30 adam Exp $ # COMMENT= Programming languages @@ -177,6 +177,7 @@ SUBDIR+= njs SUBDIR+= nodejs SUBDIR+= nodejs10 SUBDIR+= nodejs12 +SUBDIR+= nodejs14 SUBDIR+= npm SUBDIR+= nqp SUBDIR+= nuitka diff --git a/lang/nodejs14/DESCR b/lang/nodejs14/DESCR new file mode 100644 index 00000000000..ac75c681c17 --- /dev/null +++ b/lang/nodejs14/DESCR @@ -0,0 +1,4 @@ +Node.js is an evented I/O framework for the V8 JavaScript engine. It is +intended for writing scalable network programs such as web servers. + +This package holds the 14.x LTS release. diff --git a/lang/nodejs14/Makefile b/lang/nodejs14/Makefile new file mode 100644 index 00000000000..6a4b06e9cb7 --- /dev/null +++ b/lang/nodejs14/Makefile @@ -0,0 +1,43 @@ +# $NetBSD: Makefile,v 1.1 2022/03/30 06:51:30 adam Exp $ + +DISTNAME= node-v14.19.1 +EXTRACT_SUFX= .tar.xz + +USE_LANGUAGES= c gnu++14 + +.include "../../mk/bsd.prefs.mk" + +# XXX: figure out a way to add rpaths to torque +MAKE_ENV+= LD_LIBRARY_PATH=${PREFIX}/lib + +CONFIGURE_ARGS+= --shared-brotli +CONFIGURE_ARGS+= --shared-nghttp2 +CONFIGURE_ARGS+= --with-intl=system-icu +CONFIGURE_ARGS+= --without-corepack + +PYTHON_VERSIONS_ACCEPTED= 27 + +CHECK_PORTABILITY_SKIP+= tools/macos-installer/pkgbuild/npm/scripts/preinstall + +.if ${MACHINE_ARCH} == "i386" +# required for SSE2 code under i386. +CXXFLAGS+= -mstackrealign +.endif + +.include "../../lang/nodejs/options.mk" + +# Node turns on -latomic for arm, mips and ppc. +.if !empty(MACHINE_ARCH:M*arm*) || \ + !empty(MACHINE_ARCH:M*powerpc*) || \ + !empty(MACHINE_ARCH:M*mips*) +.include "../../devel/libatomic/buildlink3.mk" +.endif + +.include "../../lang/nodejs/Makefile.common" +.include "../../archivers/brotli/buildlink3.mk" +.include "../../textproc/icu/buildlink3.mk" +# Requires nghttp2_option_set_max_settings +BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0 +.include "../../www/nghttp2/buildlink3.mk" +.include "../../mk/atomic64.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/lang/nodejs14/PLIST b/lang/nodejs14/PLIST new file mode 100644 index 00000000000..f6a6fe679c2 --- /dev/null +++ b/lang/nodejs14/PLIST @@ -0,0 +1,56 @@ +@comment $NetBSD: PLIST,v 1.1 2022/03/30 06:51:30 adam Exp $ +bin/node +include/node/common.gypi +include/node/config.gypi +include/node/cppgc/allocation.h +include/node/cppgc/common.h +include/node/cppgc/custom-space.h +include/node/cppgc/garbage-collected.h +include/node/cppgc/heap.h +include/node/cppgc/internal/accessors.h +include/node/cppgc/internal/api-constants.h +include/node/cppgc/internal/compiler-specific.h +include/node/cppgc/internal/finalizer-trait.h +include/node/cppgc/internal/gc-info.h +include/node/cppgc/internal/logging.h +include/node/cppgc/internal/persistent-node.h +include/node/cppgc/internal/pointer-policies.h +include/node/cppgc/internal/prefinalizer-handler.h +include/node/cppgc/liveness-broker.h +include/node/cppgc/macros.h +include/node/cppgc/member.h +include/node/cppgc/persistent.h +include/node/cppgc/platform.h +include/node/cppgc/prefinalizer.h +include/node/cppgc/source-location.h +include/node/cppgc/trace-trait.h +include/node/cppgc/type-traits.h +include/node/cppgc/visitor.h +include/node/js_native_api.h +include/node/js_native_api_types.h +include/node/libplatform/libplatform-export.h +include/node/libplatform/libplatform.h +include/node/libplatform/v8-tracing.h +include/node/node.h +include/node/node_api.h +include/node/node_api_types.h +include/node/node_buffer.h +include/node/node_object_wrap.h +include/node/node_version.h +include/node/v8-fast-api-calls.h +include/node/v8-internal.h +include/node/v8-platform.h +include/node/v8-profiler.h +include/node/v8-util.h +include/node/v8-value-serializer-version.h +include/node/v8-version-string.h +include/node/v8-version.h +include/node/v8-wasm-trap-handler-posix.h +include/node/v8-wasm-trap-handler-win.h +include/node/v8.h +include/node/v8config.h +${PLIST.dtrace}lib/dtrace/node.d +man/man1/node.1 +share/doc/node/gdbinit +share/doc/node/lldb_commands.py +share/systemtap/tapset/node.stp diff --git a/lang/nodejs14/buildlink3.mk b/lang/nodejs14/buildlink3.mk new file mode 100644 index 00000000000..acaddd457cc --- /dev/null +++ b/lang/nodejs14/buildlink3.mk @@ -0,0 +1,36 @@ +# $NetBSD: buildlink3.mk,v 1.1 2022/03/30 06:51:30 adam Exp $ + +BUILDLINK_TREE+= nodejs + +.if !defined(NODEJS_BUILDLINK3_MK) +NODEJS_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.nodejs+= nodejs>=10 +BUILDLINK_ABI_DEPENDS.nodejs+= nodejs>=14.19.1 +BUILDLINK_PKGSRCDIR.nodejs?= ../../lang/nodejs14 + +.include "../../mk/bsd.fast.prefs.mk" + +.if ${OPSYS} != "Darwin" +.include "../../devel/libexecinfo/buildlink3.mk" +.endif +# Stated by the changelog +BUILDLINK_API_DEPENDS.libuv+= libuv>=1.23 +.include "../../devel/libuv/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../textproc/icu/buildlink3.mk" +# Requires nghttp2_option_set_max_settings +BUILDLINK_API_DEPENDS.nghttp2+= nghttp2>=1.41.0 +.include "../../www/nghttp2/buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" + +pkgbase := nodejs +.include "../../mk/pkg-build-options.mk" + +.if ${PKG_BUILD_OPTIONS.nodejs:Mopenssl} +. include "../../security/openssl/buildlink3.mk" +.endif + +.endif # NODEJS_BUILDLINK3_MK + +BUILDLINK_TREE+= -nodejs diff --git a/lang/nodejs14/distinfo b/lang/nodejs14/distinfo new file mode 100644 index 00000000000..6e077795235 --- /dev/null +++ b/lang/nodejs14/distinfo @@ -0,0 +1,26 @@ +$NetBSD: distinfo,v 1.1 2022/03/30 06:51:30 adam Exp $ + +BLAKE2s (node-v14.19.1.tar.xz) = b89311693d96a8514cf9dbba14754579e43e830480ea5be8e665e01c6490ec4f +SHA512 (node-v14.19.1.tar.xz) = d6c7f16589a0173a326a32e0bd4a8772357de0325a85b81bfd68e20239d7d1eac7eef93932d7044b1b3b9abf1da0f0bb4142786aba7b85f80474cc1924c900fa +Size (node-v14.19.1.tar.xz) = 34476256 bytes +SHA1 (patch-common.gypi) = f0bd2962bf7c8466db24b35a35154897ecad6316 +SHA1 (patch-deps_cares_cares.gyp) = 22b44f2ac59963f694dfe4f4585e08960b3dec32 +SHA1 (patch-deps_uv_common.gypi) = d38a9c8d9e3522f15812aec2f5b1e1e636d4bab3 +SHA1 (patch-deps_uvwasi_include_wasi__serdes.h) = 32b85ef5824b96b35aba9280bbe7aa7899d9e5cf +SHA1 (patch-deps_v8_src_base_atomicops.h) = 05b1f62850c3d4a9a8e94a5263be1c4267cf566d +SHA1 (patch-deps_v8_src_base_platform_platform-freebsd.cc) = b47025f33d2991275bbcd15dbabb28900afab0e1 +SHA1 (patch-deps_v8_src_base_platform_platform-openbsd.cc) = 5e593879dbab095f99e82593272a0de91043f9a8 +SHA1 (patch-deps_v8_src_base_platform_platform-posix.cc) = f99d9bee3ce452dda41c9b2943ee16cebcbd0af3 +SHA1 (patch-deps_v8_src_base_platform_semaphore.cc) = 802a95f1b1d131e0d85c1f99c659cc68b31ba2f6 +SHA1 (patch-deps_v8_src_codegen_arm_cpu-arm.cc) = 84c75d61bc99c2ff9adeac3152f5b11ebb0e582b +SHA1 (patch-deps_v8_src_common_globals.h) = 86637724864389f2b24251904de41669a2f00fbc +SHA1 (patch-deps_v8_src_compiler_types.h) = 2a212282ab9d71e98ae56827fdb1d9778a6047a5 +SHA1 (patch-deps_v8_src_zone_zone.h) = 651b49d242dac8f713cccc101147ccf61f828ecb +SHA1 (patch-deps_v8_tools_run-llprof.sh) = 39aa3faf77492ef8dd35b411b7b0e4605b469af3 +SHA1 (patch-node.gypi) = 4a104dba6c22702211009bc60a6be6f87554e2fa +SHA1 (patch-src_inspector__agent.cc) = 2ec2a7be459648700488096f467a4ae6af5a9d91 +SHA1 (patch-src_node__postmortem__metadata.cc) = 9938482d724ad6636af5dc3fa719ec26ed8539ff +SHA1 (patch-tools_gyp_pylib_gyp_generator_make.py) = 34d4f113d85b4502bc8240fac50dc37554ab4ebb +SHA1 (patch-tools_gyp_pylib_gyp_xcode__emulation.py) = 4ee24115f5e97ffbd23aaa6dc62f408d381d4e22 +SHA1 (patch-tools_install.py) = 943507123606b9016e35a94eb2e1941d141e0e09 +SHA1 (patch-tools_v8_gypfiles_v8.gyp) = 49cfd4fa8a8122c6f74965a2e87bbca6d0e44efc diff --git a/lang/nodejs14/patches/patch-common.gypi b/lang/nodejs14/patches/patch-common.gypi new file mode 100644 index 00000000000..a94febf7a3a --- /dev/null +++ b/lang/nodejs14/patches/patch-common.gypi @@ -0,0 +1,20 @@ +$NetBSD: patch-common.gypi,v 1.1 2022/03/30 06:51:30 adam Exp $ + +Add support for NetBSD. + +--- common.gypi.orig 2020-01-07 22:07:48.000000000 +0000 ++++ common.gypi +@@ -326,11 +326,11 @@ + 'BUILDING_UV_SHARED=1', + ], + }], +- [ 'OS in "linux freebsd openbsd solaris aix"', { ++ [ 'OS in "linux freebsd openbsd netbsd solaris aix"', { + 'cflags': [ '-pthread' ], + 'ldflags': [ '-pthread' ], + }], +- [ 'OS in "linux freebsd openbsd solaris android aix cloudabi"', { ++ [ 'OS in "linux freebsd openbsd netbsd netbsd solaris android aix cloudabi"', { + 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], + 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++1y' ], + 'defines': [ '__STDC_FORMAT_MACROS' ], diff --git a/lang/nodejs14/patches/patch-deps_cares_cares.gyp b/lang/nodejs14/patches/patch-deps_cares_cares.gyp new file mode 100644 index 00000000000..2be1b1b2e28 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_cares_cares.gyp @@ -0,0 +1,17 @@ +$NetBSD: patch-deps_cares_cares.gyp,v 1.1 2022/03/30 06:51:30 adam Exp $ + +Add support for NetBSD. + +--- deps/cares/cares.gyp.orig 2013-03-14 10:55:24.000000000 +0900 ++++ deps/cares/cares.gyp 2013-03-14 10:55:47.000000000 +0900 +@@ -140,6 +140,10 @@ + 'include_dirs': [ 'config/freebsd' ], + 'sources': [ 'config/freebsd/ares_config.h' ] + }], ++ [ 'OS=="netbsd"', { ++ 'include_dirs': [ 'config/netbsd' ], ++ 'sources': [ 'config/netbsd/ares_config.h' ] ++ }], + [ 'OS=="openbsd"', { + 'include_dirs': [ 'config/openbsd' ], + 'sources': [ 'config/openbsd/ares_config.h' ] diff --git a/lang/nodejs14/patches/patch-deps_uv_common.gypi b/lang/nodejs14/patches/patch-deps_uv_common.gypi new file mode 100644 index 00000000000..72277bbe7fb --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_uv_common.gypi @@ -0,0 +1,15 @@ +$NetBSD: patch-deps_uv_common.gypi,v 1.1 2022/03/30 06:51:30 adam Exp $ + +Add support for NetBSD. + +--- deps/uv/common.gypi.orig 2018-04-24 14:41:22.000000000 +0000 ++++ deps/uv/common.gypi +@@ -134,7 +134,7 @@ + }] + ] + }], +- ['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', { ++ ['OS in "freebsd dragonflybsd linux openbsd netbsd solaris android aix"', { + 'cflags': [ '-Wall' ], + 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], + 'target_conditions': [ diff --git a/lang/nodejs14/patches/patch-deps_uvwasi_include_wasi__serdes.h b/lang/nodejs14/patches/patch-deps_uvwasi_include_wasi__serdes.h new file mode 100644 index 00000000000..4f157896a32 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_uvwasi_include_wasi__serdes.h @@ -0,0 +1,21 @@ +$NetBSD: patch-deps_uvwasi_include_wasi__serdes.h,v 1.1 2022/03/30 06:51:30 adam Exp $ + +NetBSD<9 used to have #define uint8_t etc. which caused issues with complicated +defines like this one. + +--- deps/uvwasi/include/wasi_serdes.h.orig 2020-08-11 14:32:04.000000000 +0000 ++++ deps/uvwasi/include/wasi_serdes.h +@@ -3,6 +3,13 @@ + + #include "wasi_types.h" + ++#ifdef __NetBSD__ ++#undef uint8_t ++#undef uint16_t ++#undef uint32_t ++#undef uint64_t ++#endif ++ + /* Basic uint{8,16,32,64}_t read/write functions. */ + + #define BASIC_TYPE(name, type) \ diff --git a/lang/nodejs14/patches/patch-deps_v8_src_base_atomicops.h b/lang/nodejs14/patches/patch-deps_v8_src_base_atomicops.h new file mode 100644 index 00000000000..4bd89b06e25 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_base_atomicops.h @@ -0,0 +1,18 @@ +$NetBSD: patch-deps_v8_src_base_atomicops.h,v 1.1 2022/03/30 06:51:30 adam Exp $ + +--- deps/v8/src/base/atomicops.h.orig 2020-07-03 17:37:00.000000000 +0000 ++++ deps/v8/src/base/atomicops.h +@@ -52,9 +52,13 @@ using Atomic64 = intptr_t; + #endif // defined(__ILP32__) + #endif // defined(V8_HOST_ARCH_64_BIT) + ++#if defined(__NetBSD__) && defined(__arm__) ++using AtomicWord = int32_t; ++#else + // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or + // Atomic64 routines below, depending on your architecture. + using AtomicWord = intptr_t; ++#endif + + // Atomically execute: + // result = *ptr; diff --git a/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-freebsd.cc b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-freebsd.cc new file mode 100644 index 00000000000..be50e9fa844 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-freebsd.cc @@ -0,0 +1,33 @@ +$NetBSD: patch-deps_v8_src_base_platform_platform-freebsd.cc,v 1.1 2022/03/30 06:51:30 adam Exp $ + +Overlapping variables, taken from https://github.com/joyent/node/issues/9175 + +--- deps/v8/src/base/platform/platform-freebsd.cc.orig 2020-01-07 22:07:49.000000000 +0000 ++++ deps/v8/src/base/platform/platform-freebsd.cc +@@ -47,7 +47,7 @@ static unsigned StringToLong(char* buffe + } + + std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() { +- std::vector<SharedLibraryAddress> result; ++ std::vector<SharedLibraryAddress> address_result; + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()}; + size_t miblen = sizeof(mib) / sizeof(mib[0]); + size_t buffer_size; +@@ -80,7 +80,7 @@ std::vector<OS::SharedLibraryAddress> OS + } else { + lib_name = std::string(path); + } +- result.push_back(SharedLibraryAddress( ++ address_result.push_back(SharedLibraryAddress( + lib_name, reinterpret_cast<uintptr_t>(map->kve_start), + reinterpret_cast<uintptr_t>(map->kve_end))); + } +@@ -89,7 +89,7 @@ std::vector<OS::SharedLibraryAddress> OS + } + } + } +- return result; ++ return address_result; + } + + void OS::SignalCodeMovingGC() {} diff --git a/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc new file mode 100644 index 00000000000..e79fec8c368 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc @@ -0,0 +1,55 @@ +$NetBSD: patch-deps_v8_src_base_platform_platform-openbsd.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Add support for NetBSD/arm. + +--- deps/v8/src/base/platform/platform-openbsd.cc.orig 2017-09-26 21:14:30.000000000 +0000 ++++ deps/v8/src/base/platform/platform-openbsd.cc +@@ -34,6 +34,48 @@ + namespace v8 { + namespace base { + ++#ifdef __arm__ ++ ++bool OS::ArmUsingHardFloat() { ++ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify ++ // the Floating Point ABI used (PCS stands for Procedure Call Standard). ++ // We use these as well as a couple of other defines to statically determine ++ // what FP ABI used. ++ // GCC versions 4.4 and below don't support hard-fp. ++ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or ++ // __ARM_PCS_VFP. ++ ++#define GCC_VERSION (__GNUC__ * 10000 \ ++ + __GNUC_MINOR__ * 100 \ ++ + __GNUC_PATCHLEVEL__) ++#if GCC_VERSION >= 40600 ++#if defined(__ARM_PCS_VFP) ++ return true; ++#else ++ return false; ++#endif ++ ++#elif GCC_VERSION < 40500 ++ return false; ++ ++#else ++#if defined(__ARM_PCS_VFP) ++ return true; ++#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ ++ !defined(__VFP_FP__) ++ return false; ++#else ++#error "Your version of GCC does not report the FP ABI compiled for." \ ++ "Please report it on this issue" \ ++ "http://code.google.com/p/v8/issues/detail?id=2140" ++ ++#endif ++#endif ++#undef GCC_VERSION ++} ++ ++#endif // def __arm__ ++ + TimezoneCache* OS::CreateTimezoneCache() { + return new PosixDefaultTimezoneCache(); + } diff --git a/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-posix.cc b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-posix.cc new file mode 100644 index 00000000000..67f903e563f --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_platform-posix.cc @@ -0,0 +1,53 @@ +$NetBSD: patch-deps_v8_src_base_platform_platform-posix.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Use sysconf(_SC_THREAD_STACK_MIN) instead of PTHREAD_STACK_MIN. +Cast explicitly. + +Avoid using a random hint, some low numbers cause spurious ENOMEM on netbsd +(PR port-arm/55533) + +--- deps/v8/src/base/platform/platform-posix.cc.orig 2021-04-07 04:42:14.000000000 +0900 ++++ deps/v8/src/base/platform/platform-posix.cc 2021-04-24 07:39:15.080548801 +0900 +@@ -323,6 +323,10 @@ void* OS::GetRandomMmapAddr() { + #endif + #endif + #endif ++ ++#if V8_OS_NETBSD && V8_TARGET_ARCH_ARM64 ++ raw_addr = 0; ++#endif + return reinterpret_cast<void*>(raw_addr); + } + +@@ -564,6 +568,8 @@ int OS::GetCurrentThreadId() { + return static_cast<int>(syscall(__NR_gettid)); + #elif V8_OS_ANDROID + return static_cast<int>(gettid()); ++#elif V8_OS_NETBSD || V8_OS_FREEBSD ++ return static_cast<int>(reinterpret_cast<intptr_t>(pthread_self())); + #elif V8_OS_AIX + return static_cast<int>(thread_self()); + #elif V8_OS_FUCHSIA +@@ -756,8 +762,13 @@ Thread::Thread(const Options& options) + : data_(new PlatformData), + stack_size_(options.stack_size()), + start_semaphore_(nullptr) { ++#if V8_OS_NETBSD ++ if (stack_size_ > 0 && static_cast<size_t>(stack_size_) < sysconf(_SC_THREAD_STACK_MIN)) { ++ stack_size_ = sysconf(_SC_THREAD_STACK_MIN); ++#else + if (stack_size_ > 0 && static_cast<size_t>(stack_size_) < PTHREAD_STACK_MIN) { + stack_size_ = PTHREAD_STACK_MIN; ++#endif + } + set_name(options.name()); + } +@@ -773,7 +784,7 @@ static void SetThreadName(const char* na + pthread_set_name_np(pthread_self(), name); + #elif V8_OS_NETBSD + STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP); +- pthread_setname_np(pthread_self(), "%s", name); ++ pthread_setname_np(pthread_self(), "%s", (void *)name); + #elif V8_OS_MACOSX + // pthread_setname_np is only available in 10.6 or later, so test + // for it at runtime. diff --git a/lang/nodejs14/patches/patch-deps_v8_src_base_platform_semaphore.cc b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_semaphore.cc new file mode 100644 index 00000000000..31c829d2193 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_base_platform_semaphore.cc @@ -0,0 +1,18 @@ +$NetBSD: patch-deps_v8_src_base_platform_semaphore.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Work around lack of sem_timedwait(3) in NetBSD < 6.99.4. +Adapted from d4f11c0cf476dd854eaebec1cbacb1afc7bea18e of the Chromium V8 sources. + +--- deps/v8/src/base/platform/semaphore.cc.orig 2016-10-25 13:26:03.000000000 +0000 ++++ deps/v8/src/base/platform/semaphore.cc +@@ -11,6 +11,10 @@ + + #include <errno.h> + ++#if V8_OS_NETBSD ++#include <sys/param.h> // for __NetBSD_Version__ ++#endif ++ + #include "src/base/logging.h" + #include "src/base/platform/elapsed-timer.h" + #include "src/base/platform/time.h" diff --git a/lang/nodejs14/patches/patch-deps_v8_src_codegen_arm_cpu-arm.cc b/lang/nodejs14/patches/patch-deps_v8_src_codegen_arm_cpu-arm.cc new file mode 100644 index 00000000000..83f82c635bf --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_codegen_arm_cpu-arm.cc @@ -0,0 +1,26 @@ +$NetBSD: patch-deps_v8_src_codegen_arm_cpu-arm.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +port to NetBSD/arm. + +--- deps/v8/src/codegen/arm/cpu-arm.cc.orig 2020-10-07 10:47:41.000000000 -0700 ++++ deps/v8/src/codegen/arm/cpu-arm.cc 2020-10-17 00:16:51.732785305 -0700 +@@ -19,6 +19,10 @@ + + #include "src/codegen/cpu-features.h" + ++#if V8_OS_NETBSD ++#include <machine/sysarch.h> ++#endif ++ + namespace v8 { + namespace internal { + +@@ -32,6 +36,8 @@ + struct arm_sync_icache_args args = { + .addr = reinterpret_cast<uintptr_t>(start), .len = size}; + sysarch(ARM_SYNC_ICACHE, reinterpret_cast<void*>(&args)); ++#elif V8_OS_NETBSD ++ arm_sync_icache(reinterpret_cast<uintptr_t>(start), size); + #else + register uint32_t beg asm("r0") = reinterpret_cast<uint32_t>(start); + register uint32_t end asm("r1") = beg + size; diff --git a/lang/nodejs14/patches/patch-deps_v8_src_common_globals.h b/lang/nodejs14/patches/patch-deps_v8_src_common_globals.h new file mode 100644 index 00000000000..7f1c0a22113 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_common_globals.h @@ -0,0 +1,14 @@ +$NetBSD: patch-deps_v8_src_common_globals.h,v 1.1 2022/03/30 06:51:31 adam Exp $ + +stdarg.h is needed for va_list on at least NetBSD. + +--- deps/v8/src/common/globals.h.orig 2019-11-19 08:29:07.000000000 +0000 ++++ deps/v8/src/common/globals.h +@@ -7,6 +7,7 @@ + + #include <stddef.h> + #include <stdint.h> ++#include <stdarg.h> + + #include <limits> + #include <ostream> diff --git a/lang/nodejs14/patches/patch-deps_v8_src_compiler_types.h b/lang/nodejs14/patches/patch-deps_v8_src_compiler_types.h new file mode 100644 index 00000000000..4f45cc8de02 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_compiler_types.h @@ -0,0 +1,21 @@ +$NetBSD: patch-deps_v8_src_compiler_types.h,v 1.1 2022/03/30 06:51:31 adam Exp $ + +NetBSD 6 doesn't have nearbyint/nearbyintf. + +--- deps/v8/src/compiler/types.h.orig 2019-11-19 08:29:07.000000000 +0000 ++++ deps/v8/src/compiler/types.h +@@ -5,6 +5,14 @@ + #ifndef V8_COMPILER_TYPES_H_ + #define V8_COMPILER_TYPES_H_ + ++#ifdef __NetBSD__ ++#include <sys/param.h> ++#if __NetBSD_Version__ - 0 < 699001700 ++#define nearbyint rint ++#define nearbyintf rintf ++#endif ++#endif ++ + #include "src/base/compiler-specific.h" + #include "src/common/globals.h" + #include "src/compiler/heap-refs.h" diff --git a/lang/nodejs14/patches/patch-deps_v8_src_zone_zone.h b/lang/nodejs14/patches/patch-deps_v8_src_zone_zone.h new file mode 100644 index 00000000000..1747c71f441 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_src_zone_zone.h @@ -0,0 +1,18 @@ +$NetBSD: patch-deps_v8_src_zone_zone.h,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Work around type issue in NetBSD's copy of libc++ headers. +Believed to be fixed in upstream libc++ already. +https://github.com/nodejs/node/issues/30638 + +--- deps/v8/src/zone/zone.h.orig 2019-12-18 17:26:45.000000000 +0000 ++++ deps/v8/src/zone/zone.h +@@ -141,6 +141,9 @@ class ZoneObject { + public: + // Allocate a new ZoneObject of 'size' bytes in the Zone. + void* operator new(size_t size, Zone* zone) { return zone->New(size); } ++#if defined(__NetBSD__) && defined(__clang__) ++ void* operator new(size_t size, void* zone) { return ((Zone*)zone)->New(size); } ++#endif + + // Ideally, the delete operator should be private instead of + // public, but unfortunately the compiler sometimes synthesizes diff --git a/lang/nodejs14/patches/patch-deps_v8_tools_run-llprof.sh b/lang/nodejs14/patches/patch-deps_v8_tools_run-llprof.sh new file mode 100644 index 00000000000..f0d387a6906 --- /dev/null +++ b/lang/nodejs14/patches/patch-deps_v8_tools_run-llprof.sh @@ -0,0 +1,15 @@ +$NetBSD: patch-deps_v8_tools_run-llprof.sh,v 1.1 2022/03/30 06:51:31 adam Exp $ + +POSIX shell portability. + +--- deps/v8/tools/run-llprof.sh.orig 2015-03-31 22:13:01.000000000 +0000 ++++ deps/v8/tools/run-llprof.sh +@@ -46,7 +46,7 @@ framework, then calls the low level tick + EOF + } + +-if [ $# -eq 0 ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then ++if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then + usage + exit 1 + fi diff --git a/lang/nodejs14/patches/patch-node.gypi b/lang/nodejs14/patches/patch-node.gypi new file mode 100644 index 00000000000..aaab8f924a8 --- /dev/null +++ b/lang/nodejs14/patches/patch-node.gypi @@ -0,0 +1,14 @@ +$NetBSD: patch-node.gypi,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Linking in libcares requires libsocket. + +--- node.gypi.orig 2018-04-24 14:41:37.000000000 +0000 ++++ node.gypi +@@ -251,6 +251,7 @@ + [ 'OS=="solaris"', { + 'libraries': [ + '-lkstat', ++ '-lsocket', + '-lumem', + ], + 'defines!': [ diff --git a/lang/nodejs14/patches/patch-src_inspector__agent.cc b/lang/nodejs14/patches/patch-src_inspector__agent.cc new file mode 100644 index 00000000000..c56a36d10d6 --- /dev/null +++ b/lang/nodejs14/patches/patch-src_inspector__agent.cc @@ -0,0 +1,13 @@ +$NetBSD: patch-src_inspector__agent.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +--- src/inspector_agent.cc.orig 2019-11-19 08:29:09.000000000 +0000 ++++ src/inspector_agent.cc +@@ -112,7 +112,7 @@ static int StartDebugSignalHandler() { + CHECK_EQ(0, uv_sem_init(&start_io_thread_semaphore, 0)); + pthread_attr_t attr; + CHECK_EQ(0, pthread_attr_init(&attr)); +-#if defined(PTHREAD_STACK_MIN) && !defined(__FreeBSD__) ++#if defined(PTHREAD_STACK_MIN) && !defined(__FreeBSD__) && !defined(__NetBSD__) + // PTHREAD_STACK_MIN is 2 KB with musl libc, which is too small to safely + // receive signals. PTHREAD_STACK_MIN + MINSIGSTKSZ is 8 KB on arm64, which + // is the musl architecture with the biggest MINSIGSTKSZ so let's use that diff --git a/lang/nodejs14/patches/patch-src_node__postmortem__metadata.cc b/lang/nodejs14/patches/patch-src_node__postmortem__metadata.cc new file mode 100644 index 00000000000..29c66fdda96 --- /dev/null +++ b/lang/nodejs14/patches/patch-src_node__postmortem__metadata.cc @@ -0,0 +1,15 @@ +$NetBSD: patch-src_node__postmortem__metadata.cc,v 1.1 2022/03/30 06:51:31 adam Exp $ + +--- src/node_postmortem_metadata.cc.orig 2018-03-23 20:05:49.909811719 +0000 ++++ src/node_postmortem_metadata.cc +@@ -11,6 +11,10 @@ + #define NODEDBG_OFFSET(Class, Member, Type) \ + NODEDBG_SYMBOL(offset_ ## Class ## __ ## Member ## __ ## Type) + ++// Some systems provide macros for the types as well, which get expanded ++// by the nested macros here. ++#undef uintptr_t ++ + // These are the constants describing Node internal structures. Every constant + // should use the format described above. These constants are declared as + // global integers so that they'll be present in the generated node binary. They diff --git a/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_generator_make.py b/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_generator_make.py new file mode 100644 index 00000000000..4fdd601c37a --- /dev/null +++ b/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_generator_make.py @@ -0,0 +1,25 @@ +$NetBSD: patch-tools_gyp_pylib_gyp_generator_make.py,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Use the system libtool on Darwin. +Add support for NetBSD and DragonFly. + +--- tools/gyp/pylib/gyp/generator/make.py.orig 2020-10-07 17:47:43.000000000 +0000 ++++ tools/gyp/pylib/gyp/generator/make.py +@@ -180,7 +180,7 @@ cmd_solink_module = $(LINK.$(TOOLSET)) - + + LINK_COMMANDS_MAC = """\ + quiet_cmd_alink = LIBTOOL-STATIC $@ +-cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) ++cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool /usr/bin/libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) + + quiet_cmd_link = LINK($(TOOLSET)) $@ + cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) +@@ -2331,7 +2331,7 @@ def GenerateOutput(target_list, target_d + "flock_index": 2 + } + ) +- elif flavor == "freebsd": ++ elif flavor == "freebsd" or flavor == 'dragonflybsd' or flavor == 'netbsd': + # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. + header_params.update({"flock": "lockf"}) + elif flavor == "openbsd": diff --git a/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_xcode__emulation.py b/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_xcode__emulation.py new file mode 100644 index 00000000000..c68d2ad44c4 --- /dev/null +++ b/lang/nodejs14/patches/patch-tools_gyp_pylib_gyp_xcode__emulation.py @@ -0,0 +1,24 @@ +$NetBSD: patch-tools_gyp_pylib_gyp_xcode__emulation.py,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Do not generate debugging symbols (uses lots of disk space). + +--- tools/gyp/pylib/gyp/xcode_emulation.py.orig 2020-10-07 17:47:43.000000000 +0000 ++++ tools/gyp/pylib/gyp/xcode_emulation.py +@@ -610,7 +610,7 @@ class XcodeSettings(object): + + self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") + +- if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): ++ if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="NO"): + dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") + if dbg_format == "dwarf": + cflags.append("-gdwarf-2") +@@ -1097,7 +1097,7 @@ class XcodeSettings(object): + # For static libraries, no dSYMs are created. + result = [] + if ( +- self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") ++ self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="NO") + and self._Test( + "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" + ) diff --git a/lang/nodejs14/patches/patch-tools_install.py b/lang/nodejs14/patches/patch-tools_install.py new file mode 100644 index 00000000000..923a61c2b7e --- /dev/null +++ b/lang/nodejs14/patches/patch-tools_install.py @@ -0,0 +1,18 @@ +$NetBSD: patch-tools_install.py,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Install man pages under the right directory. + +--- tools/install.py.orig 2022-02-01 13:01:47.000000000 +0000 ++++ tools/install.py +@@ -156,10 +156,7 @@ def files(action): + action(['deps/v8/tools/gdbinit'], 'share/doc/node/') + action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/') + +- if 'freebsd' in sys.platform or 'openbsd' in sys.platform: +- action(['doc/node.1'], 'man/man1/') +- else: +- action(['doc/node.1'], 'share/man/man1/') ++ action(['doc/node.1'], os.environ.get('PKGMANDIR') + '/man1/') + + if 'true' == variables.get('node_install_npm'): + npm_files(action) diff --git a/lang/nodejs14/patches/patch-tools_v8_gypfiles_v8.gyp b/lang/nodejs14/patches/patch-tools_v8_gypfiles_v8.gyp new file mode 100644 index 00000000000..f963cf6a05c --- /dev/null +++ b/lang/nodejs14/patches/patch-tools_v8_gypfiles_v8.gyp @@ -0,0 +1,19 @@ +$NetBSD: patch-tools_v8_gypfiles_v8.gyp,v 1.1 2022/03/30 06:51:31 adam Exp $ + +Add -larm on netbsd arm platforms. + +--- tools/v8_gypfiles/v8.gyp.orig 2020-10-07 10:47:43.000000000 -0700 ++++ tools/v8_gypfiles/v8.gyp 2020-10-17 13:16:57.485883322 -0700 +@@ -903,6 +903,12 @@ + }], + # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library + # to implement atomic memory access ++ # NetBSD/arm also needs -larm. ++ ['OS == "netbsd" and v8_current_cpu in ["arm"]', { ++ 'link_settings': { ++ 'libraries': ['-larm', ], ++ }, ++ }], + ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm"]', { + 'link_settings': { + 'libraries': ['-latomic', ], |