[PATCH] D80493: [CMake]: Properly handle the LTO cache arguments for MinGW

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 24 11:12:34 PDT 2020


mstorsjo accepted this revision.
mstorsjo added a comment.
This revision is now accepted and ready to land.

LGTM

> Note that this will break when building with LTO and a older lld than what ships before the addition of that option in the tree. We could add logic for checking if the linker flags are correct - but I think when using LTO multi-stage builds are not uncommon.

Well, wasn't it the case that lto mingw builds were broken to begin with? So either nobody did it, or they already patched around it (and will need to adjust their patch)?



================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:959
            CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-  elseif(UNIX AND LLVM_USE_LINKER STREQUAL "lld")
+  elseif(UNIX OR MINGW AND LLVM_USE_LINKER STREQUAL "lld")
     append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
----------------
I'd feel more comfortable with parentheses here


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80493/new/

https://reviews.llvm.org/D80493





More information about the llvm-commits mailing list