[compiler-rt] c600b99 - Expose `__tsan_on_thread_idle` as part of tsan shared interface

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 16:34:00 PDT 2023


Author: Dave MacLachlan
Date: 2023-03-20T16:33:51-07:00
New Revision: c600b99e5ee6e63a062342fe0b9c00e4b4d8ece4

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

LOG: Expose `__tsan_on_thread_idle` as part of tsan shared interface

`__tsan_on_thread_idle` is part of the tsan interface that was not being
exported in shared libraries. Fixes it so that we can link to dynamic
versions of tsan and still call `__tsan_on_thread_idle`.

Reviewed By: vitalybuka

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

Added: 
    

Modified: 
    compiler-rt/lib/tsan/rtl/tsan_interface.h
    compiler-rt/lib/tsan/rtl/tsan_mman.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/rtl/tsan_interface.h b/compiler-rt/lib/tsan/rtl/tsan_interface.h
index b32fb657adc3..d53c1e3935df 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interface.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_interface.h
@@ -88,6 +88,8 @@ SANITIZER_INTERFACE_ATTRIBUTE void __tsan_func_exit();
 SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_begin();
 SANITIZER_INTERFACE_ATTRIBUTE void __tsan_ignore_thread_end();
 
+SANITIZER_INTERFACE_ATTRIBUTE void __tsan_on_thread_idle();
+
 SANITIZER_INTERFACE_ATTRIBUTE
 void *__tsan_external_register_tag(const char *object_type);
 SANITIZER_INTERFACE_ATTRIBUTE

diff  --git a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
index 0937e521193f..99fa49226561 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_mman.cpp
@@ -15,6 +15,7 @@
 #include "sanitizer_common/sanitizer_common.h"
 #include "sanitizer_common/sanitizer_errno.h"
 #include "sanitizer_common/sanitizer_placement_new.h"
+#include "tsan_interface.h"
 #include "tsan_mman.h"
 #include "tsan_rtl.h"
 #include "tsan_report.h"


        


More information about the llvm-commits mailing list