[llvm-dev] LLVM JIT 3.9 vs 6.0: How to emitAndFinalize multiple modules correctly?

Stanislav Pankevich via llvm-dev llvm-dev at lists.llvm.org
Wed May 16 12:06:04 PDT 2018


Hi all,

I am having hard time figuring out how I should use the API for JIT in LLVM 6.

In LLVM 3.9 I am used to adding all objects at once and
emitAndFinalizing them all:

handle = objectLayer.addObjectSet(objectFiles, memoryManager, resolver);
objectLayer.emitAndFinalize(handle);

In LLVM 6.0 the objects are added one by one:

auto handle = objectLayer.addObject(objectFile, resolver).get();
objectLayer.emitAndFinalize(handle);

The problem is that emitAndFinalize in this case works for one module
and JIT exits on
"LLVM ERROR: Program used external function 'XXXX' which could not be resolved!"
errors because it seems to not see the other modules loaded with addObject.

What am I missing?

Thanks,

Stanislav


More information about the llvm-dev mailing list