diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp @@ -2210,6 +2210,7 @@ return WRAP(fork)(fake); } +#if SANITIZER_LINUX TSAN_INTERCEPTOR(int, clone, int (*fn)(void *), void *stack, int flags, void *arg, int *parent_tid, void *tls, pid_t *child_tid) { SCOPED_INTERCEPTOR_RAW(clone, fn, stack, flags, arg, parent_tid, tls, @@ -2233,6 +2234,7 @@ ForkParentAfter(thr, pc); return pid; } +#endif #if !SANITIZER_MAC && !SANITIZER_ANDROID typedef int (*dl_iterate_phdr_cb_t)(__sanitizer_dl_phdr_info *info, SIZE_T size, @@ -2865,7 +2867,9 @@ TSAN_INTERCEPT(fork); TSAN_INTERCEPT(vfork); +#if SANITIZER_LINUX TSAN_INTERCEPT(clone); +#endif #if !SANITIZER_ANDROID TSAN_INTERCEPT(dl_iterate_phdr); #endif diff --git a/compiler-rt/test/tsan/clone_deadlock.cpp b/compiler-rt/test/tsan/Linux/clone_deadlock.cpp rename from compiler-rt/test/tsan/clone_deadlock.cpp rename to compiler-rt/test/tsan/Linux/clone_deadlock.cpp --- a/compiler-rt/test/tsan/clone_deadlock.cpp +++ b/compiler-rt/test/tsan/Linux/clone_deadlock.cpp @@ -1,5 +1,5 @@ // RUN: %clangxx_tsan -O1 %s -o %t && %env_tsan_opts=atexit_sleep_ms=0 %run %t 2>&1 | FileCheck %s -#include "test.h" +#include "../test.h" #include #include #include