diff --git a/compiler-rt/test/tsan/java_symbolization.cpp b/compiler-rt/test/tsan/java_symbolization.cpp --- a/compiler-rt/test/tsan/java_symbolization.cpp +++ b/compiler-rt/test/tsan/java_symbolization.cpp @@ -2,7 +2,11 @@ #include "java.h" #include -extern "C" __attribute__((disable_sanitizer_instrumentation)) void +#if (__APPLE__) +__attribute__((weak)) // Required for dyld macOS 12.0+ +#endif +__attribute__((disable_sanitizer_instrumentation)) +extern "C" void __tsan_symbolize_external_ex(jptr pc, void (*add_frame)(void *, const char *, const char *, int, int), diff --git a/compiler-rt/test/tsan/java_symbolization_legacy.cpp b/compiler-rt/test/tsan/java_symbolization_legacy.cpp --- a/compiler-rt/test/tsan/java_symbolization_legacy.cpp +++ b/compiler-rt/test/tsan/java_symbolization_legacy.cpp @@ -2,7 +2,11 @@ #include "java.h" #include -extern "C" __attribute__((disable_sanitizer_instrumentation)) bool +#if (__APPLE__) +__attribute__((weak)) // Required for dyld macOS 12.0+ +#endif +extern "C" bool +__attribute__((disable_sanitizer_instrumentation)) __tsan_symbolize_external(jptr pc, char *func_buf, jptr func_siz, char *file_buf, jptr file_siz, int *line, int *col) { if (pc == (1234 | kExternalPCBit)) {