[compiler-rt] cb7b0a5 - tsan: don't include tsan_interceptors.h for Go

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 07:56:32 PDT 2021


Author: Dmitry Vyukov
Date: 2021-08-05T16:56:28+02:00
New Revision: cb7b0a5f34e54db8e3f56eabd9f477ab02b95f98

URL: https://github.com/llvm/llvm-project/commit/cb7b0a5f34e54db8e3f56eabd9f477ab02b95f98
DIFF: https://github.com/llvm/llvm-project/commit/cb7b0a5f34e54db8e3f56eabd9f477ab02b95f98.diff

LOG: tsan: don't include tsan_interceptors.h for Go

None of the interceptors machinery is used/enabled for Go,
so don't include the header, it's not needed (must not be).
The problem is that we have fields in ThreadState that are
not present in the Go build, so changes in thread_interceptors.h
can cause Go build breakages due to missing fields.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107561

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_external.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_external.cpp b/compiler-rt/lib/tsan/rtl/tsan_external.cpp
index eb72e51fe81d..19ae174f20a5 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_external.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_external.cpp
@@ -10,9 +10,12 @@
 //
 //===----------------------------------------------------------------------===//
 #include "tsan_rtl.h"
-#include "tsan_interceptors.h"
 #include "sanitizer_common/sanitizer_ptrauth.h"
 
+#if !SANITIZER_GO
+#  include "tsan_interceptors.h"
+#endif
+
 namespace __tsan {
 
 #define CALLERPC ((uptr)__builtin_return_address(0))


        


More information about the llvm-commits mailing list