From 0f0fb0a06f3275e2357b5e2cc9d1bd441fe4b0e7 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 19 Mar 2018 15:19:19 +0000 Subject: [PATCH] [CMake] Use libc++ and compiler-rt as default libraries in Fuchsia toolchain Fuchsia already defaults to libc++ and compiler-rt, but we want to use these as default runtimes even on the host platform. Differential Revision: https://reviews.llvm.org/D39930 llvm-svn: 327860 --- clang/cmake/caches/Fuchsia-stage2.cmake | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake index 4f975ac..7f1d32d 100644 --- a/clang/cmake/caches/Fuchsia-stage2.cmake +++ b/clang/cmake/caches/Fuchsia-stage2.cmake @@ -19,6 +19,8 @@ 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 "") set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") @@ -26,18 +28,34 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "") set(LLVM_BUILTIN_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") + +# Set the per-target builtins options. foreach(target x86_64;aarch64) set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") endforeach() set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia" CACHE STRING "") + +# Set the default target runtimes options. +set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") +set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "") +set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") +set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "") +set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "") +set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") +set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") +set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "") + +# Set the per-target runtimes options. foreach(target x86_64;aarch64) set(RUNTIMES_${target}-fuchsia_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "") set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "") set(RUNTIMES_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "") set(RUNTIMES_${target}-fuchsia_UNIX 1 CACHE BOOL "") - set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_LIBCXX ON CACHE BOOL "") set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") set(RUNTIMES_${target}-fuchsia_LIBUNWIND_ENABLE_STATIC OFF CACHE BOOL "") set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") -- 2.7.4