diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp --- a/libunwind/src/AddressSpace.hpp +++ b/libunwind/src/AddressSpace.hpp @@ -522,7 +522,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr, UnwindInfoSections &info) { -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) dyld_unwind_sections dyldInfo; if (_dyld_find_unwind_sections((void *)targetAddr, &dyldInfo)) { info.dso_base = (uintptr_t)dyldInfo.mh; diff --git a/libunwind/src/Unwind_AppleExtras.cpp b/libunwind/src/Unwind_AppleExtras.cpp --- a/libunwind/src/Unwind_AppleExtras.cpp +++ b/libunwind/src/Unwind_AppleExtras.cpp @@ -8,8 +8,6 @@ //===----------------------------------------------------------------------===// #include "config.h" -#include "AddressSpace.hpp" -#include "DwarfParser.hpp" // static linker symbols to prevent wrong two level namespace for _Unwind symbols diff --git a/libunwind/src/config.h b/libunwind/src/config.h --- a/libunwind/src/config.h +++ b/libunwind/src/config.h @@ -18,8 +18,12 @@ #include #include +#include <__libunwind_config.h> + // Platform specific configuration defines. -#ifdef __APPLE__ +#if defined(__USING_SJLJ_EXCEPTIONS__) + // None of these macros apply to SJLJ unwinding. +#elif defined(__APPLE__) #if defined(FOR_DYLD) #define _LIBUNWIND_SUPPORT_COMPACT_UNWIND 1 #else @@ -33,7 +37,7 @@ #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1 #endif #else - #if defined(__ARM_DWARF_EH__) || !defined(__arm__) + #if !defined(_LIBUNWIND_ARM_EHABI) #define _LIBUNWIND_SUPPORT_DWARF_UNWIND 1 #define _LIBUNWIND_SUPPORT_DWARF_INDEX 1 #endif @@ -81,7 +85,7 @@ #error Unsupported target #endif -#if (defined(__APPLE__) && defined(__arm__)) || defined(__USING_SJLJ_EXCEPTIONS__) +#if defined(__USING_SJLJ_EXCEPTIONS__) #define _LIBUNWIND_BUILD_SJLJ_APIS #endif @@ -91,8 +95,7 @@ #if defined(__i386__) || defined(__x86_64__) || \ defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) || \ - (!defined(__APPLE__) && defined(__arm__)) || \ - defined(__aarch64__) || \ + defined(__arm__) || defined(__aarch64__) || \ defined(__mips__) || \ defined(__riscv) || \ defined(__hexagon__)