]> granicus.if.org Git - clang/commitdiff
[CMake] Use lld and llvm-objcopy for first stage compiler in Fuchsia
authorPetr Hosek <phosek@chromium.org>
Fri, 16 Nov 2018 23:07:03 +0000 (23:07 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 16 Nov 2018 23:07:03 +0000 (23:07 +0000)
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.

Differential Revision: https://reviews.llvm.org/D54655

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347108 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/caches/Fuchsia.cmake

index 53fff24d8c02f431059702f729008c9155efb4c9..e711f501a72781003916b7226f0bab843320b2c6 100644 (file)
@@ -22,6 +22,10 @@ if(NOT APPLE)
   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 "")