[LLVMdev] How to run vmjc created .bc files?

Michael Wu mmwu at princeton.edu
Tue Dec 8 09:26:20 PST 2009


Hi,

    Thanks a lot for the help! I am getting some errors though:

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.

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?

llcj -mem2reg MemberVar.class
/usr/bin/ld: cannot find -lgc
collect2: ld returned 1 exit status

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?

Also, I have an addition to the Java standard library backported from 
Java 7, which is necessary for my project. JSR166: 
http://gee.cs.oswego.edu/dl/concurrency-interest/

Of course, I'm not sure JnJvm supports multiple cores, but this is more 
a proof of concept than anything.

Should I just insert the necessary classes into glibj.zip and recompile 
libvmjc.so?

Thanks,
Michael

nicolas geoffray wrote:
> Hi Michael,
>
> 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.
>
> 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.
>
> Let me know if that helped. I will write a more detailed howto on 
> vmkit's website in a few days.
>
> Nicolas
>
> On Sun, Dec 6, 2009 at 10:07 PM, Michael Wu <mmwu at princeton.edu 
> <mailto:mmwu at princeton.edu>> wrote:
>
>     Hi,
>
>        What do I need to link with vmjc created .bc files to actually run
>     the .bc file? I tried running with lli but only got:
>     LLVM ERROR: Program used external function 'StartJnjvmWithoutJIT'
>     which
>     could not be resolved!
>
>     Thanks,
>     Michael
>     _______________________________________________
>     LLVM Developers mailing list
>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>        
>     http://llvm.cs.uiuc.edu
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>



More information about the llvm-dev mailing list