[compiler-rt] [compiler-rt] Replace deprecated os_trace calls on mac (PR #138908)

Dan Blackwell via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 10:13:28 PDT 2025


================
@@ -844,30 +844,26 @@ void LogMessageOnPrintf(const char *str) {
 
 void LogFullErrorReport(const char *buffer) {
 #if !SANITIZER_GO
-  // Log with os_trace. This will make it into the crash log.
-#if SANITIZER_OS_TRACE
-#pragma clang diagnostic push
-// os_trace is deprecated.
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-  if (GetMacosAlignedVersion() >= MacosVersion(10, 10)) {
-    // os_trace requires the message (format parameter) to be a string literal.
-    if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
-                         sizeof("AddressSanitizer") - 1) == 0)
-      os_trace("Address Sanitizer reported a failure.");
-    else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",
-                              sizeof("UndefinedBehaviorSanitizer") - 1) == 0)
-      os_trace("Undefined Behavior Sanitizer reported a failure.");
-    else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",
-                              sizeof("ThreadSanitizer") - 1) == 0)
-      os_trace("Thread Sanitizer reported a failure.");
-    else
-      os_trace("Sanitizer tool reported a failure.");
-
-    if (common_flags()->log_to_syslog)
-      os_trace("Consult syslog for more information.");
-  }
-#pragma clang diagnostic pop
-#endif
+#  if SANITIZER_OS_TRACE
+   // Log with os_log_error. This will make it into the crash log.
+   if (GetMacosAlignedVersion() >= MacosVersion(10, 10)) {
----------------
DanBlackwell wrote:

I've now bumped the check to 10.12, but also the minimum supported macOS for sanitizers looks to be 10.13 anyway: https://github.com/llvm/llvm-project/blob/790ce0ec943929d59783f44f05ea51bb929d1be0/compiler-rt/cmake/config-ix.cmake#L475.

https://github.com/llvm/llvm-project/pull/138908


More information about the llvm-commits mailing list