Saturday, January 21, 2023

lang/node - patch for xonly

? node-18.12.1-rodata.diff
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/node/Makefile,v
retrieving revision 1.114
diff -u -p -r1.114 Makefile
--- Makefile 21 Jan 2023 15:48:25 -0000 1.114
+++ Makefile 21 Jan 2023 16:33:53 -0000
@@ -13,7 +13,7 @@ PLEDGE_VER = 1.1.3
DISTFILES = node-pledge-{}${PLEDGE_VER}.tar.gz:0 \
${DISTNAME}-headers.tar.gz \
${DISTNAME}.tar.xz
-REVISION = 0
+REVISION = 1

DISTNAME = node-${NODE_VERSION}
PKGNAME = ${DISTNAME:S/v//g}
Index: patches/patch-deps_v8_src_snapshot_embedded_embedded-file-writer_cc
===================================================================
RCS file: patches/patch-deps_v8_src_snapshot_embedded_embedded-file-writer_cc
diff -N patches/patch-deps_v8_src_snapshot_embedded_embedded-file-writer_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-deps_v8_src_snapshot_embedded_embedded-file-writer_cc 21 Jan 2023 16:33:53 -0000
@@ -0,0 +1,34 @@
+Index: deps/v8/src/snapshot/embedded/embedded-file-writer.cc
+--- deps/v8/src/snapshot/embedded/embedded-file-writer.cc.orig
++++ deps/v8/src/snapshot/embedded/embedded-file-writer.cc
+@@ -137,12 +137,19 @@ void EmbeddedFileWriter::WriteCodeSection(PlatformEmbe
+ w->Comment(
+ "The embedded blob code section starts here. It contains the builtin");
+ w->Comment("instruction streams.");
++
++#if !V8_OS_OPENBSD
+ w->SectionText();
++#endif
+
+ #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64
+ // UMA needs an exposed function-type label at the start of the embedded
+ // code section.
+- static const char* kCodeStartForProfilerSymbolName =
++#if V8_OS_OPENBSD
++ w->SectionRoData();
++#endif
++
++static const char* kCodeStartForProfilerSymbolName =
+ "v8_code_start_for_profiler_";
+ static constexpr int kDummyFunctionLength = 1;
+ static constexpr int kDummyFunctionData = 0xcc;
+@@ -154,6 +161,9 @@ void EmbeddedFileWriter::WriteCodeSection(PlatformEmbe
+ w->HexLiteral(kDummyFunctionData);
+ w->Newline();
+ w->DeclareFunctionEnd(kCodeStartForProfilerSymbolName);
++#endif
++#if V8_OS_OPENBSD
++ w->SectionText();
+ #endif
+
+ w->AlignToCodeAlignment();
On 1/19/23 22:56, Theo Buehler wrote:

> The trick to apply such patches is to add .diff to the github link.

Neat! I just noted that down ... ;-)

Here's a patch that builds node without USE_NOEXECONLY and without those
warnings, producing a working binary on amd64 ... I'm starting builds on
i386 and arm64, but since I'm not sure I understand the problem to its
full extent, it may - figuratively - need some adult supervision.

No comments:

Post a Comment