Summary
On aarch64 (Apple Silicon / Linux ARM64), building objit fails with 3 compile errors in ob_orc_jit.cpp related to ObJitMemoryManagerShim::reserveAllocationSpace and needsToReserveAllocationSpace.
Environment
- Platform: aarch64 (arm64), macOS 15.7.4
- LLVM headers: bundled devtools under
deps/3rd/usr/local/oceanbase/devtools/include/llvm/
- Affected target:
src/objit/src/CMakeFiles/objit_objects.dir/core/ob_orc_jit.cpp.o
Build errors
src/objit/src/core/ob_orc_jit.cpp:129:75: error: non-virtual member function marked 'override' hides virtual member function
129 | uintptr_t RWDataSize, uint32_t RWDataAlign) override
| ^
deps/3rd/usr/local/oceanbase/devtools/include/llvm/ExecutionEngine/RuntimeDyld.h:137:18: note: hidden overloaded virtual function 'llvm::RuntimeDyld::MemoryManager::reserveAllocationSpace' declared here: type mismatch at 2nd parameter ('Align' vs 'uint32_t' (aka 'unsigned int'))
137 | virtual void reserveAllocationSpace(uintptr_t CodeSize, Align CodeAlign,
| ^
src/objit/src/core/ob_orc_jit.cpp:131:16: error: 'reserveAllocationSpace' is a private member of 'oceanbase::jit::core::ObJitMemoryManager'
131 | delegate_->reserveAllocationSpace(CodeSize, CodeAlign,
| ^
src/objit/src/core/ob_jit_memory_manager.h:332:16: note: declared private here
src/objit/src/core/ob_orc_jit.cpp:138:23: error: 'needsToReserveAllocationSpace' is a private member of 'oceanbase::jit::core::ObJitMemoryManager'
138 | return delegate_->needsToReserveAllocationSpace();
| ^
src/objit/src/core/ob_jit_memory_manager.h:344:16: note: declared private here
Root cause
Two separate problems in the __aarch64__ block of ObJitMemoryManagerShim (ob_orc_jit.cpp):
1. LLVM API signature mismatch
Upstream LLVM RuntimeDyld::MemoryManager::reserveAllocationSpace now uses llvm::Align for alignment parameters:
virtual void reserveAllocationSpace(uintptr_t CodeSize, Align CodeAlign,
uintptr_t RODataSize, Align RODataAlign,
uintptr_t RWDataSize, Align RWDataAlign) {}
ObJitMemoryManagerShim still overrides with uint32_t align parameters, which does not match the base virtual and triggers the "hides virtual member function" error.
ObJitMemoryManager in ob_jit_memory_manager.h also still declares uint32_t align parameters (lines 332–336).
2. Private member access in shim
reserveAllocationSpace and needsToReserveAllocationSpace are private in ObJitMemoryManager. The shim calls delegate_->reserveAllocationSpace(...) directly, which fails access control.
The same file already works around this for finalizeMemory by routing through the base-class virtual:
return static_cast<llvm::RTDyldMemoryManager *>(delegate_)->finalizeMemory(ErrMsg);
The aarch64 callbacks need the same pattern (and updated signatures).
Suggested fix
- Update
ObJitMemoryManager::reserveAllocationSpace in ob_jit_memory_manager.h to use llvm::Align (convert to integer alignment inside the implementation when calling allocator_.reserve).
- In
ObJitMemoryManagerShim (ob_orc_jit.cpp), match LLVM’s Align signature in the override.
- Delegate via
static_cast<llvm::RTDyldMemoryManager *>(delegate_)->reserveAllocationSpace(...) and ->needsToReserveAllocationSpace(), mirroring finalizeMemory.
Relevant files
src/objit/src/core/ob_orc_jit.cpp (~lines 126–139, __aarch64__ shim)
src/objit/src/core/ob_jit_memory_manager.h (~lines 323–345)
deps/3rd/usr/local/oceanbase/devtools/include/llvm/ExecutionEngine/RuntimeDyld.h (~lines 137–143)
Workaround
None known without patching the sources above; the failure is a hard compile error on aarch64 builds that enable the JIT/objit path.
Summary
On aarch64 (Apple Silicon / Linux ARM64), building
objitfails with 3 compile errors inob_orc_jit.cpprelated toObJitMemoryManagerShim::reserveAllocationSpaceandneedsToReserveAllocationSpace.Environment
deps/3rd/usr/local/oceanbase/devtools/include/llvm/src/objit/src/CMakeFiles/objit_objects.dir/core/ob_orc_jit.cpp.oBuild errors
Root cause
Two separate problems in the
__aarch64__block ofObJitMemoryManagerShim(ob_orc_jit.cpp):1. LLVM API signature mismatch
Upstream LLVM
RuntimeDyld::MemoryManager::reserveAllocationSpacenow usesllvm::Alignfor alignment parameters:ObJitMemoryManagerShimstill overrides withuint32_talign parameters, which does not match the base virtual and triggers the "hides virtual member function" error.ObJitMemoryManagerinob_jit_memory_manager.halso still declaresuint32_talign parameters (lines 332–336).2. Private member access in shim
reserveAllocationSpaceandneedsToReserveAllocationSpaceare private inObJitMemoryManager. The shim callsdelegate_->reserveAllocationSpace(...)directly, which fails access control.The same file already works around this for
finalizeMemoryby routing through the base-class virtual:The aarch64 callbacks need the same pattern (and updated signatures).
Suggested fix
ObJitMemoryManager::reserveAllocationSpaceinob_jit_memory_manager.hto usellvm::Align(convert to integer alignment inside the implementation when callingallocator_.reserve).ObJitMemoryManagerShim(ob_orc_jit.cpp), match LLVM’sAlignsignature in the override.static_cast<llvm::RTDyldMemoryManager *>(delegate_)->reserveAllocationSpace(...)and->needsToReserveAllocationSpace(), mirroringfinalizeMemory.Relevant files
src/objit/src/core/ob_orc_jit.cpp(~lines 126–139,__aarch64__shim)src/objit/src/core/ob_jit_memory_manager.h(~lines 323–345)deps/3rd/usr/local/oceanbase/devtools/include/llvm/ExecutionEngine/RuntimeDyld.h(~lines 137–143)Workaround
None known without patching the sources above; the failure is a hard compile error on aarch64 builds that enable the JIT/objit path.