summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-02-21 21:13:07 +0000
committerVitaly Buka <vitalybuka@google.com>2018-02-21 21:13:07 +0000
commitdeef7d3300634a52fcd6aadb3b2fd88491ea959e (patch)
tree14a48629a5f0d8f6af1eaf3f54c30413fd7771ae
parentb19000fa677b8adcd2e5da929481438e6c6e813a (diff)
[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externally
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@325720 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index b91170b40..e18c89e5a 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -98,6 +98,7 @@
// We can use .preinit_array section on Linux to call sanitizer initialization
// functions very early in the process startup (unless PIC macro is defined).
// FIXME: do we have anything like this on Mac?
+#ifndef SANITIZER_CAN_USE_PREINIT_ARRAY
#if ((SANITIZER_LINUX && !SANITIZER_ANDROID) || \
SANITIZER_FREEBSD) && !defined(PIC)
# define SANITIZER_CAN_USE_PREINIT_ARRAY 1
@@ -108,6 +109,7 @@
#else
# define SANITIZER_CAN_USE_PREINIT_ARRAY 0
#endif
+#endif // SANITIZER_CAN_USE_PREINIT_ARRAY
// GCC does not understand __has_feature
#if !defined(__has_feature)