[PATCH] D148751: [CMake] Add llvm-lib to Clang bootstrap dependency for LTO builds on Windows

Igor Kudrin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 15:25:49 PDT 2023


ikudrin created this revision.
ikudrin added reviewers: smeenai, mstorsjo, phosek, beanz.
ikudrin added a project: LLVM.
Herald added subscribers: ekilmer, inglorion.
Herald added a project: All.
ikudrin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Without this dependency, it is possible that `llvm-lib.exe` will not be built, in which case `CMake` will try to use `lib.exe` to build libraries, but this tool cannot handle bitcode files.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148751

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===================================================================
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -613,7 +613,10 @@
       # variable, and have LLVM's CMake append the envar to the archiver calls.
       set(LTO_LIBRARY -DDARWIN_LTO_LIBRARY=${LLVM_SHLIB_OUTPUT_INTDIR}/libLTO.dylib
         -DDYLD_LIBRARY_PATH=${LLVM_LIBRARY_OUTPUT_INTDIR})
-    elseif(NOT WIN32)
+    elseif(WIN32)
+      add_dependencies(clang-bootstrap-deps llvm-lib)
+      set(${CLANG_STAGE}_AR -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lib)
+    else()
       add_dependencies(clang-bootstrap-deps llvm-ar llvm-ranlib)
       if(NOT BOOTSTRAP_LLVM_ENABLE_LLD AND LLVM_BINUTILS_INCDIR)
         add_dependencies(clang-bootstrap-deps LLVMgold)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148751.515106.patch
Type: text/x-patch
Size: 771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230419/44a56fae/attachment-0001.bin>


More information about the cfe-commits mailing list