[PATCH] D30240: enable building with LTO on Windows using clang-cl and lld

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 11:48:31 PST 2017


mehdi_amini added inline comments.


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:707
+  if(NOT CMAKE_LINKER MATCHES "link.exe$")
+    append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
----------------
hans wrote:
> Does this mean that if the user sets `LLVM_ENABLE_LTO` but forgets to set the build to use lld, we silently don't do LTO? Maybe we should error in the non-lld case instead?
Especially since otherwise the link will fail badly right? Preventing from generating an invalid configuration seems better to me.



https://reviews.llvm.org/D30240





More information about the llvm-commits mailing list