aboutsummaryrefslogtreecommitdiffstats
path: root/community/nodejs-current
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-28 01:55:13 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-03-28 01:59:27 +0200
commitecff4dad4aeac6cec74666dd39adc3001f6e82dd (patch)
tree03145023177da0c0f3d2dd11303c424b5ae98123 /community/nodejs-current
parent184cbe9b717f5ae699187e7264b7bc7fd97b3181 (diff)
downloadaports-ecff4dad4aeac6cec74666dd39adc3001f6e82dd.tar.bz2
aports-ecff4dad4aeac6cec74666dd39adc3001f6e82dd.tar.xz
community/nodejs-current: fix compilation on PPC with musl
Port @gromero's patch from main/nodejs.
Diffstat (limited to 'community/nodejs-current')
-rw-r--r--community/nodejs-current/APKBUILD6
-rw-r--r--community/nodejs-current/ppc-fix-musl-mcontext.patch32
2 files changed, 36 insertions, 2 deletions
diff --git a/community/nodejs-current/APKBUILD b/community/nodejs-current/APKBUILD
index a937b96fb5..22aafde358 100644
--- a/community/nodejs-current/APKBUILD
+++ b/community/nodejs-current/APKBUILD
@@ -17,7 +17,8 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-npm::noarch"
provides="nodejs"
replaces="nodejs nodejs-lts" # nodejs-lts for backward compatibility
source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
- dont-run-gyp-files-for-bundled-deps.patch"
+ dont-run-gyp-files-for-bundled-deps.patch
+ ppc-fix-musl-mcontext.patch"
builddir="$srcdir/node-v$pkgver"
prepare() {
@@ -71,4 +72,5 @@ npm() {
}
sha512sums="2bd09784001354e187227f727e11c871c0f36e0caf18a5c1c1a374938a536ac6601a3240055d9ac659eeeac0b461aaa91bf05b49b27901d17afc22740b7f29ab node-v7.7.4.tar.gz
-ba95f21b1e80717ef63941854e7ed412f64a91da068c0dbf0d6d9697333ee266c9f4cd7bf1a01111eeb28aa66adefd8a58cfb3e82debb84b43e35e9dc914dd36 dont-run-gyp-files-for-bundled-deps.patch"
+ba95f21b1e80717ef63941854e7ed412f64a91da068c0dbf0d6d9697333ee266c9f4cd7bf1a01111eeb28aa66adefd8a58cfb3e82debb84b43e35e9dc914dd36 dont-run-gyp-files-for-bundled-deps.patch
+a128c76c6e5cc4d0c168bef1d02f10d1ce6be9ae98d92d4284c75e0f39bdf02355c1ac37996b749c1fda95bdffc273b0a10546f9ebfc5f02b8bc2cf5ac79981b ppc-fix-musl-mcontext.patch"
diff --git a/community/nodejs-current/ppc-fix-musl-mcontext.patch b/community/nodejs-current/ppc-fix-musl-mcontext.patch
new file mode 100644
index 0000000000..640fb8ed05
--- /dev/null
+++ b/community/nodejs-current/ppc-fix-musl-mcontext.patch
@@ -0,0 +1,32 @@
+From: Gustavo Romero <gromero@br.ibm.com>
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Mon, 28 Mar 2017 01:51:00 +0200
+Subject: [PATCH] Fix compilation on PPC when libc musl is used instead of glibc
+
+Musl on Power does not define regs member as a pt_regs pointer type,
+hence it's necessary to use member gp_regs instead.
+
+Ported to nodejs 7.7.4 (jirutka)
+
+--- a/deps/v8/src/libsampler/sampler.cc
++++ b/deps/v8/src/libsampler/sampler.cc
+@@ -450,11 +450,19 @@
+ state->sp = reinterpret_cast<void*>(mcontext.gregs[29]);
+ state->fp = reinterpret_cast<void*>(mcontext.gregs[30]);
+ #elif V8_HOST_ARCH_PPC
++#if V8_LIBC_GLIBC
+ state->pc = reinterpret_cast<void*>(ucontext->uc_mcontext.regs->nip);
+ state->sp =
+ reinterpret_cast<void*>(ucontext->uc_mcontext.regs->gpr[PT_R1]);
+ state->fp =
+ reinterpret_cast<void*>(ucontext->uc_mcontext.regs->gpr[PT_R31]);
++#else
++ // Some C libraries, notably Musl, define the regs member as a void pointer,
++ // hence we use the gp_regs member instead.
++ state.pc = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[32]);
++ state.sp = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[1]);
++ state.fp = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[31]);
++#endif
+ #elif V8_HOST_ARCH_S390
+ #if V8_TARGET_ARCH_32_BIT
+ // 31-bit target will have bit 0 (MSB) of the PSW set to denote addressing