[LLVMdev] Segmentation fault - Kaleidoscope
Paul Melis
llvm at assumetheposition.nl
Wed Jun 17 11:04:44 PDT 2009
Chris Lattner wrote:
> On Jun 17, 2009, at 9:46 AM, Paul Melis wrote:
>
>
>> FWIW, I'm also suddenly experiencing segfaults in code that used to
>> work
>> 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
>> used
>> to do
>>
>> Module* Mod = makeLLVMModule(); // basically create a gcd
>> function
>> 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. :)
>
Hmm, I can see your commits from a few hours ago, but something was
already up a bit earlier. Anyways...
> For JIT applications, please include llvm/Target/TargetSelect.h and
> call the llvm::InitializeNativeTarget() function before creating an EE.
>
I just svn up-ped to r73620, recompiled and reinstalled LLVM and still
got 0x0 for the execution engine instance.
Found the problem: I didn't include "llvm/ExecutionEngine/JIT.h"
Paul
More information about the llvm-dev
mailing list