Skip to content

Commit eeb87aa

Browse files
Jaideep BajwaCommit Bot
authored andcommitted
Merged: Fix build on PPC arch with musl
Revision: d288a87 NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true BUG=v8:6793 [email protected], [email protected], [email protected] Bug: Change-Id: I3de61afb5dbd24269067103cec2d5697eedf16d5 Reviewed-on: https://chromium-review.googlesource.com/636484 Reviewed-by: Michael Achenbach <[email protected]> Commit-Queue: Jaideep Bajwa <[email protected]> Cr-Commit-Position: refs/branch-heads/6.1@{#78} Cr-Branched-From: 1bf2e10-refs/heads/6.1.534@{#1} Cr-Branched-From: e825c43-refs/heads/master@{#46746}
1 parent dd6ba78 commit eeb87aa

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/libsampler/sampler.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,18 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) {
450450
state->sp = reinterpret_cast<void*>(mcontext.gregs[29]);
451451
state->fp = reinterpret_cast<void*>(mcontext.gregs[30]);
452452
#elif V8_HOST_ARCH_PPC
453+
#if V8_LIBC_GLIBC
453454
state->pc = reinterpret_cast<void*>(ucontext->uc_mcontext.regs->nip);
454455
state->sp =
455456
reinterpret_cast<void*>(ucontext->uc_mcontext.regs->gpr[PT_R1]);
456457
state->fp =
457458
reinterpret_cast<void*>(ucontext->uc_mcontext.regs->gpr[PT_R31]);
459+
#else
460+
// Some C libraries, notably Musl, define the regs member as a void pointer
461+
state->pc = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[32]);
462+
state->sp = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[1]);
463+
state->fp = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[31]);
464+
#endif
458465
#elif V8_HOST_ARCH_S390
459466
#if V8_TARGET_ARCH_32_BIT
460467
// 31-bit target will have bit 0 (MSB) of the PSW set to denote addressing

0 commit comments

Comments
 (0)