Skip to content

Commit 035a1f5

Browse files
committed
jit: Adjust AArch64-only code for LLVM 21.
LLVM 21 changed the arguments of RTDyldObjectLinkingLayer's constructor, breaking compilation with the backported SectionMemoryManager from commit 9044fc1. llvm/llvm-project@cd58586 Backpatch-through: 14 Author: Holger Hoffstätte <holger@applied-asynchrony.com> Reviewed-by: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com> Discussion: https://postgr.es/m/d25e6e4a-d1b4-84d3-2f8a-6c45b975f53d%40applied-asynchrony.com
1 parent 11cc0f4 commit 035a1f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/jit/llvm/llvmjit_wrap.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(llvm::orc::ObjectLayer, LLVMOrcObjectLayerRef
118118
LLVMOrcObjectLayerRef
119119
LLVMOrcCreateRTDyldObjectLinkingLayerWithSafeSectionMemoryManager(LLVMOrcExecutionSessionRef ES)
120120
{
121+
#if LLVM_VERSION_MAJOR >= 21
122+
return wrap(new llvm::orc::RTDyldObjectLinkingLayer(
123+
*unwrap(ES), [](const llvm::MemoryBuffer&) {
124+
return std::make_unique<llvm::backport::SectionMemoryManager>(nullptr, true);
125+
}));
126+
#else
121127
return wrap(new llvm::orc::RTDyldObjectLinkingLayer(
122128
*unwrap(ES), [] { return std::make_unique<llvm::backport::SectionMemoryManager>(nullptr, true); }));
129+
#endif
123130
}
124131
#endif

0 commit comments

Comments
 (0)