[PATCH] D23656: [CMake] Fix ASM building in llvm/runtimes

Jonas Hahnfeld via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 23:54:02 PDT 2016


This revision was automatically updated to reflect the committed changes.
Hahnfeld marked an inline comment as done.
Closed by commit rL279215: [CMake] Fix ASM building in llvm/runtimes (authored by Hahnfeld).

Changed prior to commit:
  https://reviews.llvm.org/D23656?vs=68516&id=68652#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23656

Files:
  compiler-rt/trunk/CMakeLists.txt
  compiler-rt/trunk/lib/tsan/CMakeLists.txt

Index: compiler-rt/trunk/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/CMakeLists.txt
+++ compiler-rt/trunk/CMakeLists.txt
@@ -1,14 +1,14 @@
 # CMake build for CompilerRT.
 #
 # This build assumes that CompilerRT is checked out into the
-# 'projects/compiler-rt' inside of an LLVM tree.
+# 'projects/compiler-rt' or 'runtimes/compiler-rt' inside of an LLVM tree.
 # Standalone build system for CompilerRT is not yet ready.
 #
 # An important constraint of the build is that it only produces libraries
 # based on the ability of the host toolchain to target various platforms.
 
 # Check if compiler-rt is built as a standalone project.
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD)
   project(CompilerRT C CXX ASM)
   set(COMPILER_RT_STANDALONE_BUILD TRUE)
 endif()
Index: compiler-rt/trunk/lib/tsan/CMakeLists.txt
===================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt
@@ -101,13 +101,6 @@
 
 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}
@@ -138,9 +131,6 @@
   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
@@ -152,19 +142,10 @@
         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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23656.68652.patch
Type: text/x-patch
Size: 2819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160819/d9d1b63f/attachment.bin>


More information about the llvm-commits mailing list