[Darwin][ASan] Fix "interceptor working?" check for DriverKit platform
authorBlue Gaston <bgaston2@apple.com>
Wed, 6 Apr 2022 22:47:18 +0000 (15:47 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Wed, 6 Apr 2022 22:49:22 +0000 (15:49 -0700)
commitfc4c872d8f1e0c3409ba1fbc4761ffc984c7fdbd
treeb0c2f6180e5a28fa7591d010dc6a0289daaab5f1
parent38f920094576dfb95828d4b3cbbfa73d2308c5c4
[Darwin][ASan] Fix "interceptor working?" check for DriverKit platform

The previous check for interceptors used `pthread_create()` which is not
available on DriverKit.  We need an intercepted symbol that satisfies
the following constraints:

- Symbol is available in DriverKit
- Symbol is provided by simulator runtime dylibs (`dlsym()` fails to
  look up host-provided symbols)

`puts()` satisfies all of the above constraints.

rdar://87895539

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D123245
compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp