Revert "[CMake] Reland "Make simple source used for CMake checks a C file""
authorPetr Hosek <phosek@chromium.org>
Mon, 21 May 2018 19:32:43 +0000 (19:32 +0000)
committerPetr Hosek <phosek@chromium.org>
Mon, 21 May 2018 19:32:43 +0000 (19:32 +0000)
This reverts commit rCRT332679 which doesn't quite work and will be
replaced by D47100 and D47115 which is a cleaner solution.

llvm-svn: 332871

compiler-rt/CMakeLists.txt
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/cmake/config-ix.cmake

index 84a7dcd..57045c2 100644 (file)
@@ -145,7 +145,6 @@ if (SANITIZER_CXX_ABI STREQUAL "default")
     set(SANITIZER_CXX_ABI_SYSTEM 1)
   else()
     set(SANITIZER_CXX_ABI_LIBNAME "libstdc++")
-    set(SANITIZER_CXX_ABI_SYSTEM 1)
   endif()
 else()
   set(SANITIZER_CXX_ABI_LIBNAME "${SANITIZER_CXX_ABI}")
index 7ef1fc8..f567202 100644 (file)
@@ -144,12 +144,8 @@ macro(test_target_arch arch def)
       endif()
       set(SAVED_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})
       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${argstring}")
-      if(SANITIZER_CXX_ABI_SYSTEM)
-        set(FLAG_LINK_LIBRARIES ${SANITIZER_CXX_ABI_LIBRARY})
-      endif()
       try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
                   COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}"
-                  LINK_LIBRARIES ${FLAG_LINK_LIBRARIES}
                   OUTPUT_VARIABLE TARGET_${arch}_OUTPUT)
       set(CMAKE_EXE_LINKER_FLAGS ${SAVED_CMAKE_EXE_LINKER_FLAGS})
     endif()
index 4a9d840..ee387dc 100644 (file)
@@ -125,7 +125,7 @@ set(COMPILER_RT_SUPPORTED_ARCH)
 # platform. We use the results of these tests to build only the various target
 # runtime libraries supported by our current compilers cross-compiling
 # abilities.
-set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.c)
+set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
 file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\n#include <stdio.h>\nint main() { printf(\"hello, world\"); }\n")
 
 # Detect whether the current target platform is 32-bit or 64-bit, and setup