[PATCH] D40260: [sanitizer] Define SANITIZER_USE_GETAUXVAL for Android

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 10:53:59 PST 2017


cryptoad created this revision.
Herald added subscribers: kubamracek, srhines.

Android for API level >= 21 has `getauxval`. Enable `SANITIZER_USE_GETAUXVAL`
when those requirements are met. Correct a typo in the header.


https://reviews.llvm.org/D40260

Files:
  lib/sanitizer_common/sanitizer_getauxval.h


Index: lib/sanitizer_common/sanitizer_getauxval.h
===================================================================
--- lib/sanitizer_common/sanitizer_getauxval.h
+++ lib/sanitizer_common/sanitizer_getauxval.h
@@ -8,7 +8,8 @@
 //===----------------------------------------------------------------------===//
 //
 // Common getauxval() guards and definitions.
-// getauxval() is not defined until glbc version 2.16.
+// getauxval() is not defined until glibc version 2.16, or until API level 21
+// for Android.
 //
 //===----------------------------------------------------------------------===//
 
@@ -25,7 +26,7 @@
 #define __GLIBC_PREREQ(x, y) 0
 #endif
 
-#if __GLIBC_PREREQ(2, 16)
+#if __GLIBC_PREREQ(2, 16) || (SANITIZER_ANDROID && __ANDROID_API__ >= 21)
 # define SANITIZER_USE_GETAUXVAL 1
 #else
 # define SANITIZER_USE_GETAUXVAL 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40260.123626.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171120/b120dbd8/attachment.bin>


More information about the llvm-commits mailing list