diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index 5dca830e6e909..c39b10e0c7209 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -397,9 +397,12 @@ class JuliaOJIT { ); SmallVector,1> Ms; Ms.push_back(std::move(M)); - return CompileLayer.addModuleSet(std::move(Ms), - MemMgr, - std::move(Resolver)); + auto modset = CompileLayer.addModuleSet(std::move(Ms), MemMgr, + std::move(Resolver)); + // Force LLVM to emit the module so that we can register the symbols + // in our lookup table. + CompileLayer.emitAndFinalize(modset); + return modset; } void removeModule(ModuleHandleT H)