[PATCH] D30957: [CMake] Support single target builtins build on Darwin

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 15:41:58 PDT 2017


beanz added inline comments.


================
Comment at: cmake/modules/LLVMExternalProjectUtils.cmake:47
   if(NOT ARG_TOOLCHAIN_TOOLS)
-    set(ARG_TOOLCHAIN_TOOLS clang lld)
-    if(NOT APPLE AND NOT WIN32)
-      list(APPEND ARG_TOOLCHAIN_TOOLS llvm-ar llvm-ranlib)
-    endif()
+    set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib)
   endif()
----------------
This part of the change can't be done without causing problems on Darwin. llvm-ar and llvm-ranlib don't correctly handle fat archives on Darwin, so if you have a Darwin target we really don't want this to be the case. That's why this isn't defaulted.

You really need to just override the TOOLCHAIN_TOOLS option at the call site. We also probably shouldn't have lld in the list, but it doesn't have any adverse side effects because we don't force its use.


================
Comment at: runtimes/CMakeLists.txt:156
   if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt)
-    if(APPLE OR NOT LLVM_BUILTIN_TARGETS)
+    if(NOT LLVM_BUILTIN_TARGETS)
       llvm_ExternalProject_Add(builtins
----------------
I believe this patch will misbehave if LLVM_BUILTIN_TARGETS is a Darwin target, so we probably need to put some sort of protection in to catch that.


Repository:
  rL LLVM

https://reviews.llvm.org/D30957





More information about the llvm-commits mailing list