void-packages/srcpkgs/nodejs-lts-10/patches/ppc32.patch
Morgan Thomas 4c3e6cc301 nodejs-lts-10: fix build for targets without native atomic8
patches/ppc32.patch used "host_arch" instead of "target_arch" to check
whether to link against -latomic, and didn't include 32-bit ARM in the
list of targets that might need it. This addresses build failures on
armv6l as well as some lesser-used architectures.

Additionally, libatomic-devel is now included in makedepends for all
architectures (not just when `XBPS_TARGET_NO_ATOMIC8` is set) because
the build system can't tell the difference between armv6l and
armv7l. This matches how it's done for `nodejs{,-lts}` and doesn't
cause the armv7l build to actually depend on libatomic at runtime.
2021-04-28 09:32:29 -03:00

29 lines
1.2 KiB
Diff

--- configure.py
+++ configure.py
@@ -848,7 +848,7 @@ def host_arch_cc():
'__MIPSEL__' : 'mipsel',
'__mips__' : 'mips',
'__PPC64__' : 'ppc64',
- '__PPC__' : 'ppc64',
+ '__PPC__' : 'ppc',
'__x86_64__' : 'x64',
'__s390__' : 's390',
'__s390x__' : 's390x',
--- deps/v8/src/libsampler/sampler.cc
+++ deps/v8/src/libsampler/sampler.cc
@@ -418,9 +418,15 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) {
reinterpret_cast<void*>(ucontext->uc_mcontext.regs->gpr[PT_R31]);
#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]);
+ #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]);
+ #endif
#endif
#elif V8_HOST_ARCH_S390
#if V8_TARGET_ARCH_32_BIT