[PATCH] D143025: [Fuchsia] Add llvm-mt and llvm-rc to clang bootstrap dependency

Haowei Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 31 15:39:51 PST 2023


haowei created this revision.
haowei added a reviewer: phosek.
Herald added a subscriber: abrachet.
Herald added a project: All.
haowei requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

llvm-mt and llvm-rc tools are capable of building clang for Windows and compiler runtimes. We should use them in clang bootstrap build instead of relying on mt and rc provided by the host toolchain.
This patch also simplified the BOOTSTRAP_ flags, allowing them to be pass through from regular flags.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143025

Files:
  clang/cmake/caches/Fuchsia.cmake


Index: clang/cmake/caches/Fuchsia.cmake
===================================================================
--- clang/cmake/caches/Fuchsia.cmake
+++ clang/cmake/caches/Fuchsia.cmake
@@ -17,6 +17,40 @@
 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
 
+# Passthrough stage1 flags to stage1.
+set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH_STRINGS
+  ZLIB_INCLUDE_DIR
+  ZLIB_LIBRARY
+  zstd_DIR
+  LibXml2_ROOT
+  CURL_ROOT
+  OpenSSL_ROOT
+  CMAKE_SYSROOT
+  CMAKE_MODULE_LINKER_FLAGS
+  CMAKE_SHARED_LINKER_FLAGS
+  CMAKE_EXE_LINKER_FLAGS
+)
+
+set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH_BOOL
+  LLVM_ENABLE_ZLIB
+  LLVM_ENABLE_ZSTD
+  LLVM_ENABLE_LIBXML2
+  LLVM_ENABLE_CURL
+  CMAKE_FIND_PACKAGE_PREFER_CONFIG
+)
+
+foreach(variableName ${_FUCHSIA_BOOTSTRAP_PASSTHROUGH_STRINGS})
+  if(DEFINED ${variableName})
+    set(BOOTSTRAP_${variableName} "${${variableName}}" CACHE STRING "")
+  endif()
+endforeach()
+
+foreach(variableName ${_FUCHSIA_BOOTSTRAP_PASSTHROUGH_BOOL})
+  if(DEFINED ${variableName})
+    set(BOOTSTRAP_${variableName} "${${variableName}}" CACHE BOOL "")
+  endif()
+endforeach()
+
 if(WIN32)
   set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "")
 endif()
@@ -105,12 +139,6 @@
   endif()
 endif()
 
-if(UNIX)
-  set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-  set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-  set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
-endif()
-
 set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
 
@@ -145,6 +173,8 @@
 set(CLANG_BOOTSTRAP_EXTRA_DEPS
   builtins
   runtimes
+  llvm-rc
+  llvm-mt
   CACHE STRING "")
 set(CLANG_BOOTSTRAP_CMAKE_ARGS
   ${EXTRA_ARGS}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143025.493755.patch
Type: text/x-patch
Size: 1754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230131/807e5ff0/attachment-0001.bin>


More information about the cfe-commits mailing list