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

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 15:51:11 PST 2017


inglorion added inline comments.


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:709
+  append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
+  if(NOT CMAKE_LINKER MATCHES "link.exe$")
+    append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
----------------
hans wrote:
> inglorion wrote:
> > hans wrote:
> > > Isn't this check redundant now?
> > It shouldn't be. This is used to differentiate lld-link.exe from things like ld and lld, which do need the flag. It also matches link.exe without "lld-", which perhaps is a bit confusing. I can change it to look for lld-link, specifically, if folks feel that would be better.
> Oh right, I was reading this as checking for link.exe, not that it might also be lld-link.exe :-) This is subtle, but I'm not sure how to make it better.
I rewrote this to make the intent clearer, and also used the new way in the other places where we were checking for lld-link.


https://reviews.llvm.org/D30240





More information about the llvm-commits mailing list