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 @@ -153,10 +153,15 @@ #endif // All tsan interceptors check for initialization and/or initialize things -// as necessary lazily, so we can pretend everything is initialized in this -// check to avoid double-checking for initialization (this is only necessary for -// sanitizers that don't handle initialization on common grounds). -#define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED false +// as necessary lazily later, so for some platforms this additional check +// is not necessary. But tread carefully since it's also know to be necessary +// at least for ppc64 (buildbots fail w/o the check). +#if SANITIZER_LINUX && !SANITIZER_ANDROID && defined(__x86_64__) +# define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED false +#else +# define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED \ + (!cur_thread_init()->is_inited) +#endif namespace __tsan { struct SignalDesc {