[llvm-commits] [compiler-rt] r147320 - /compiler-rt/trunk/lib/asan/asan_rtl.cc
Kostya Serebryany
kcc at google.com
Wed Dec 28 12:22:21 PST 2011
Author: kcc
Date: Wed Dec 28 14:22:21 2011
New Revision: 147320
URL: http://llvm.org/viewvc/llvm-project?rev=147320&view=rev
Log:
[asan] no ucontext on Android. patch by eugeni.stepanov at gmail.com
Modified:
compiler-rt/trunk/lib/asan/asan_rtl.cc
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=147320&r1=147319&r2=147320&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed Dec 28 14:22:21 2011
@@ -39,7 +39,9 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
+#ifndef ANDROID
#include <sys/ucontext.h>
+#endif
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
@@ -254,7 +256,9 @@
// -------------------------- 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 @@
*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;
More information about the llvm-commits
mailing list