[compiler-rt] [TSan] Add interceptor for os_unfair_lock_lock_with_flags (PR #153815)

Dan Blackwell via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 03:51:55 PDT 2025


================
@@ -15,6 +16,18 @@ void *Thread(void *a) {
   return NULL;
 }
 
+#if defined(__MAC_15_0)
+void *ThreadWithFlags(void *a) {
+#  pragma clang diagnostic push
+#  pragma clang diagnostic ignored "-Wunguarded-availability-new"
+  os_unfair_lock_lock_with_flags(&lock, OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN);
----------------
DanBlackwell wrote:

I tried this at first, but get a linker error:

```
Undefined symbols for architecture arm64:
  "___isPlatformVersionAtLeast", referenced from:
      _ThreadWithFlags in os_unfair_lock-4ce0da.o
```

Grepping my build directory, I'm thinking that maybe we can't use `__builtin_available` unless we have also built the builtins (note that none of the tests in compiler-rt use it). Let me know if you think this is a bug, and we should fix it.

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


More information about the llvm-commits mailing list