[PATCH] D30522: cmake: Configure the ThinLTO cache directory when using ELF lld or gold.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 19:12:53 PST 2017


pcc added inline comments.


================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:724
+           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"
----------------
mehdi_amini wrote:
> Is LLVM_USE_LINKER  already normalized into lower case? It seems that STREQUAL is case sensitive.
I don't think so, but I wouldn't normally expect something like `-DLLVM_USE_LINKER=LLD` to work anyway because this will translate into `-fuse-ld=LLD` which probably wouldn't work on case-sensitive file systems (which ELF targets normally are).


================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:730
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
----------------
mehdi_amini wrote:
> I'm fine with this for now, but I feel we should provide a clang driver option to abstract away all this logic.
> 
> 
Agreed, I've added a FIXME.


https://reviews.llvm.org/D30522





More information about the llvm-commits mailing list