[PATCH] D54655: [CMake] Use lld and llvm-objcopy for first stage compiler in Fuchsia

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 16 15:05:10 PST 2018


phosek created this revision.
phosek added reviewers: juliehockett, mcgrathr, jakehehrlich.
Herald added subscribers: cfe-commits, mgorny.
Herald added a reviewer: alexshap.

When cross-compiling the second stage to a different target, we need to
make sure that the first-stage compiler can produce binaries for that
target. Using lld and llvm-objcopy as the default linker and objcopy
tool eliminates some of the dependencies on the host toolchain.


Repository:
  rC Clang

https://reviews.llvm.org/D54655

Files:
  clang/cmake/caches/Fuchsia.cmake


Index: clang/cmake/caches/Fuchsia.cmake
===================================================================
--- clang/cmake/caches/Fuchsia.cmake
+++ clang/cmake/caches/Fuchsia.cmake
@@ -22,6 +22,10 @@
   set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 
+if(NOT APPLE)
+  set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
+  set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
+endif()
 set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
 set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54655.174462.patch
Type: text/x-patch
Size: 505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181116/1a9b7179/attachment.bin>


More information about the cfe-commits mailing list