[PATCH] D17842: [ASAN] Add support for mips/mips64 android
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 3 09:58:25 PST 2016
samsonov added a reviewer: eugenis.
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:595
@@ -594,2 +594,3 @@
// oldact->sa_restorer upon a call to sigaction(xxx, NULL, oldact).
+#if !(SANITIZER_ANDROID && defined(__mips__) && !defined(__mips64))
k_act.sa_restorer = u_act->sa_restorer;
----------------
You might introduce a separate #define that would tell you whether you're on 32-bit MIPS: it's better than
spraying `defined(__mips__) && !defined(__mips64)` and its negation throughout the code.
================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.h:82
@@ +81,3 @@
+ #if SANITIZER_WORDSIZE == 64
+ const unsigned struct_kernel_stat_sz = 128;
+ #else
----------------
const unsigned struct_kernel_stat_sz = (SANITIZER_WORDSIZE == 64) ? 128 : 104;
you can use the same construct below.
================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.h:527
@@ -518,1 +526,3 @@
#if SANITIZER_ANDROID
+ #ifdef __mips__
+ typedef unsigned long __sanitizer_sigset_t[16/sizeof(unsigned long)];
----------------
Use #if defined() form where possible.
================
Comment at: lib/sanitizer_common/sanitizer_platform_limits_posix.h:549
@@ -536,1 +548,3 @@
+#if SANITIZER_ANDROID
+#if SANITIZER_WORDSIZE == 64 || defined(__mips__)
struct __sanitizer_sigaction {
----------------
That's incredibly hard to understand. Can you keep one level of nested #if's somehow?
Repository:
rL LLVM
http://reviews.llvm.org/D17842
More information about the llvm-commits
mailing list