From 06296580673d31a80d6d0ed78d76bfb897b73fc7 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 18 Oct 2019 19:30:36 +0200 Subject: [PATCH] tor: update sandbox patch for ppc32 [ci skip] --- srcpkgs/tor/patches/ppc.patch | 35 +++++++++++++++++++++++++++++++++ srcpkgs/tor/patches/ppc64.patch | 14 ------------- 2 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 srcpkgs/tor/patches/ppc.patch delete mode 100644 srcpkgs/tor/patches/ppc64.patch diff --git a/srcpkgs/tor/patches/ppc.patch b/srcpkgs/tor/patches/ppc.patch new file mode 100644 index 00000000000..c72cdf6ad78 --- /dev/null +++ b/srcpkgs/tor/patches/ppc.patch @@ -0,0 +1,35 @@ +--- 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); diff --git a/srcpkgs/tor/patches/ppc64.patch b/srcpkgs/tor/patches/ppc64.patch deleted file mode 100644 index aef2ba51f90..00000000000 --- a/srcpkgs/tor/patches/ppc64.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- src/lib/sandbox/sandbox.c 2018-12-20 17:33:15.815307612 +0100 -+++ src/lib/sandbox/sandbox.c 2018-12-20 17:36:59.795797024 +0100 -@@ -111,6 +111,11 @@ - #define REG_SYSCALL 8 - #define M_SYSCALL regs[REG_SYSCALL] - -+#elif defined(__powerpc64__) -+ -+#define REG_SYSCALL 0 -+#define M_SYSCALL gp_regs[REG_SYSCALL] -+ - #endif /* defined(__i386__) || ... */ - - /**Determines if at least one sandbox is active.*/