diff options
author | Gustavo Romero <gromero@br.ibm.com> | 2017-03-27 22:24:16 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-03-28 01:59:03 +0200 |
commit | 184cbe9b717f5ae699187e7264b7bc7fd97b3181 (patch) | |
tree | 41369e8e111a5ccdc65ce41e22e2bc1ed72cf32b /main/nodejs | |
parent | bfb4387cd428b80b44b3f180d052724dc8475bfa (diff) | |
download | aports-184cbe9b717f5ae699187e7264b7bc7fd97b3181.tar.bz2 aports-184cbe9b717f5ae699187e7264b7bc7fd97b3181.tar.xz |
main/nodejs: fix build on PPC when 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.
Diffstat (limited to 'main/nodejs')
-rw-r--r-- | main/nodejs/APKBUILD | 6 | ||||
-rw-r--r-- | main/nodejs/ppc-fix-musl-mcontext.patch | 27 |
2 files changed, 31 insertions, 2 deletions
diff --git a/main/nodejs/APKBUILD b/main/nodejs/APKBUILD index 4be037bd07..708d79d373 100644 --- a/main/nodejs/APKBUILD +++ b/main/nodejs/APKBUILD @@ -23,7 +23,8 @@ provides="nodejs-lts=$pkgver" # for backward compatibility replaces="nodejs-current nodejs-lts" # nodejs-lts for backward compatibility source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz use-system-ca-certs.patch - 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() { @@ -87,4 +88,5 @@ npm() { sha512sums="1bf5b64445b9e4f2d26ca1081f42e554dc10b540332bc45fb5ceeed4b3df0ec3ff4127a3685ca3ae89eadc17561d0f6f0f8024498d13a4461836620802eb647f node-v6.10.1.tar.gz 316a09f697e244c48d4dcf26ca2bb7e2441fc01ed61ad6b987e24741f93cfcf29f2e6de736ab9e4c014355cd14dd63ae7de1f8c28b5274e3225b1b3412db11d4 use-system-ca-certs.patch -a8be538158b7c96341a407acba30450ddc5c3ad764e7efe728d1ceff64efc3067b177855b9ef91b54400be6a02600d83da4c21a07ae9d7dc0774f92b2006ea8b dont-run-gyp-files-for-bundled-deps.patch" +a8be538158b7c96341a407acba30450ddc5c3ad764e7efe728d1ceff64efc3067b177855b9ef91b54400be6a02600d83da4c21a07ae9d7dc0774f92b2006ea8b dont-run-gyp-files-for-bundled-deps.patch +54a96cdc103bdffa9ba5283f59c64a35774e272f3a944d6475e3f669f95f7d75bcca6db3b12b9af76ea463f531763105aeabb302872652ced6a2bcb66f1eace0 ppc-fix-musl-mcontext.patch" diff --git a/main/nodejs/ppc-fix-musl-mcontext.patch b/main/nodejs/ppc-fix-musl-mcontext.patch new file mode 100644 index 0000000000..240f0262fc --- /dev/null +++ b/main/nodejs/ppc-fix-musl-mcontext.patch @@ -0,0 +1,27 @@ +From: Gustavo Romero <gromero@br.ibm.com> +Date: Mon, 27 Mar 2017 22:24:16 +0000 +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. + +--- a/deps/v8/src/profiler/sampler.cc ++++ b/deps/v8/src/profiler/sampler.cc +@@ -487,9 +487,17 @@ + state.sp = reinterpret_cast<Address>(mcontext.gregs[29]); + state.fp = reinterpret_cast<Address>(mcontext.gregs[30]); + #elif V8_HOST_ARCH_PPC ++#if V8_LIBC_GLIBC + state.pc = reinterpret_cast<Address>(ucontext->uc_mcontext.regs->nip); + state.sp = reinterpret_cast<Address>(ucontext->uc_mcontext.regs->gpr[PT_R1]); + state.fp = reinterpret_cast<Address>(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<Address>(ucontext->uc_mcontext.gp_regs[32]); ++ state.sp = reinterpret_cast<Address>(ucontext->uc_mcontext.gp_regs[1]); ++ state.fp = reinterpret_cast<Address>(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 |