[PATCH] D42315: [sanitizer] Allow Fuchsia to use getauxval
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 19 13:50:18 PST 2018
cryptoad created this revision.
cryptoad added reviewers: alekseyshl, flowerhack.
Herald added subscribers: Sanitizers, kubamracek, srhines.
Fuchsia has `getauxval` (https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/include/sys/auxv.h,
https://fuchsia.googlesource.com/zircon/+/master/third_party/ulib/musl/src/misc/getauxval.c)
so set SANITIZER_USE_GETAUXVAL to 1 for this platform.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D42315
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
@@ -18,15 +18,16 @@
#include "sanitizer_platform.h"
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX || SANITIZER_FUCHSIA
# include <features.h>
# ifndef __GLIBC_PREREQ
# define __GLIBC_PREREQ(x, y) 0
# endif
-# if __GLIBC_PREREQ(2, 16) || (SANITIZER_ANDROID && __ANDROID_API__ >= 21)
+# if __GLIBC_PREREQ(2, 16) || (SANITIZER_ANDROID && __ANDROID_API__ >= 21) || \
+ SANITIZER_FUCHSIA
# define SANITIZER_USE_GETAUXVAL 1
# else
# define SANITIZER_USE_GETAUXVAL 0
@@ -42,6 +43,6 @@
unsigned long getauxval(unsigned long type); // NOLINT
# endif
-#endif // SANITIZER_LINUX
+#endif // SANITIZER_LINUX || SANITIZER_FUCHSIA
#endif // SANITIZER_GETAUXVAL_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42315.130683.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180119/90834a3e/attachment.bin>
More information about the llvm-commits
mailing list