diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp index 6f891afabfdc32..8816586f5a542b 100644 --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp @@ -85,7 +85,7 @@ static Error deregisterFrameWrapper(const void *P) { } #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 @@ Error walkLibunwindEHFrameSection(const char *const SectionStart, return Error::success(); } -#endif // HAVE_UNW_ADD_DYNAMIC_FDE +#endif // HAVE_UNW_ADD_DYNAMIC_FDE || __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 registerEHFrameSection(const void *EHFrameSectionAddr, 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 index 252e20c3c38c9f..42a6ed9578caca 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp @@ -69,7 +69,7 @@ static void __deregister_frame(void *p) { /* 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;