[compiler-rt] [RTSan][Darwin] Adjust OSSpinLock/_os_nospin_lock interceptor and tests (PR #132867)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 18:44:37 PDT 2025


================
@@ -1113,6 +1113,14 @@ TEST(TestRtsanInterceptors, PthreadJoinDiesWhenRealtime) {
 #pragma clang diagnostic push
 // OSSpinLockLock is deprecated, but still in use in libc++
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#undef OSSpinLockLock
+extern "C" {
+typedef int32_t OSSpinLock;
+void OSSpinLockLock(volatile OSSpinLock *__lock);
+typedef volatile OSSpinLock *_os_nospin_lock_t;
----------------
thetruestblue wrote:

This was done as part of the process for deprecating OSSpinLock years ago. What seems to has changed is the replacement happening in atomic_load seems to be due to the build min version of compiler rt library changing, which is why the behavior changed in a specific OS. I don't have info on why we deprecated the lock in this way. 

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


More information about the llvm-commits mailing list