From 10de8f123b5546d6ef78a2878c43107511e17a09 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Sun, 4 Jan 2015 13:21:39 -0800
Subject: [PATCH 3/4] libunwind: MacPorts availability

---
 include/libunwind.h        |  2 +-
 src/Unwind_AppleExtras.cpp | 36 ++----------------------------------
 2 files changed, 3 insertions(+), 35 deletions(-)

diff --git a/include/libunwind.h b/include/libunwind.h
index cd09037..5718bdd 100644
--- a/include/libunwind.h
+++ b/include/libunwind.h
@@ -19,7 +19,7 @@
 #include <stdint.h>
 #include <stddef.h>
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && !defined(USE_MACPORTS_LIBUNWIND)
   #if __clang__
     #if __has_include(<Availability.h>)
       #include <Availability.h>
diff --git a/src/Unwind_AppleExtras.cpp b/src/Unwind_AppleExtras.cpp
index 471059b..1822fb2 100644
--- a/src/Unwind_AppleExtras.cpp
+++ b/src/Unwind_AppleExtras.cpp
@@ -42,40 +42,8 @@ struct libgcc_object_info {
 
 
 // static linker symbols to prevent wrong two level namespace for _Unwind symbols
-#if defined(__arm__)
-   #define NOT_HERE_BEFORE_5_0(sym)     \
-       extern const char sym##_tmp30 __asm("$ld$hide$os3.0$_" #sym ); \
-       __attribute__((visibility("default"))) const char sym##_tmp30 = 0; \
-       extern const char sym##_tmp31 __asm("$ld$hide$os3.1$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp31 = 0; \
-       extern const char sym##_tmp32 __asm("$ld$hide$os3.2$_" #sym );\
-           __attribute__((visibility("default"))) const char sym##_tmp32 = 0; \
-       extern const char sym##_tmp40 __asm("$ld$hide$os4.0$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp40 = 0; \
-       extern const char sym##_tmp41 __asm("$ld$hide$os4.1$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp41 = 0; \
-       extern const char sym##_tmp42 __asm("$ld$hide$os4.2$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp42 = 0; \
-       extern const char sym##_tmp43 __asm("$ld$hide$os4.3$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp43 = 0;
-#elif defined(__arm64__)
-  #define NOT_HERE_BEFORE_10_6(sym)
-  #define NEVER_HERE(sym)
-#else
-  #define NOT_HERE_BEFORE_10_6(sym) \
-    extern const char sym##_tmp4 __asm("$ld$hide$os10.4$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
-    extern const char sym##_tmp5 __asm("$ld$hide$os10.5$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp5 = 0;
-  #define NEVER_HERE(sym) \
-    extern const char sym##_tmp4 __asm("$ld$hide$os10.4$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
-    extern const char sym##_tmp5 __asm("$ld$hide$os10.5$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp5 = 0; \
-    extern const char sym##_tmp6 __asm("$ld$hide$os10.6$_" #sym ); \
-          __attribute__((visibility("default"))) const char sym##_tmp6 = 0;
-#endif
-
+#define NOT_HERE_BEFORE_10_6(sym)
+#define NEVER_HERE(sym)
 
 #if defined(_LIBUNWIND_BUILD_ZERO_COST_APIS)
 
-- 
2.15.1

