From 880288aa6e7e6499b590fe792a16edec3193645a Mon Sep 17 00:00:00 2001 From: Kuba Mracek Date: Wed, 12 Jul 2017 17:30:54 +0000 Subject: 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 --- cmake/config-ix.cmake | 4 +--- 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 + +#if defined(__has_include) && __has_include() #include +#endif // #if defined(__has_include) && __has_include() 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() + 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() + // On macOS, libc++ is always linked dynamically, so intercepting works the // usual way. #define STDCXX_INTERCEPTOR TSAN_INTERCEPTOR -- cgit v1.2.3