<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Some recent API changes require that the JIT have to be initialized
before use:<br>
<pre>#include "llvm/Target/TargetSelect.h"
</pre>
and use
<br>
// If we have a native target, initialize it to ensure it is linked in
and
<br>
// usable by the JIT.
<br>
InitializeNativeTarget();
<br>
<br>
<a class="moz-txt-link-freetext"
 href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090615/078885.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090615/078885.html</a>
<br>
<br>
the llvm examples including Kaleidoscope have been changed to use the
jit in this new way:
<br>
<a class="moz-txt-link-freetext"
 href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090615/078888.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090615/078888.html</a>
<br>
<br>
this will fix the 0x0 for EE error.<br>
<br>
Xerxes<br>
<br>
Den 2009-06-17 18:46, Paul Melis skrev:
<blockquote cite="mid:4A391DCB.8070307@assumetheposition.nl" type="cite">
  <pre wrap="">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?

Regards,
Paul


Juan Carlos Martinez Santos wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello,

Following the tutorial "Kaleidoscope: Adding JIT and Optimizer
Support", I found a Segmentation fault when I try to execute it. I am
new in the neighbourhood, so I don't know what is wrong. Could you
help me with that?

I am working with the last version of LLVM (2.5). The code in chapter
2 and 3 works good, but the code in the chapter 4 did not work.

Below are the detail of what I did.

Regards,

Juan Carlos

*********************************
<a class="moz-txt-link-freetext" href="http://llvm.org/docs/tutorial/LangImpl4.html#jit">http://llvm.org/docs/tutorial/LangImpl4.html#jit</a>

*********************************
./toy
ready> 4+5;
Segmentation fault

*********************************
Details using gdb:
*********************************
[New Thread 0xb7ca96c0 (LWP 9948)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7ca96c0 (LWP 9948)]
0x0804e914 in main ()
    at /usr/local/include/llvm/ExecutionEngine/ExecutionEngine.h:142
142      const TargetData *getTargetData() const { return TD; }


-- 
Juan Carlos
------------------------------------------------------------------------

_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
  
    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
  </pre>
</blockquote>
<br>
</body>
</html>