[libc++abi] Add builtins to dynamic library link
Otherwise libc++abi.so fails to link on arm with undefined references to
some __aeabi_ builtins.
Differential Revision: https://reviews.llvm.org/D96574
GitOrigin-RevId: 26a0aeba61717d096e5422deff02331d93d4b00a
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9003f79..ff1e457 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -75,6 +75,11 @@
add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
endif()
+if (LIBCXXABI_USE_COMPILER_RT)
+ find_compiler_rt_library(builtins LIBCXXABI_BUILTINS_LIBRARY)
+ list(APPEND LIBCXXABI_SHARED_LIBRARIES "${LIBCXXABI_BUILTINS_LIBRARY}")
+endif ()
+
if (LIBCXXABI_USE_LLVM_UNWINDER)
# Prefer using the in-tree version of libunwind, either shared or static. If
# none are found fall back to using -lunwind.