freebsd-ports/www/node/files/patch-deps_v8_src_libsampler_sampler.cc
Bradley T. Hughes 508fbed075 www/node: fix build on powerpc64
Upstream broke powerpc64 big-endian. Replace the check for AIX with
check for big-endian PPC64 to fix the build.

PR:		237586
Submitted by:	pkubaj
Sponsored by:	Miles AS
2019-05-08 18:41:05 +00:00

19 lines
973 B
C++

--- deps/v8/src/libsampler/sampler.cc.orig 2019-04-23 12:30:43 UTC
+++ deps/v8/src/libsampler/sampler.cc
@@ -466,9 +466,13 @@ void SignalHandler::FillRegisterState(void* context, R
state->sp = reinterpret_cast<void*>(mcontext.mc_rsp);
state->fp = reinterpret_cast<void*>(mcontext.mc_rbp);
#elif V8_HOST_ARCH_ARM
- state->pc = reinterpret_cast<void*>(mcontext.mc_r15);
- state->sp = reinterpret_cast<void*>(mcontext.mc_r13);
- state->fp = reinterpret_cast<void*>(mcontext.mc_r11);
+ state->pc = reinterpret_cast<void*>(mcontext.__gregs[_REG_PC]);
+ state->sp = reinterpret_cast<void*>(mcontext.__gregs[_REG_SP]);
+ state->fp = reinterpret_cast<void*>(mcontext.__gregs[_REG_FP]);
+#elif V8_TARGET_ARCH_PPC_BE
+ state->pc = reinterpret_cast<void*>(mcontext.mc_srr0);
+ state->sp = reinterpret_cast<void*>(mcontext.mc_frame[1]);
+ state->fp = reinterpret_cast<void*>(mcontext.mc_frame[31]);
#endif // V8_HOST_ARCH_*
#elif V8_OS_NETBSD
#if V8_HOST_ARCH_IA32