diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp @@ -85,7 +85,7 @@ } #endif -#ifdef HAVE_UNW_ADD_DYNAMIC_FDE +#if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__) template Error walkLibunwindEHFrameSection(const char *const SectionStart, @@ -123,13 +123,13 @@ return Error::success(); } -#endif // HAVE_UNW_ADD_DYNAMIC_FDE +#endif // defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__) Error registerEHFrameSection(const void *EHFrameSectionAddr, size_t EHFrameSectionSize) { /* libgcc and libunwind __register_frame behave differently. We use the * presence of __unw_add_dynamic_fde to detect libunwind. */ -#ifdef HAVE_UNW_ADD_DYNAMIC_FDE +#if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__) // With libunwind, __register_frame has to be called for each FDE entry. return walkLibunwindEHFrameSection( static_cast(EHFrameSectionAddr), EHFrameSectionSize, @@ -146,7 +146,7 @@ Error deregisterEHFrameSection(const void *EHFrameSectionAddr, size_t EHFrameSectionSize) { -#ifdef HAVE_UNW_ADD_DYNAMIC_FDE +#if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__) return walkLibunwindEHFrameSection( static_cast(EHFrameSectionAddr), EHFrameSectionSize, deregisterFrameWrapper); diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp @@ -69,7 +69,7 @@ /* libgcc and libunwind __register_frame behave differently. We use the presence * of __unw_add_dynamic_fde to detect libunwind. */ -#ifdef HAVE_UNW_ADD_DYNAMIC_FDE +#if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__) static const char *processFDE(const char *Entry, bool isDeregister) { const char *P = Entry;