[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)
Chris Apple via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 30 08:53:53 PDT 2024
cjappl wrote:
Ok, it appears that on Apple systems, we would catch this, as we intercept OSSpinLockLock used by compiler-rt atomics:
https://github.com/llvm/llvm-project/blob/c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3/compiler-rt/lib/builtins/atomic.c#L95-L102
But, in the non-darwin case this is an atomic CAS spinlock, which we do not intercept (but we are trying to figure out how to catch potentially unbound loops like this):
https://github.com/llvm/llvm-project/blob/c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3/compiler-rt/lib/builtins/atomic.c#L112-L119
Would you please confirm that you end up in this area of atomic.c when you run this test? If so, I think it is adequate to #ifdef out this test under the circumstances that it is
1. Compiling with the builtin atomics
2. Not on darwin
https://github.com/llvm/llvm-project/blob/d58d105cdaf366d7db3f60d356b21bc8e64666fb/compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp#L164-L171
Or if you're feeling ambitious, you could pull this little bit into a new test and ifdef out that, might be cleaner.
Let me know if I can be of any assistance with any of this.
https://github.com/llvm/llvm-project/pull/106603
More information about the cfe-commits
mailing list