From 1cec401fa9b3b678247e8af2e8a203ec034d848f Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 18 Aug 2025 15:55:46 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- .../lib/ubsan_minimal/ubsan_minimal_handlers.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp index a2a2e36e8523d..1e143075f1bee 100644 --- a/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp +++ b/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp @@ -125,15 +125,13 @@ 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) \ - INTERFACE void __ubsan_handle_##name##_minimal() { \ + SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal) { \ __ubsan_report_error(kind, GET_CALLER_PC(), nullptr); \ } #define HANDLER_NORECOVER(name, kind) \ - INTERFACE void __ubsan_handle_##name##_minimal_abort() { \ + SANITIZER_INTERFACE_WEAK_DEF(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); \ @@ -144,13 +142,14 @@ void NORETURN CheckFailed(const char *file, int, const char *cond, u64, u64) { HANDLER_NORECOVER(name, kind) #define HANDLER_RECOVER_PTR(name, kind) \ - INTERFACE void __ubsan_handle_##name##_minimal(const uintptr_t address) { \ + SANITIZER_INTERFACE_WEAK_DEF(void, __ubsan_handle_##name##_minimal, \ + const uintptr_t address) { \ __ubsan_report_error(kind, GET_CALLER_PC(), &address); \ } #define HANDLER_NORECOVER_PTR(name, kind) \ - INTERFACE void __ubsan_handle_##name##_minimal_abort( \ - const uintptr_t address) { \ + SANITIZER_INTERFACE_WEAK_DEF(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); \