LLVM: Cannot instantiate JIT execution engine

Hi, guys.

Have a strange problem with LLVM in my project (https://github.com/ababo/AntOS). Cannot instantiate JIT execution engine (NULL returns; message: Interpreter has not been linked in.). As you can see from the code I call InitializeNativeTarget. Also I tried to directly include the “llvm/ExecutionEngine/JIT.h” header, but with no success. I link with llvm-config --ldflags --libs core jit native, so there’s no problem here. Can you suggest me anything? Thanks.

Try to call ForceJITLinking::ForceJITLinking(); in your application.

Isn’t there someone to help me with this issue? I’m very upset about this stupid problem which wasted the whole day. BTW, I can create JIT from main.cpp, but not in the required source file (runtime.cpp), so this is not about linking. Very weird.

2011/9/2 Semion Prihodko <semion.ababo@gmail.com>

I see two problems in your code

1) you need to #include "llvm/ExecutionEngine/JIT.h"
2) you must pass an empty string to EngineBuilder::setErrorStr. See
JIT::createJIT for the reason.

Jeff

reason 2 might be specific to llvm-2.9 or earlier. looks like the code
is different now.