[PATCH] D32817: [CMake] Build runtimes for Fuchsia targets

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 10:36:03 PDT 2017


phosek created this revision.
Herald added a subscriber: mgorny.

This relies on the multi-target runtimes build support.


Repository:
  rL LLVM

https://reviews.llvm.org/D32817

Files:
  cmake/caches/Fuchsia-stage2.cmake
  cmake/caches/Fuchsia.cmake


Index: cmake/caches/Fuchsia.cmake
===================================================================
--- cmake/caches/Fuchsia.cmake
+++ cmake/caches/Fuchsia.cmake
@@ -38,8 +38,12 @@
   install-distribution
   clang CACHE STRING "")
 
-if(FUCHSIA_SYSROOT)
-  set(EXTRA_ARGS -DFUCHSIA_SYSROOT=${FUCHSIA_SYSROOT})
+if(FUCHSIA_x86_64_SYSROOT)
+  list(APPEND EXTRA_ARGS -DFUCHSIA_x86_64_SYSROOT=${FUCHSIA_x86_64_SYSROOT})
+endif()
+
+if(FUCHSIA_aarch64_SYSROOT)
+  list(APPEND EXTRA_ARGS -DFUCHSIA_aarch64_SYSROOT=${FUCHSIA_aarch64_SYSROOT})
 endif()
 
 # Setup the bootstrap build.
Index: cmake/caches/Fuchsia-stage2.cmake
===================================================================
--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -27,11 +27,31 @@
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gline-tables-only -DNDEBUG" CACHE STRING "")
 
-set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia-none;aarch64-fuchsia-none" CACHE STRING "")
-set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "")
-set(BUILTINS_x86_64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
-set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSROOT ${FUCHSIA_SYSROOT} CACHE STRING "")
-set(BUILTINS_aarch64-fuchsia-none_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
+set(LLVM_BUILTIN_TARGETS "x86_64-unknown-fuchsia;aarch64-unknown-fuchsia" CACHE STRING "")
+set(BUILTINS_x86_64-unknown-fuchsia_CMAKE_SYSROOT ${FUCHSIA_x86_64_SYSROOT} CACHE PATH "")
+set(BUILTINS_x86_64-unknown-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
+set(BUILTINS_aarch64-unknown-fuchsia_CMAKE_SYSROOT ${FUCHSIA_aarch64_SYSROOT} CACHE PATH "")
+set(BUILTINS_aarch64-unknown-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
+
+set(LLVM_RUNTIME_TARGETS "x86_64-unknown-linux-gnu;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia" CACHE STRING "")
+
+set(RUNTIMES_x86_64-unknown-fuchsia_CMAKE_INSTALL_PREFIX "/x86_64-unknown-fuchsia" CACHE PATH "")
+set(RUNTIMES_x86_64-unknown-fuchsia_CMAKE_SYSROOT ${FUCHSIA_x86_64_SYSROOT} CACHE PATH "")
+set(RUNTIMES_x86_64-unknown-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
+set(RUNTIMES_x86_64-unknown-fuchsia_UNIX 1 CACHE BOOL "")
+set(RUNTIMES_x86_64-unknown-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_x86_64-unknown-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_x86_64-unknown-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(RUNTIMES_x86_64-unknown-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+
+set(RUNTIMES_aarch64-unknown-fuchsia_CMAKE_INSTALL_PREFIX "/aarch64-unknown-fuchsia" CACHE PATH "")
+set(RUNTIMES_aarch64-unknown-fuchsia_CMAKE_SYSROOT ${FUCHSIA_aarch64_SYSROOT} CACHE PATH "")
+set(RUNTIMES_aarch64-unknown-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
+set(RUNTIMES_aarch64-unknown-fuchsia_UNIX 1 CACHE BOOL "")
+set(RUNTIMES_aarch64-unknown-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_aarch64-unknown-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+set(RUNTIMES_aarch64-unknown-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(RUNTIMES_aarch64-unknown-fuchsia_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
 
 # Setup toolchain.
 set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
@@ -61,8 +81,7 @@
   LTO
   clang-format
   clang-headers
-  builtins-x86_64-fuchsia-none
-  builtins-aarch64-fuchsia-none
+  builtins
   runtimes
   ${LLVM_TOOLCHAIN_TOOLS}
   CACHE STRING "")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32817.97685.patch
Type: text/x-patch
Size: 3513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170503/8916e1de/attachment-0001.bin>


More information about the cfe-commits mailing list