Index: sanitizer_linux.cc =================================================================== --- sanitizer_linux.cc (revision 345081) +++ sanitizer_linux.cc (working copy) @@ -1393,7 +1393,7 @@ : "x30", "memory"); return res; } -#elif defined(__powerpc64__) +#elif defined(__powerpc64__) && SANITIZER_LINUX uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg, int *parent_tidptr, void *newtls, int *child_tidptr) { long long res; @@ -1933,12 +1933,19 @@ *sp = ucontext->uc_mcontext.gregs[REG_ESP]; # endif #elif defined(__powerpc__) || defined(__powerpc64__) +# if SANITIZER_FREEBSD ucontext_t *ucontext = (ucontext_t*)context; + *pc = ucontext->uc_mcontext.mc_srr0; + *sp = ucontext->uc_mcontext.mc_gpr[1]; + *bp = ucontext->uc_mcontext.mc_gpr[31]; +# else + ucontext_t *ucontext = (ucontext_t*)context; *pc = ucontext->uc_mcontext.regs->nip; *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; // 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]; +# endif #elif defined(__sparc__) ucontext_t *ucontext = (ucontext_t*)context; uptr *stk_ptr;