[compiler-rt] [rtsan][Apple] Add interceptor for _os_nospin_lock_lock (PR #131034)
Dan Liew via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 14 14:00:02 PDT 2025
delcypher wrote:
@davidtrevelyan Unfortunately it fails in a way that you won't be able to reproduce because the build fails when using Apple's internal SDKs which are different from the public ones. The error looks like this. I've had to redact a few things.
```
/Volumes/user_data/xc/tmp/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Redacted.sdk/usr/include/libkern/OSSpinLockDeprecated.h:185:30: error: type alias redefinition with different types ('volatile OSSpinLock *' (aka 'volatile int *') vs '_os_nospin_lock_s *')
<redacted>
^
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:38:7: note: previous definition is here
using _os_nospin_lock_t = _os_nospin_lock_s *;
^
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:705:19: error: conflicting types for '_os_nospin_lock_lock'
INTERCEPTOR(void, OSSpinLockLock, volatile OSSpinLock *lock) {
^
/Volumes/user_data/xc/tmp/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Redacted.sdk/usr/include/libkern/OSSpinLockDeprecated.h:190:6: note: previous declaration is here
<redacted>
^
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp:707:15: error: no matching function for call to '_os_nospin_lock_lock'
return REAL(OSSpinLockLock)(lock);
~~~~~^~~~~~~~~~~~~~~~~~~~~
/Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/rtsan/../interception/interception.h:266:18: note: expanded from macro 'REAL'
# define REAL(x) x
^
/Volumes/user_data/xc/tmp/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Redacted.sdk/usr/include/libkern/OSSpinLockDeprecated.h:192:30: note: expanded from macro 'OSSpinLockLock'
<redacted>
^~~~~~~~~~~~~~~~~~~~
/Volumes/user_data/xc/tmp/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.Redacted.sdk/usr/include/libkern/OSSpinLockDeprecated.h:190:6: note: candidate function not viable: no known conversion from 'volatile OSSpinLock *' (aka 'volatile int *') to '_os_nospin_lock_t' (aka '_os_nospin_lock_s *') for 1st argument
<redacted>
^
```
https://github.com/llvm/llvm-project/pull/131034
More information about the llvm-commits
mailing list