if LIBCXXABI_USE_COMPILER_RT=ON, add builtins to libcxxabi library flags, otherwise add libgcc following how libunwind does the same Index: llvm-toolchain-12_12.0.1/libcxxabi/src/CMakeLists.txt =================================================================== --- llvm-toolchain-12_12.0.1.orig/libcxxabi/src/CMakeLists.txt +++ llvm-toolchain-12_12.0.1/libcxxabi/src/CMakeLists.txt @@ -104,7 +104,9 @@ if (ANDROID AND ANDROID_PLATFORM_LEVEL L list(APPEND LIBCXXABI_LIBRARIES android_support) endif() -if (NOT LIBCXXABI_USE_COMPILER_RT) +if (LIBCXXABI_USE_COMPILER_RT) + add_library_flags("${LIBCXXABI_BUILTINS_LIBRARY}") +else() add_library_flags_if(LIBCXXABI_HAS_GCC_LIB gcc) endif ()