diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -197,7 +197,7 @@ if (APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(${var}_LIBNAME "libc++") set(${var}_SYSTEM 1) - elseif (FUCHSIA) + elseif (ANDROID OR FUCHSIA) set(${var}_LIBNAME "libc++") set(${var}_INTREE 1) else() @@ -227,13 +227,19 @@ set_property(CACHE SANITIZER_TEST_CXX PROPERTY STRINGS ;${CXXLIBS}) handle_default_cxx_lib(SANITIZER_TEST_CXX) -option(COMPILER_RT_USE_LLVM_UNWINDER "Use the LLVM unwinder." OFF) +set(DEFAULT_COMPILER_RT_USE_LLVM_UNWINDER OFF) +if (ANDROID) + set(DEFAULT_COMPILER_RT_USE_LLVM_UNWINDER ON) +endif() + +option(COMPILER_RT_USE_LLVM_UNWINDER + "Use the LLVM unwinder." ${DEFAULT_COMPILER_RT_USE_LLVM_UNWINDER}) cmake_dependent_option(COMPILER_RT_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF "COMPILER_RT_USE_LLVM_UNWINDER" OFF) set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER OFF) -if (FUCHSIA) +if (ANDROID OR FUCHSIA) set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON) elseif (DEFINED LIBUNWIND_ENABLE_SHARED AND NOT LIBUNWIND_ENABLE_SHARED) set(DEFAULT_SANITIZER_USE_STATIC_LLVM_UNWINDER ON) @@ -271,7 +277,7 @@ "COMPILER_RT_CXX_LIBRARY" OFF) set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY OFF) -if (FUCHSIA) +if (ANDROID OR FUCHSIA) set(DEFAULT_COMPILER_RT_USE_BUILTINS_LIBRARY ON) endif()