From 444716d288d5058a9aa810057644f9a19ba90018 Mon Sep 17 00:00:00 2001
From: barracuda156 <vital.had@gmail.com>
Date: Tue, 14 Nov 2023 17:38:08 +0800
Subject: [PATCH] libcxx, libcxxabi: minor fix to linking

---
 libcxx/lib/CMakeLists.txt    | 1 +
 libcxxabi/src/CMakeLists.txt | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt
index 2f9a00011e9..9805723ca4c 100644
--- a/libcxx/lib/CMakeLists.txt
+++ b/libcxx/lib/CMakeLists.txt
@@ -165,6 +165,7 @@ if (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
       "-install_name @rpath/libc++.1.dylib"
       "-Wl,-reexport_library,${LIBCXX_LIBRARY_DIR}/libc++abi.dylib"
       "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
+      "/usr/lib/libgcc_s.10.5.dylib"
       "/usr/lib/libSystem.B.dylib")
   else()
     if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 30c9ce44d83..fce0b7e1ba5 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -104,6 +104,7 @@ if ( APPLE )
       "-current_version 1"
       "-install_name @rpath/libc++abi.1.dylib")
     list(APPEND LIBCXXABI_LINK_FLAGS
+        "/usr/lib/libgcc_s.10.5.dylib"
         "/usr/lib/libSystem.B.dylib")
   else()
     list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
