<HTML>
<HEAD>
<TITLE>sqlite3 crashing jit</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
I’m trying to compile sqlite3 using llvm-gcc, then run it with lli. I’ve attached a Makefile and a main.c that simply invokes sqlite3_initialize(). You'll need to download sqlite3 (it was too big to attach) and copy main.c and the Makefile into the directory where sqlite3.c is [Link: sqlite-amalgamation-3_7_0_1.zip <<a href="http://www.sqlite.org/sqlite-amalgamation-3_7_0_1.zip">http://www.sqlite.org/sqlite-amalgamation-3_7_0_1.zip</a>> ]. The Makefile compiles sqlite3 with flags disabling pthreads and libdl.<BR>
<BR>
1) make <BR>
<BR>
This builds sqlite3 with llvm-gcc but does not emit llvm bitcode. It should create executable `test.gcc’ which should terminate normally.<BR>
<BR>
2) make LLVM=1<BR>
<BR>
This builds with the exact same flags as above, but with –emit-llvm added. It should create executable `test.llvm’ which is a just a script that invokes `lli’ on `test.llvm.bc’. This crashes lli (for me).<BR>
<BR>
In an effort to debug this, I’ve built llvm-2.6 with —disable-optimized and –ggdb against the llvm-gcc frontend because I thought that would give me a stacktrace when running lli under gdb, but no such luck. I tried running `lli –jit-emit-debug’ but lli says it doesn’t support that flag.<BR>
<BR>
Does anyone know why the jit crashes? If not, what’s the next step?<BR>
<BR>
Thanks.<BR>
<BR>
-Denis <BR>
</SPAN></FONT>
</BODY>
</HTML>