[llvm] 5f7ace5 - [ORC] Mangle Dlfcn CI names as C (fixes MachO dlopen lookup) (#225392)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 14:57:31 PDT 2026


Author: Lang Hames
Date: 2026-09-23T07:57:25+10:00
New Revision: 5f7ace54653f8d5b27369c912912d3e6edc72455

URL: https://github.com/llvm/llvm-project/commit/5f7ace54653f8d5b27369c912912d3e6edc72455
DIFF: https://github.com/llvm/llvm-project/commit/5f7ace54653f8d5b27369c912912d3e6edc72455.diff

LOG: [ORC] Mangle Dlfcn CI names as C (fixes MachO dlopen lookup) (#225392)

The __orc_rt_jit_dl{open,update,close}_wrapper functions are C symbols
in the ORC runtime, so on Darwin their linker names carry a leading
underscore. The controller must resolve them under the C-mangled name.
The original LLJIT code did this via mangleAndIntern; the Proxy
conversion (#224881) used Verbatim by mistake, so on MachO the lookup
searched for the unmangled name and failed ("Symbols not found:
__orc_rt_jit_dlopen_wrapper"). Flip the Dlfcn descriptors to C to
restore the mangling. No runtime change is needed -- compiler-rt already
exports these as C symbols.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/Shared/SPSCI/DlfcnSPSCI.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SPSCI/DlfcnSPSCI.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SPSCI/DlfcnSPSCI.h
index 9850abfd23873..a16c704f13140 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SPSCI/DlfcnSPSCI.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SPSCI/DlfcnSPSCI.h
@@ -26,7 +26,7 @@ namespace llvm::orc::rt::sps_ci {
 /// dso handle.
 struct DlfcnOpen {
   static constexpr SymbolNameSpec Name =
-      SymbolNameSpec::verbatim("__orc_rt_jit_dlopen_wrapper");
+      SymbolNameSpec::c("__orc_rt_jit_dlopen_wrapper");
   using SPSSig = shared::SPSExecutorAddr(shared::SPSString, int32_t);
 };
 
@@ -34,7 +34,7 @@ struct DlfcnOpen {
 /// failure.
 struct DlfcnUpdate {
   static constexpr SymbolNameSpec Name =
-      SymbolNameSpec::verbatim("__orc_rt_jit_dlupdate_wrapper");
+      SymbolNameSpec::c("__orc_rt_jit_dlupdate_wrapper");
   using SPSSig = int32_t(shared::SPSExecutorAddr);
 };
 
@@ -42,7 +42,7 @@ struct DlfcnUpdate {
 /// failure.
 struct DlfcnClose {
   static constexpr SymbolNameSpec Name =
-      SymbolNameSpec::verbatim("__orc_rt_jit_dlclose_wrapper");
+      SymbolNameSpec::c("__orc_rt_jit_dlclose_wrapper");
   using SPSSig = int32_t(shared::SPSExecutorAddr);
 };
 


        


More information about the llvm-commits mailing list