[compiler-rt] 3879d3e - [tsan][test] Remaining tests requiring weak symbols for dyld64
Roy Sundahl via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 1 11:02:47 PDT 2022
Author: Roy Sundahl
Date: 2022-08-01T11:02:43-07:00
New Revision: 3879d3edef89879112080f57f0a9edf15d8d92a4
URL: https://github.com/llvm/llvm-project/commit/3879d3edef89879112080f57f0a9edf15d8d92a4
DIFF: https://github.com/llvm/llvm-project/commit/3879d3edef89879112080f57f0a9edf15d8d92a4.diff
LOG: [tsan][test] Remaining tests requiring weak symbols for dyld64
Differential Revision: https://reviews.llvm.org/D130917
Added:
Modified:
compiler-rt/test/tsan/Darwin/debug_external.cpp
compiler-rt/test/tsan/Darwin/main_tid.mm
compiler-rt/test/tsan/debugging.cpp
compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c
Removed:
################################################################################
diff --git a/compiler-rt/test/tsan/Darwin/debug_external.cpp b/compiler-rt/test/tsan/Darwin/debug_external.cpp
index 399663c1fb0d7..6539a18f576e4 100644
--- a/compiler-rt/test/tsan/Darwin/debug_external.cpp
+++ b/compiler-rt/test/tsan/Darwin/debug_external.cpp
@@ -42,7 +42,12 @@ int main() {
return 0;
}
-__attribute__((disable_sanitizer_instrumentation)) void
+// Required for dyld macOS 12.0+
+#if (__APPLE__)
+__attribute__((weak))
+#endif
+__attribute__((disable_sanitizer_instrumentation))
+extern "C" void
__tsan_on_report(void *report) {
const char *type;
void *addr;
diff --git a/compiler-rt/test/tsan/Darwin/main_tid.mm b/compiler-rt/test/tsan/Darwin/main_tid.mm
index 886880edeb2fa..5f42c41adc342 100644
--- a/compiler-rt/test/tsan/Darwin/main_tid.mm
+++ b/compiler-rt/test/tsan/Darwin/main_tid.mm
@@ -13,8 +13,13 @@ int __tsan_get_report_thread(void *report, unsigned long idx, int *tid,
unsigned long trace_size);
}
+// Required for dyld macOS 12.0+
+#if (__APPLE__)
+__attribute__((weak))
+#endif
__attribute__((disable_sanitizer_instrumentation))
-void __tsan_on_report(void *report) {
+extern "C" void
+__tsan_on_report(void *report) {
fprintf(stderr, "__tsan_on_report(%p)\n", report);
int tid;
diff --git a/compiler-rt/test/tsan/debugging.cpp b/compiler-rt/test/tsan/debugging.cpp
index be0a0c7b0824d..9d247a25c8206 100644
--- a/compiler-rt/test/tsan/debugging.cpp
+++ b/compiler-rt/test/tsan/debugging.cpp
@@ -46,7 +46,12 @@ int main() {
fprintf(stderr, "Done.\n");
}
-__attribute__((disable_sanitizer_instrumentation)) void
+// Required for dyld macOS 12.0+
+#if (__APPLE__)
+__attribute__((weak))
+#endif
+__attribute__((disable_sanitizer_instrumentation))
+extern "C" void
__tsan_on_report(void *report) {
fprintf(stderr, "__tsan_on_report(%p)\n", report);
fprintf(stderr, "__tsan_get_current_report() = %p\n",
diff --git a/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c b/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c
index 4e8785baf0745..70faa609d16dc 100644
--- a/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c
+++ b/compiler-rt/test/tsan/libdispatch/dispatch_once_deadlock.c
@@ -22,8 +22,13 @@ void f() {
h++;
}
+// Required for dyld macOS 12.0+
+#if (__APPLE__)
+__attribute__((weak))
+#endif
__attribute__((disable_sanitizer_instrumentation))
-void __tsan_on_report() {
+extern void
+__tsan_on_report() {
fprintf(stderr, "Report.\n");
// Without these annotations this test deadlocks for COMPILER_RT_DEBUG=ON
More information about the llvm-commits
mailing list