diff options
author | Kuba Mracek <mracek@apple.com> | 2017-07-12 17:30:54 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-07-12 17:30:54 +0000 |
commit | 880288aa6e7e6499b590fe792a16edec3193645a (patch) | |
tree | ea3998503f1d03293977535adfb5ed41ec3937d9 | |
parent | 241fc072806134c13fa941788c4e529a35a26e46 (diff) |
On Darwin, start building the TSan dylib for the iOS simulator.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307816 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/config-ix.cmake | 4 | ||||
-rw-r--r-- | lib/tsan/rtl/tsan_interceptors_mac.cc | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 0da98b9a4..aecf2e5cd 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -303,9 +303,7 @@ if(APPLE) if(DARWIN_${platform}sim_ARCHS) list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}sim) list(APPEND PROFILE_SUPPORTED_OS ${platform}sim) - if(DARWIN_${platform}_SYSROOT_INTERNAL) - list(APPEND TSAN_SUPPORTED_OS ${platform}sim) - endif() + list(APPEND TSAN_SUPPORTED_OS ${platform}sim) endif() foreach(arch ${DARWIN_${platform}sim_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) diff --git a/lib/tsan/rtl/tsan_interceptors_mac.cc b/lib/tsan/rtl/tsan_interceptors_mac.cc index f6bf8a0e5..4f1079467 100644 --- a/lib/tsan/rtl/tsan_interceptors_mac.cc +++ b/lib/tsan/rtl/tsan_interceptors_mac.cc @@ -21,7 +21,10 @@ #include "tsan_interface_ann.h" #include <libkern/OSAtomic.h> + +#if defined(__has_include) && __has_include(<xpc/xpc.h>) #include <xpc/xpc.h> +#endif // #if defined(__has_include) && __has_include(<xpc/xpc.h>) typedef long long_t; // NOLINT @@ -235,6 +238,8 @@ TSAN_INTERCEPTOR(void, os_lock_unlock, void *lock) { REAL(os_lock_unlock)(lock); } +#if defined(__has_include) && __has_include(<xpc/xpc.h>) + TSAN_INTERCEPTOR(void, xpc_connection_set_event_handler, xpc_connection_t connection, xpc_handler_t handler) { SCOPED_TSAN_INTERCEPTOR(xpc_connection_set_event_handler, connection, @@ -287,6 +292,8 @@ TSAN_INTERCEPTOR(void, xpc_connection_cancel, xpc_connection_t connection) { REAL(xpc_connection_cancel)(connection); } +#endif // #if defined(__has_include) && __has_include(<xpc/xpc.h>) + // On macOS, libc++ is always linked dynamically, so intercepting works the // usual way. #define STDCXX_INTERCEPTOR TSAN_INTERCEPTOR |