Hi, this patch adds a CMake flag called COMPILER_RT_ENABLE_TSAN_OSX, which is off by default. If enabled, the build system will be building the OS X version of the TSan runtime library (called libclang_rt.tsan_osx_dynamic.dylib). I'll submit patches that fix OS X build errors shortly.
This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point.
I have a diff here. This might be currently irrelevant, but I'll post it here for future reference. To get it working with Xcode, I've done:
Did you try Xcode generator? Xcode's built-in build rules might be overriding compiler flags passed from the CMake generated Xcode project with for these S files. Because it works with Ninja generator, but fails with Xcode.