]> granicus.if.org Git - llvm/commitdiff
Revert r296730, "cmake: Configure the ThinLTO cache directory when using ELF lld...
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 3 Mar 2017 02:00:22 +0000 (02:00 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 3 Mar 2017 02:00:22 +0000 (02:00 +0000)
Causes a build failure on the clang-with-thin-lto-ubuntu bot.
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/2117/steps/build-stage3-compiler/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296850 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake

index 8d9051cfdd7c6377e52774543dabb331e462afed..d776285b80fef141d4f184b33586d44ae1d5db84 100644 (file)
@@ -715,20 +715,11 @@ if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
   if(NOT LINKER_IS_LLD_LINK)
     append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
-  # If the linker supports it, enable the lto cache. This improves initial build
-  # time a little since we re-link a lot of the same objects, and significantly
-  # improves incremental build time.
-  # FIXME: We should move all this logic into the clang driver.
-  if(APPLE)
-    append("-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
-           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-  elseif(UNIX AND LLVM_USE_LINKER STREQUAL "lld")
-    append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
-           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-  elseif(LLVM_USE_LINKER STREQUAL "gold")
-    append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
-           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-  endif()
+  # On darwin, enable the lto cache. This improves initial build time a little
+  # since we re-link a lot of the same objects, and significantly improves
+  # incremental build time.
+  append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
+            CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
 elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
   append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)