diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index eeefae795887..83528474c280 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -39,7 +39,9 @@ #include #include #include +#ifndef ANDROID #include +#endif #include #include #include @@ -254,7 +256,9 @@ static void DescribeAddress(uintptr_t addr, uintptr_t access_size) { // -------------------------- Run-time entry ------------------- {{{1 void GetPcSpBpAx(void *context, uintptr_t *pc, uintptr_t *sp, uintptr_t *bp, uintptr_t *ax) { +#ifndef ANDROID ucontext_t *ucontext = (ucontext_t*)context; +#endif #ifdef __APPLE__ # if __WORDSIZE == 64 *pc = ucontext->uc_mcontext->__ss.__rip; @@ -268,7 +272,9 @@ void GetPcSpBpAx(void *context, *ax = ucontext->uc_mcontext->__ss.__eax; # endif // __WORDSIZE #else // assume linux -# if defined(__arm__) +# if defined (ANDROID) + *pc = *sp = *bp = *ax = 0; +# elif defined(__arm__) *pc = ucontext->uc_mcontext.arm_pc; *bp = ucontext->uc_mcontext.arm_fp; *sp = ucontext->uc_mcontext.arm_sp;