summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-01-08 22:53:40 +0000
committerMarek Szuba <marecki@gentoo.org>2021-01-08 22:53:40 +0000
commitcd0cb8e673c0a2609174f456c3145e61ec408791 (patch)
tree1cac21bc5d254428507a60cf7fe01fb046b00bf3
parentprofiles.desc: Add default/linux/arm/17.0/armv6j/systemd profile (diff)
downloadgentoo-cd0cb8e673c0a2609174f456c3145e61ec408791.tar.gz
gentoo-cd0cb8e673c0a2609174f456c3145e61ec408791.tar.bz2
gentoo-cd0cb8e673c0a2609174f456c3145e61ec408791.zip
net-libs/nodejs-12.20.1: fix mksnapshot segfaults on ppc64
Upstream regression? Signed-off-by: Marek Szuba <marecki@gentoo.org>
-rw-r--r--net-libs/nodejs/files/nodejs-12.20.1-fix_ppc64_crashes.patch44
-rw-r--r--net-libs/nodejs/nodejs-12.20.1.ebuild1
2 files changed, 45 insertions, 0 deletions
diff --git a/net-libs/nodejs/files/nodejs-12.20.1-fix_ppc64_crashes.patch b/net-libs/nodejs/files/nodejs-12.20.1-fix_ppc64_crashes.patch
new file mode 100644
index 000000000000..0982d3c81c2a
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-12.20.1-fix_ppc64_crashes.patch
@@ -0,0 +1,44 @@
+Backport of https://github.com/nodejs/node/pull/33866 to nodejs-12
+
+--- a/deps/v8/src/compiler/backend/instruction-selector.cc
++++ b/deps/v8/src/compiler/backend/instruction-selector.cc
+@@ -2788,7 +2788,7 @@
+ switch (call_descriptor->kind()) {
+ case CallDescriptor::kCallAddress: {
+ int misc_field = static_cast<int>(call_descriptor->ParameterCount());
+-#if defined(_AIX)
++#if ABI_USES_FUNCTION_DESCRIPTORS
+ // Highest misc_field bit is used on AIX to indicate if a CFunction call
+ // has function descriptor or not.
+ misc_field |= call_descriptor->HasFunctionDescriptor()
+--- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
++++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc
+@@ -1026,7 +1026,7 @@
+ Label start_call;
+ bool isWasmCapiFunction =
+ linkage()->GetIncomingDescriptor()->IsWasmCapiFunction();
+-#if defined(_AIX)
++#if ABI_USES_FUNCTION_DESCRIPTORS
+ // AIX/PPC64BE Linux uses a function descriptor
+ int kNumParametersMask = kHasFunctionDescriptorBitMask - 1;
+ num_parameters = kNumParametersMask & misc_field;
+--- a/deps/v8/src/execution/simulator.h
++++ b/deps/v8/src/execution/simulator.h
+@@ -122,7 +122,7 @@
+
+ DISABLE_CFI_ICALL Return Call(Args... args) {
+ // When running without a simulator we call the entry directly.
+-#if V8_OS_AIX
++#if ABI_USES_FUNCTION_DESCRIPTORS
+ // AIX ABI requires function descriptors (FD). Artificially create a pseudo
+ // FD to ensure correct dispatch to generated code. The 'volatile'
+ // declaration is required to avoid the compiler from not observing the
+@@ -134,7 +134,7 @@
+ return fn(args...);
+ #else
+ return fn_ptr_(args...);
+-#endif // V8_OS_AIX
++#endif // ABI_USES_FUNCTION_DESCRIPTORS
+ }
+ #endif // USE_SIMULATOR
+
diff --git a/net-libs/nodejs/nodejs-12.20.1.ebuild b/net-libs/nodejs/nodejs-12.20.1.ebuild
index 87b53e063d27..fc8227e01db6 100644
--- a/net-libs/nodejs/nodejs-12.20.1.ebuild
+++ b/net-libs/nodejs/nodejs-12.20.1.ebuild
@@ -45,6 +45,7 @@ DEPEND="
"
PATCHES=(
"${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
+ "${FILESDIR}"/${PN}-12.20.1-fix_ppc64_crashes.patch
"${FILESDIR}"/${PN}-99999999-llhttp.patch
)
RESTRICT="test"