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

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 14:54:16 PST 2017


hans 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)
----------------
Isn't this check redundant now?


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:720
+  if(NOT CMAKE_LINKER MATCHES "link.exe$")
+    append("-flto=full" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
----------------
We checked above that it's not link.exe.
But could the linker be gold and get confused about this flag?


================
Comment at: cmake/modules/HandleLLVMOptions.cmake:725
+  if(NOT CMAKE_LINKER MATCHES "link.exe$")
+    append("-flto" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
----------------
Ditto.


https://reviews.llvm.org/D30240





More information about the llvm-commits mailing list