summaryrefslogtreecommitdiff
path: root/system/gcc/sanitation.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-07-10 09:38:30 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-08-07 10:08:23 -0500
commit5e13df2e1a8362058709100923f21bcf48cdaa75 (patch)
treeb0759a532781dbd11f3f36902846613ca8d994db /system/gcc/sanitation.patch
parent2105a97d4afa5022375c9b366138049da5b0a6a2 (diff)
downloadpackages-5e13df2e1a8362058709100923f21bcf48cdaa75.tar.gz
packages-5e13df2e1a8362058709100923f21bcf48cdaa75.tar.bz2
packages-5e13df2e1a8362058709100923f21bcf48cdaa75.tar.xz
packages-5e13df2e1a8362058709100923f21bcf48cdaa75.zip
system/gcc: Fix libsan on ppc64 and i586 bug
Closes: #1217, #1218
Diffstat (limited to 'system/gcc/sanitation.patch')
-rw-r--r--system/gcc/sanitation.patch14
1 files changed, 10 insertions, 4 deletions
diff --git a/system/gcc/sanitation.patch b/system/gcc/sanitation.patch
index 7dcdb0b65..861f5d08e 100644
--- a/system/gcc/sanitation.patch
+++ b/system/gcc/sanitation.patch
@@ -71,18 +71,24 @@
// Doesn't set sa_restorer if the caller did not set it, so use with caution
//(see below).
int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
-@@ -2173,11 +2170,11 @@
+@@ -2173,11 +2170,20 @@
*bp = ucontext->uc_mcontext.mc_frame[31];
# else
ucontext_t *ucontext = (ucontext_t*)context;
-- *pc = ucontext->uc_mcontext.regs->nip;
-- *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
++#ifdef __powerpc64__
+ *pc = ucontext->uc_mcontext.regs->nip;
+ *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
++#else
+ *pc = ucontext->uc_mcontext.gregs[PT_NIP];
+ *sp = ucontext->uc_mcontext.gregs[PT_R1];
++#endif
// The powerpc{,64}-linux ABIs do not specify r31 as the frame
// pointer, but GCC always uses r31 when we need a frame pointer.
-- *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
++#ifdef __powerpc64__
+ *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
++#else
+ *bp = ucontext->uc_mcontext.gregs[PT_R31];
++#endif
# endif
#elif defined(__sparc__)
#if defined(__arch64__) || defined(__sparcv9)