Skip to content

Commit 1ae8018

Browse files
liushuyukinke
authored andcommitted
jit-rt: avoid double registering EHFrame plugin ...
... when using LLVM JITLink on LLVM 20+
1 parent 14050a6 commit 1ae8018

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/jit-rt/cpp-so/jit_context.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ static llvm::orc::LLJITBuilder buildLLJITforLDC() {
113113
// we override the object linking layer if we are using LLVM JITLink.
114114
// For RuntimeDyld, we use LLJIT's default setup process
115115
// (which includes a lot of platform-related workarounds we need)
116-
#ifdef LDC_JITRT_USE_JITLINK
116+
// on LLVM 20+, LLJIT will auto-configure eh-frame plugin and
117+
// we avoid configuring the eh-frame plugin ourselves to avoid double registration
118+
#if defined(LDC_JITRT_USE_JITLINK) && LDC_LLVM_VER < 2000
117119
.setObjectLinkingLayerCreator([&](llvm::orc::ExecutionSession &ES,
118120
const llvm::Triple &TT) {
119121
auto linker = std::make_unique<llvm::orc::ObjectLinkingLayer>(

0 commit comments

Comments
 (0)