[llvm] Revert "[ORC] Use __unw_add_dynamic_eh_frame_section/__unw_remove_dyn… (PR #227894)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 21:59:21 PDT 2026


https://github.com/lhames updated https://github.com/llvm/llvm-project/pull/227894

>From 0878a33f290027037ea9039013b5462a1d334dc8 Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Thu, 1 Oct 2026 08:46:09 +1000
Subject: [PATCH] Revert "[ORC] Use
 __unw_add_dynamic_eh_frame_section/__unw_remove_dynamic_eh_ frame_section in
 RegisterEHFrames.cpp (#212260)"

Revert commit d49626c811c304c047e028a80cedc0d377f49dfb due to link
failures on some platforms (see discussion in PR).
---
 .../Orc/TargetProcess/RegisterEHFrames.cpp    | 25 +------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
index b64f7664f80f3..1856181e36788 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp
@@ -22,13 +22,6 @@ using namespace llvm::orc::shared;
 namespace llvm {
 namespace orc {
 
-#if !defined(_WIN32)
-extern "C" void
-__unw_add_dynamic_eh_frame_section(const void *) LLVM_ATTRIBUTE_WEAK;
-extern "C" void
-__unw_remove_dynamic_eh_frame_section(const void *) LLVM_ATTRIBUTE_WEAK;
-#endif
-
 #if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) &&          \
     !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
 
@@ -129,17 +122,8 @@ Error walkLibunwindEHFrameSection(const char *const SectionStart,
 
 Error registerEHFrameSection(const void *EHFrameSectionAddr,
                              size_t EHFrameSectionSize) {
-  // For libunwind after D111863.
-#if !defined(_WIN32)
-  if (__unw_add_dynamic_eh_frame_section &&
-      __unw_remove_dynamic_eh_frame_section) {
-    __unw_add_dynamic_eh_frame_section(EHFrameSectionAddr);
-    return Error::success();
-  }
-#endif
   /* libgcc and libunwind __register_frame behave differently. We use the
-   * presence of __unw_add_dynamic_fde to detect libunwind. The code below
-   * is for older Apple/LLVM libunwind versions. */
+   * presence of __unw_add_dynamic_fde to detect libunwind. */
 #if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
   // With libunwind, __register_frame has to be called for each FDE entry.
   return walkLibunwindEHFrameSection(
@@ -157,13 +141,6 @@ Error registerEHFrameSection(const void *EHFrameSectionAddr,
 
 Error deregisterEHFrameSection(const void *EHFrameSectionAddr,
                                size_t EHFrameSectionSize) {
-#if !defined(_WIN32)
-  if (__unw_add_dynamic_eh_frame_section &&
-      __unw_remove_dynamic_eh_frame_section) {
-    __unw_remove_dynamic_eh_frame_section(EHFrameSectionAddr);
-    return Error::success();
-  }
-#endif
 #if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
   return walkLibunwindEHFrameSection(
       static_cast<const char *>(EHFrameSectionAddr), EHFrameSectionSize,



More information about the llvm-commits mailing list