summaryrefslogtreecommitdiff
path: root/lib/tsan
diff options
context:
space:
mode:
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-08-19 08:03:26 +0000
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-08-19 08:03:26 +0000
commit4fd23542bfc662752c067035f3457b9f033344cc (patch)
treec43d3f8b8a5c28bb89a8c0e697fb7eb7ca670ffd /lib/tsan
parent68ca8edd87dd8dfffd882c66db28bb98df7e2b24 (diff)
Revert "[CMake] Fix ASM building in llvm/runtimes"
This reverts the TSAN parts of commit r279215. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r--lib/tsan/CMakeLists.txt19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tsan/CMakeLists.txt b/lib/tsan/CMakeLists.txt
index 7cdfc8df7..1ce582138 100644
--- a/lib/tsan/CMakeLists.txt
+++ b/lib/tsan/CMakeLists.txt
@@ -101,6 +101,13 @@ set_target_properties(tsan PROPERTIES FOLDER "Compiler-RT Misc")
if(APPLE)
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()
add_compiler_rt_runtime(clang_rt.tsan
SHARED
OS ${TSAN_SUPPORTED_OS}
@@ -131,6 +138,9 @@ else()
foreach(arch ${TSAN_SUPPORTED_ARCH})
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.
set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh)
add_custom_target(GotsanRuntimeCheck
@@ -142,10 +152,19 @@ else()
VERBATIM)
elseif(arch STREQUAL "aarch64")
set(TSAN_ASM_SOURCES rtl/tsan_rtl_aarch64.S)
+ # Pass ASM file directly to the C++ compiler.
+ set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
+ LANGUAGE C)
elseif(arch MATCHES "powerpc64|powerpc64le")
set(TSAN_ASM_SOURCES rtl/tsan_rtl_ppc64.S)
+ # Pass ASM file directly to the C++ compiler.
+ set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
+ LANGUAGE C)
elseif(arch MATCHES "mips64|mips64le")
set(TSAN_ASM_SOURCES rtl/tsan_rtl_mips64.S)
+ # Pass ASM file directly to the C++ compiler.
+ set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
+ LANGUAGE C)
else()
set(TSAN_ASM_SOURCES)
endif()