[LLVMdev] Segmentation fault - Kaleidoscope
clattner at apple.com
Wed Jun 17 09:51:37 PDT 2009
On Jun 17, 2009, at 9:46 AM, Paul Melis wrote:
> FWIW, I'm also suddenly experiencing segfaults in code that used to
> a few days ago (I'm using svn). This may be unrelated to the problem
> described below, but perhaps it's the same thing.
> In my case it seems that creating an ExecutionEngine has changed. I
> to do
> Module* Mod = makeLLVMModule(); // basically create a gcd
> verifyModule(*Mod, PrintMessageAction);
> ExecutionEngine *EE;
> EE = ExecutionEngine::create(Mod);
> but I now get 0x0 for EE. The compile command I'm using is
> g++ -O3 -I ~/llvm/include/ -L ~/llvm bug.cpp `llvm-config --cxxflags
> --ldflags --libs core jit native` -o bug
> I noticed something very recently changed w.r.t. the way LLVM's
> libraries are built (no more .o files). Could this have something to
> with it?
I *just* changed this. :)
For JIT applications, please include llvm/Target/TargetSelect.h and
call the llvm::InitializeNativeTarget() function before creating an EE.
More information about the llvm-dev