Hi Michael,<div><br></div><div><br><div class="gmail_quote">On Tue, Dec 8, 2009 at 6:26 PM, Michael Wu <span dir="ltr"><<a href="mailto:mmwu@princeton.edu">mmwu@princeton.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
   Thanks a lot for the help! I am getting some errors though:<br>
<br>
I am on a 32 bit chroot on a x86_64 system. Thus llc guesses the wrong architecture from the module bitcode and spits out x86_64 assembly. I fixed this by adding "-march=x86" to the llc options in llcj.<br></blockquote>
<div><br></div><div>OK.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
gcc doesn't know what -lgc is. I'm guessing it is the garbage collection library. How can I get it or point gcc to the right library?<br></blockquote><div><br></div><div>-lgc is for the boehmgc in case you configured vmkit to use it. Since you don't need it (vmkit uses its own gc by default), you should change the tools/llcj/llcj.cpp file, remove the line with "-lgc" and recompile it. Yes, it's _that_ of a new feature yet :)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
llcj -mem2reg MemberVar.class<br>
/usr/bin/ld: cannot find -lgc<div class="im"><br>
collect2: ld returned 1 exit status<br>
<br></div>
If I have class files that depends on other class files, will llcj be able to find those and compile them into the executable as well?<br>
<br></blockquote><div><br></div><div>No, but you can create a big .jar file containing all the class files you need.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Also, I have an addition to the Java standard library backported from Java 7, which is necessary for my project. JSR166: <a href="http://gee.cs.oswego.edu/dl/concurrency-interest/" target="_blank">http://gee.cs.oswego.edu/dl/concurrency-interest/</a><br>

<br></blockquote><div><br></div><div>Add it to the big .jar file.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Of course, I'm not sure JnJvm supports multiple cores, but this is more a proof of concept than anything.<br>
<br></blockquote><div><br></div><div>OK, if it has native functions, chances are jnjvm does not implement them.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Should I just insert the necessary classes into glibj.zip and recompile libvmjc.so?<br>
<br></blockquote><div><br></div><div>You can do that, or just insert them to your .jar file. </div><div><br></div><div>Cheers,</div><div>Nicolas</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thanks,<br>
Michael<br>
<br>
nicolas geoffray wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Michael,<br>
<br>
Currently, you can run vmjc created .bc files by statically linking them with all the .o needed files. For that, you can use the llcj tool, which works more or less like GCC's gcj tool.<br>
<br>
Note that you also need to create the libvmjc.so file, which contains the standard library in native form. Do a make in the tools/vmjc/libvmjc directory. Once this is done, update the LD_LIBRARY_PATH shell variable to contain this file, and update PATH to contain the llvm tools and the vmkit tools. You will then be able to use llcj.<br>

<br>
Let me know if that helped. I will write a more detailed howto on vmkit's website in a few days.<br>
<br>
Nicolas<br>
<br></div><div class="im">
On Sun, Dec 6, 2009 at 10:07 PM, Michael Wu <<a href="mailto:mmwu@princeton.edu" target="_blank">mmwu@princeton.edu</a> <mailto:<a href="mailto:mmwu@princeton.edu" target="_blank">mmwu@princeton.edu</a>>> wrote:<br>

<br>
    Hi,<br>
<br>
       What do I need to link with vmjc created .bc files to actually run<br>
    the .bc file? I tried running with lli but only got:<br>
    LLVM ERROR: Program used external function 'StartJnjvmWithoutJIT'<br>
    which<br>
    could not be resolved!<br>
<br>
    Thanks,<br>
    Michael<br>
    _______________________________________________<br>
    LLVM Developers mailing list<br></div>
    <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>>            <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><div class="im">
<br>
    <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
<br>
</div></blockquote>
</blockquote></div><br></div>