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/ppc-fix-musl-mcontext.patch | |
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/ppc-fix-musl-mcontext.patch')
-rw-r--r-- | main/nodejs/ppc-fix-musl-mcontext.patch | 27 |
1 files changed, 27 insertions, 0 deletions
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 |