[compiler-rt] r259745 - [asan] fix the non-x86 build

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 18:33:48 PST 2016


Author: kcc
Date: Wed Feb  3 20:33:48 2016
New Revision: 259745

URL: http://llvm.org/viewvc/llvm-project?rev=259745&view=rev
Log:
[asan] fix the non-x86 build

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/test/asan/TestCases/Linux/segv_read_write.c

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=259745&r1=259744&r2=259745&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Wed Feb  3 20:33:48 2016
@@ -1156,8 +1156,12 @@ void internal_join_thread(void *th) {}
 #endif
 
 bool GetSigContextWriteFlag(void *context) {
+#if defined(__x86_64__) || defined(__i386__)
   ucontext_t *ucontext = (ucontext_t*)context;
   return ucontext->uc_mcontext.gregs[REG_ERR] & 2;
+#else
+  return false;  // FIXME: Implement.
+#endif
 }
 
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {

Modified: compiler-rt/trunk/test/asan/TestCases/Linux/segv_read_write.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/segv_read_write.c?rev=259745&r1=259744&r2=259745&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/segv_read_write.c (original)
+++ compiler-rt/trunk/test/asan/TestCases/Linux/segv_read_write.c Wed Feb  3 20:33:48 2016
@@ -1,6 +1,7 @@
 // RUN: %clangxx_asan -O0 %s -o %t
 // RUN: not %run %t       2>&1 | FileCheck %s --check-prefix=READ
 // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE
+// REQUIRES: x86_64-supported-target
 
 static volatile int sink;
 __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; }




More information about the llvm-commits mailing list