From 27bf69864380a91f8fb8dcd8beb69b9e99a16cae Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 4 Sep 2025 15:13:53 -0700 Subject: [PATCH] Revert "[UBSan] [min-rt] make minimal runtime handlers weak (#154220)" This reverts commit 19474672e55f4a781154ce34e0c37642f91534bb. --- .../lib/ubsan_minimal/ubsan_minimal_handlers.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp index 1e143075f1bee..a2a2e36e8523d 100644 --- a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp +++ b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp @@ -125,13 +125,15 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) { } // namespace __sanitizer #endif +#define INTERFACE extern "C" __attribute__((visibility("default"))) + #define HANDLER_RECOVER(name, kind) \ - SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal) { \ + INTERFACE void __ubsan_handle_##name##_minimal() { \ __ubsan_report_error(kind, GET_CALLER_PC(), nullptr); \ } #define HANDLER_NORECOVER(name, kind) \ - SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal_abort) { \ + INTERFACE void __ubsan_handle_##name##_minimal_abort() { \ uintptr_t caller = GET_CALLER_PC(); \ __ubsan_report_error_fatal(kind, caller, nullptr); \ abort_with_message(kind, caller, nullptr); \ @@ -142,14 +144,13 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) { HANDLER_NORECOVER(name, kind) #define HANDLER_RECOVER_PTR(name, kind) \ - SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal, \ - const uintptr_t address) { \ + INTERFACE void __ubsan_handle_##name##_minimal(const uintptr_t address) { \ __ubsan_report_error(kind, GET_CALLER_PC(), &address); \ } #define HANDLER_NORECOVER_PTR(name, kind) \ - SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal_abort, \ - const uintptr_t address) { \ + INTERFACE void __ubsan_handle_##name##_minimal_abort( \ + const uintptr_t address) { \ uintptr_t caller = GET_CALLER_PC(); \ __ubsan_report_error_fatal(kind, caller, &address); \ abort_with_message(kind, caller, &address); \