From f7780c97dc6756507f8f0402a5da78649f6abea9 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sat, 2 Apr 2016 20:45:55 +0000 Subject: [PATCH] Fix LLVM 3.9 build Force LLVM to emit the code before we look for function addresses. --- src/jitlayers.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)