[TSAN][Darwin] Forward declare spinlock functions on darwin for TSAN interceptors
authorBlue Gaston <bgaston2@apple.com>
Tue, 21 Mar 2023 15:48:22 +0000 (08:48 -0700)
committerBlue Gaston <bblueconway@gmail.com>
Tue, 21 Mar 2023 19:16:19 +0000 (12:16 -0700)
commitae484c21c05668f84b13304c28bc39f753e493de
tree07af449c4d6693a7a7a3245bbf389f53aa592a8a
parent852cfc2ed31bd434222d55930312f7e94884a322
[TSAN][Darwin] Forward declare spinlock functions on darwin for TSAN interceptors

Spinlock symbols are removed from headers in MacOS version 10.12 and greater.
Even though they are deprecated, the symbols remain available on the system.

The TSAN interceptors currently cause a build failure after this version because
of the change in availability of the symbol.

We want to continue intercepting the symbols available on the OS.
So we add forward declarations so that the TSAN interceptors can build.

This is tested with the existing osspinlock_norace test.

Differential Revision: https://reviews.llvm.org/D146537
compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp
compiler-rt/lib/tsan/rtl/tsan_spinlock_defs_mac.h [new file with mode: 0644]