-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
ppc32.patch
20 lines (20 loc) · 962 Bytes
/
ppc32.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- deps/v8/src/libsampler/sampler.cc.orig
+++ deps/v8/src/libsampler/sampler.cc
@@ -423,10 +423,17 @@
state->lr = reinterpret_cast<void*>(ucontext->uc_mcontext.regs->link);
#else
// Some C libraries, notably Musl, define the regs member as a void pointer
+ #if !V8_TARGET_ARCH_32_BIT
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]);
state->lr = reinterpret_cast<void*>(ucontext->uc_mcontext.gp_regs[36]);
+ #else
+ state->pc = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[32]);
+ state->sp = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[1]);
+ state->fp = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[31]);
+ state->lr = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[36]);
+ #endif
#endif
#elif V8_HOST_ARCH_S390
#if V8_TARGET_ARCH_32_BIT