From d643ed390afe659d37ffe70ce5ecc53302394384 Mon Sep 17 00:00:00 2001
From: Iain Sandoe <iain@sandoe.co.uk>
Date: Mon, 1 Apr 2019 20:57:09 +0100
Subject: [PATCH] more ppc hacks on libcxxabi

---
 libcxxabi/src/CMakeLists.txt | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 776c5129433..30c9ce44d83 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -89,18 +89,26 @@ add_link_flags_if_supported(-nodefaultlibs)
 set(LIBCXXABI_SHARED_LINK_FLAGS)
 
 if ( APPLE )
-  if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
+  if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.5" )
+    list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
+      "-compatibility_version 1"
+      "-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")
+  elseif ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
     list(APPEND LIBCXXABI_COMPILE_FLAGS "-U__STRICT_ANSI__")
     list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
       "-compatibility_version 1"
       "-current_version 1"
-      "-install_name /usr/lib/libc++abi.1.dylib")
+      "-install_name @rpath/libc++abi.1.dylib")
     list(APPEND LIBCXXABI_LINK_FLAGS
         "/usr/lib/libSystem.B.dylib")
   else()
     list(APPEND LIBCXXABI_SHARED_LINK_FLAGS
       "-compatibility_version 1"
-      "-install_name /usr/lib/libc++abi.1.dylib")
+      "-install_name @rpath/libc++abi.1.dylib")
   endif()
 endif()
 
