[llvm-branch-commits] [compiler-rt] 2193e4f - Forward declare OSSpinLockLock on MacOS since it's not shipped on the system. (#101392)
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 5 01:23:55 PDT 2024
Author: Amara Emerson
Date: 2024-08-05T10:23:35+02:00
New Revision: 2193e4f88c5a96462a41528912ddedcb405ea29c
URL: https://github.com/llvm/llvm-project/commit/2193e4f88c5a96462a41528912ddedcb405ea29c
DIFF: https://github.com/llvm/llvm-project/commit/2193e4f88c5a96462a41528912ddedcb405ea29c.diff
LOG: Forward declare OSSpinLockLock on MacOS since it's not shipped on the system. (#101392)
Fixes build errors on some SDKs.
rdar://132607572
(cherry picked from commit 3a4c7cc56c07b2db9010c2228fc7cb2a43dd9b2d)
Added:
Modified:
compiler-rt/lib/rtsan/rtsan_interceptors.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
index 4d5423ec629d2..b63040446e53c 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
@@ -21,6 +21,18 @@
#include "rtsan/rtsan_context.h"
#if SANITIZER_APPLE
+
+#if TARGET_OS_MAC
+// On MacOS OSSpinLockLock is deprecated and no longer present in the headers,
+// but the symbol still exists on the system. Forward declare here so we
+// don't get compilation errors.
+#include <stdint.h>
+extern "C" {
+typedef int32_t OSSpinLock;
+void OSSpinLockLock(volatile OSSpinLock *__lock);
+}
+#endif
+
#include <libkern/OSAtomic.h>
#include <os/lock.h>
#endif
More information about the llvm-branch-commits
mailing list