void-packages/srcpkgs/tor/patches/ppc.patch
2019-10-18 20:32:13 +02:00

35 lines
866 B
Diff

--- src/lib/sandbox/sandbox.c
+++ src/lib/sandbox/sandbox.c
@@ -115,6 +115,16 @@
#define REG_SYSCALL 8
#define M_SYSCALL regs[REG_SYSCALL]
+#elif defined(__powerpc64__)
+
+#define REG_SYSCALL 0
+#define M_SYSCALL gp_regs[REG_SYSCALL]
+
+#elif defined(__powerpc__)
+
+#define REG_SYSCALL 0
+#define M_SYSCALL gregs[REG_SYSCALL]
+
#endif /* defined(__i386__) || ... */
/**Determines if at least one sandbox is active.*/
@@ -1613,7 +1623,15 @@ sigsys_debugging(int nr, siginfo_t *info, void *void_context)
if (!ctx)
return;
+#if defined(__powerpc__) && !defined(__powerpc64__)
+#if defined(__GLIBC__)
+ syscall = (int) ctx->uc_mcontext.uc_regs->M_SYSCALL;
+#else
+ syscall = (int) ctx->uc_regs->M_SYSCALL;
+#endif
+#else
syscall = (int) ctx->uc_mcontext.M_SYSCALL;
+#endif
#ifdef USE_BACKTRACE
depth = backtrace(syscall_cb_buf, MAX_DEPTH);