Index: Makefile =================================================================== RCS file: /cvs/ports/lang/node/Makefile,v retrieving revision 1.169 diff -u -p -r1.169 Makefile --- Makefile 30 Jun 2026 18:46:22 -0000 1.169 +++ Makefile 4 Jul 2026 12:13:11 -0000 @@ -13,6 +13,7 @@ DIST_TUPLE = github qbit node-pledge 1. DISTNAME = node-${NODE_VERSION} PKGNAME = ${DISTNAME:S/v//g} EPOCH = 0 +REVISION = 0 CATEGORIES = lang devel Index: patches/patch-deps_v8_src_base_platform-posix_cc =================================================================== RCS file: /cvs/ports/lang/node/patches/patch-deps_v8_src_base_platform-posix_cc,v retrieving revision 1.8 diff -u -p -r1.8 patch-deps_v8_src_base_platform-posix_cc --- patches/patch-deps_v8_src_base_platform-posix_cc 9 May 2026 13:26:47 -0000 1.8 +++ patches/patch-deps_v8_src_base_platform-posix_cc 4 Jul 2026 12:13:11 -0000 @@ -15,7 +15,7 @@ Index: deps/v8/src/base/platform/platfor } +#if V8_OS_OPENBSD -+// Allow OpenBSD's mmap to select a random address on OpenBSD ++// Allow OpenBSD's mmap to select a random address on OpenBSD // static void* OS::GetRandomMmapAddr() { + return nullptr; @@ -43,6 +43,15 @@ Index: deps/v8/src/base/platform/platfor return true; #else // TODO(bbudge) Return true for all POSIX platforms. +@@ -1258,7 +1266,7 @@ bool Thread::Start() { + if (result != 0) return false; + size_t stack_size = stack_size_; + if (stack_size == 0) { +-#if V8_OS_DARWIN ++#if V8_OS_DARWIN || V8_OS_OPENBSD + // Default on Mac OS X is 512kB -- bump up to 1MB + stack_size = 1 * 1024 * 1024; + #elif V8_OS_AIX @@ -1358,7 +1366,7 @@ void Thread::SetThreadLocal(LocalStorageKey key, void* // keep this version in POSIX as most Linux-compatible derivatives will // support it. MacOS and FreeBSD are different here. Index: patches/patch-deps_v8_src_wasm_stacks_cc =================================================================== RCS file: patches/patch-deps_v8_src_wasm_stacks_cc diff -N patches/patch-deps_v8_src_wasm_stacks_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-deps_v8_src_wasm_stacks_cc 4 Jul 2026 12:13:11 -0000 @@ -0,0 +1,49 @@ +Index: deps/v8/src/wasm/stacks.cc +--- deps/v8/src/wasm/stacks.cc.orig ++++ deps/v8/src/wasm/stacks.cc +@@ -4,6 +4,10 @@ + + #include "src/wasm/stacks.h" + ++#if V8_OS_OPENBSD ++#include ++#endif ++ + #include "src/base/platform/platform.h" + #include "src/execution/simulator.h" + #include "src/wasm/wasm-engine.h" +@@ -66,9 +70,18 @@ StackMemory::StackSegment::StackSegment(size_t pages) + DCHECK_GE(pages, 1); + PageAllocator* allocator = GetPlatformPageAllocator(); + size_ = pages * allocator->AllocatePageSize(); ++#if V8_OS_OPENBSD ++ limit_ = static_cast(mmap(nullptr, size_, PROT_READ | PROT_WRITE, ++ MAP_PRIVATE | MAP_ANON | MAP_STACK, -1, ++ 0)); ++ if (limit_ == MAP_FAILED) { ++ limit_ = nullptr; ++ } ++#else + limit_ = static_cast( + allocator->AllocatePages(nullptr, size_, allocator->AllocatePageSize(), + PageAllocator::kReadWrite)); ++#endif + if (limit_ == nullptr) { + V8::FatalProcessOutOfMemory(nullptr, + "StackMemory::StackSegment::StackSegment"); +@@ -77,9 +90,15 @@ StackMemory::StackSegment::StackSegment(size_t pages) + + StackMemory::StackSegment::~StackSegment() { + PageAllocator* allocator = GetPlatformPageAllocator(); ++#if V8_OS_OPENBSD ++ if (munmap(limit_, size_) != 0) { ++ V8::FatalProcessOutOfMemory(nullptr, "Release stack memory"); ++ } ++#else + if (!allocator->DecommitPages(limit_, size_)) { + V8::FatalProcessOutOfMemory(nullptr, "Decommit stack memory"); + } ++#endif + } + + bool StackMemory::Grow(Address current_fp) { Index: patches/patch-deps_v8_src_wasm_wasm-objects_cc =================================================================== RCS file: patches/patch-deps_v8_src_wasm_wasm-objects_cc diff -N patches/patch-deps_v8_src_wasm_wasm-objects_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-deps_v8_src_wasm_wasm-objects_cc 4 Jul 2026 12:13:11 -0000 @@ -0,0 +1,21 @@ +Index: deps/v8/src/wasm/wasm-objects.cc +--- deps/v8/src/wasm/wasm-objects.cc.orig ++++ deps/v8/src/wasm/wasm-objects.cc +@@ -2854,8 +2854,16 @@ DirectHandle WasmContinuationO + Isolate* isolate, wasm::StackMemory* stack, + wasm::JumpBuffer::StackState state, DirectHandle parent, + AllocationType allocation_type) { +- stack->jmpbuf()->stack_limit = stack->jslimit(); ++ stack->jmpbuf()->stack_limit = stack->jslimit(); ++#if V8_OS_OPENBSD ++ // OpenBSD MAP_STACK mappings cannot be entered with rsp exactly equal to the ++ // high end of the mapping. The first push from that value traps with ++ // SEGV_ACCERR, even though push would write below rsp. Keep the initial stack ++ // pointer strictly inside the mapped stack. ++ stack->jmpbuf()->sp = stack->base() - kSystemPointerSize; ++#else + stack->jmpbuf()->sp = stack->base(); ++#endif + stack->jmpbuf()->fp = kNullAddress; + stack->jmpbuf()->state = state; + DirectHandle result =