diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h @@ -65,7 +65,7 @@ } // namespace __sanitizer namespace __sanitizer { -void CRAppendCrashLogMessage(const char *msg); +static void CRAppendCrashLogMessage(const char *msg); } // namespace __sanitizer #endif // SANITIZER_MAC diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp @@ -788,8 +788,8 @@ } // buffer to store crash report application information -char __crashreporter_info_buff__[__sanitizer::kErrorMessageBufferSize] = {}; -BlockingMutex __crashreporter_info_mutex__(LINKER_INITIALIZED); +static char crashreporter_info_buff[__sanitizer::kErrorMessageBufferSize] = {}; +static BlockingMutex crashreporter_info_mutex(LINKER_INITIALIZED); extern "C" { // Integrate with crash reporter libraries. @@ -812,19 +812,19 @@ #else // fall back to old crashreporter api static const char *__crashreporter_info__ __attribute__((__used__)) = - &__crashreporter_info_buff__[0]; + &crashreporter_info_buff[0]; asm(".desc ___crashreporter_info__, 0x10"); #endif } // extern "C" -inline void CRAppendCrashLogMessage(const char *msg) { - BlockingMutexLock l(&__crashreporter_info_mutex__); +static void CRAppendCrashLogMessage(const char *msg) { + BlockingMutexLock l(&crashreporter_info_mutex); + internal_strlcat(crashreporter_info_buff, msg, + sizeof(crashreporter_info_buff)); #if HAVE_CRASHREPORTERCLIENT_H - (void)CRSetCrashLogMessage(__crashreporter_info_buff__); + (void)CRSetCrashLogMessage(crashreporter_info_buff); #endif - internal_strlcat(__crashreporter_info_buff__, msg, - sizeof(__crashreporter_info_buff__)); } void LogMessageOnPrintf(const char *str) {