[PATCH] D14233: [tsan] CMake support for TSan on OS X

Ismail Pazarbasi via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 11:25:59 PST 2015


ismailp accepted this revision.
ismailp added a reviewer: ismailp.
ismailp added a comment.

LGTM.


================
Comment at: lib/tsan/CMakeLists.txt:101-104
@@ +100,6 @@
+    if(arch STREQUAL "x86_64")
+      set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S)
+      # Pass ASM file directly to the C++ compiler.
+      set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
+        LANGUAGE C)
+      # Sanity check for Go runtime.
----------------
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:
```
+      set(TSAN_ASM_SOURCES rtl/tsan_rtl_amd64.S)
+      # Xcode will try to compile this file as C ('clang -x c'), and that will fail.
+      if (${CMAKE_GENERATOR} STREQUAL "Xcode")
+        enable_language(ASM)
+      else()
+        # Pass ASM file directly to the C++ compiler.
+        set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
+          LANGUAGE C)
+      endif()
```
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.


http://reviews.llvm.org/D14233





More information about the llvm-commits mailing list