[compiler-rt] r317361 - Disable detection of on_exit()/TSan on NetBSD
Kamil Rytarowski via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 13:39:51 PDT 2017
Author: kamil
Date: Fri Nov 3 13:39:51 2017
New Revision: 317361
URL: http://llvm.org/viewvc/llvm-project?rev=317361&view=rev
Log:
Disable detection of on_exit()/TSan on NetBSD
Summary:
NetBSD does not ship with on_exit() function.
Introduce TSAN_MAYBE_INTERCEPT_ON_EXIT.
It looks like this addition fixes build for Darwin.
Sponsored by <The NetBSD Foundation>
Reviewers: vitalybuka, joerg, eugenis, dvyukov, kcc
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D39617
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=317361&r1=317360&r2=317361&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Fri Nov 3 13:39:51 2017
@@ -435,7 +435,7 @@ static int setup_at_exit_wrapper(ThreadS
return res;
}
-#if !SANITIZER_MAC
+#if !SANITIZER_MAC && !SANITIZER_NETBSD
static void on_exit_wrapper(int status, void *arg) {
ThreadState *thr = cur_thread();
uptr pc = 0;
@@ -460,6 +460,9 @@ TSAN_INTERCEPTOR(int, on_exit, void(*f)(
ThreadIgnoreEnd(thr, pc);
return res;
}
+#define TSAN_MAYBE_INTERCEPT_ON_EXIT TSAN_INTERCEPT(on_exit)
+#else
+#define TSAN_MAYBE_INTERCEPT_ON_EXIT
#endif
// Cleanup old bufs.
@@ -2605,7 +2608,7 @@ void InitializeInterceptors() {
#if !SANITIZER_ANDROID
TSAN_INTERCEPT(dl_iterate_phdr);
#endif
- TSAN_INTERCEPT(on_exit);
+ TSAN_MAYBE_INTERCEPT_ON_EXIT;
TSAN_INTERCEPT(__cxa_atexit);
TSAN_INTERCEPT(_exit);
More information about the llvm-commits
mailing list