summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_internal_defs.h
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2017-08-30 22:49:31 +0000
committerMatt Morehouse <mascasa@google.com>2017-08-30 22:49:31 +0000
commit1c8c066ed59bb91fba7e977d421a658b24573fc5 (patch)
tree5de26ba064279eddabcbf2ced7c8f1d0763bbd83 /lib/sanitizer_common/sanitizer_internal_defs.h
parent14bcbc22b12de9c631d93d992ae926ac99a6cd10 (diff)
downloadcompiler-rt-1c8c066ed59bb91fba7e977d421a658b24573fc5.tar.gz
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Only enable on Linux. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_internal_defs.h')
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index 4b780917f..e7230e43b 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -35,6 +35,14 @@
# define SANITIZER_WEAK_ATTRIBUTE __attribute__((weak))
#endif
+// TLS is handled differently on different platforms
+#if SANITIZER_LINUX
+# define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE \
+ __attribute__((tls_model("initial-exec"))) thread_local
+#else
+# define SANITIZER_TLS_INITIAL_EXEC_ATTRIBUTE
+#endif
+
//--------------------------- WEAK FUNCTIONS ---------------------------------//
// When working with weak functions, to simplify the code and make it more
// portable, when possible define a default implementation using this macro: