[sanitizer] Define SANITIZER_USE_GETAUXVAL for Android

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

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D40260

llvm-svn: 318775
This commit is contained in:
Kostya Kortchinsky 2017-11-21 16:08:07 +00:00
parent adbaebc242
commit 2e96469465
1 changed files with 3 additions and 2 deletions

View File

@ -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