From 02a417f69b3e03dc54a63ac321e31ed5af80f7e7 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Mon, 22 Apr 2019 23:31:39 +0000 Subject: [PATCH] [CMake] Replace the sanitizer support in runtimes build with multilib This is a more generic solution; while the sanitizer support can be used only for sanitizer instrumented builds, the multilib support can be used to build other variants such as noexcept which is what we would like to use in Fuchsia. The name CMake target name uses the target name, same as for the regular runtimes build and the name of the multilib, concatenated with '+'. The libraries are installed in a subdirectory named after the multilib. Differential Revision: https://reviews.llvm.org/D60926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358935 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/caches/Fuchsia-stage2.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmake/caches/Fuchsia-stage2.cmake b/cmake/caches/Fuchsia-stage2.cmake index 6ffcfe2643..2f29572004 100644 --- a/cmake/caches/Fuchsia-stage2.cmake +++ b/cmake/caches/Fuchsia-stage2.cmake @@ -142,12 +142,22 @@ if(FUCHSIA_SDK) set(RUNTIMES_${target}-fuchsia_LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY OFF CACHE BOOL "") set(RUNTIMES_${target}-fuchsia_LIBCXX_ABI_VERSION 2 CACHE STRING "") + set(RUNTIMES_${target}-fuchsia+asan_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia+asan_LLVM_USE_SANITIZER "Address" CACHE STRING "") + set(RUNTIMES_${target}-fuchsia+asan_LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia+asan_LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "") + + set(RUNTIMES_${target}-fuchsia+noexcept_LLVM_BUILD_COMPILER_RT OFF CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia+noexcept_LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "") + set(RUNTIMES_${target}-fuchsia+noexcept_LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "") + # Use .build-id link. list(APPEND RUNTIME_BUILD_ID_LINK "${target}-fuchsia") endforeach() - set(LLVM_RUNTIME_SANITIZERS "Address" CACHE STRING "") - set(LLVM_RUNTIME_SANITIZER_Address_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") + set(LLVM_RUNTIME_MULTILIBS "asan;noexcept" CACHE STRING "") + set(LLVM_RUNTIME_MULTILIB_asan_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") + set(LLVM_RUNTIME_MULTILIB_noexcept_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "") endif() set(LLVM_BUILTIN_TARGETS "${BUILTIN_TARGETS}" CACHE STRING "") -- 2.40.0