Hi Linghua,
There was a bug in the AOT compiler in revision 0.27 that got fixed in svn.
Also, note that the AOT compiler does not work with MMTk right now
(long-term plan to implement it), and that there is a bug with the GCMmap2
also that should be fixed soon.
By using svn versions of llvm and vmkit, you will soon be able to generate
libvmjc.so. And yes, consider yourself lucky if it "only" takes 80
minutes
to generate libvmjc.so on your machine :)
Cheers,
Nicolas
On Tue, Sep 28, 2010 at 3:48 PM, Linghua Tseng <uranus at tinlans.org>
wrote:
> I followed instructions in this page to setup my environment:
> http://vmkit.llvm.org/get_started.html
>
> My llvm, llvm-gcc, and vmkit are not SVN version.
> All of them are downloaded from this page:
> http://llvm.org/releases/download.html#2.7
> GNU classpath is downloaded from:
> ftp://ftp.gnu.org/gnu/classpath/classpath-0.97.2.tar.gz
> PNet & PNetlib are not used because I just want the JVM.
>
> I use these arguments to configure my VMKit:
> ./configure --prefix=/home/lhtseng/llvm
> --with-llvmsrc=/home/lhtseng/llvm/src/llvm
> --with-llvmobj=/home/lhtseng/llvm/obj/llvm
> --with-gnu-classpath-libs=/home/lhtseng/llvm/lib/classpath
>
> --with-gnu-classpath-glibj=/home/lhtseng/llvm/share/classpath/glibj.zip
> --with-llvmgcc
> --with-gc=mmtk
> and then use `make ENABLE_OPTIMIZED=1' to build it
> (I follow the instructions in this page:
> http://vmkit.llvm.org/use_mmtk.html)
> After it's done, `j3' works properly.
>
> Then I follow these instructions to enable AOT compilation:
> http://vmkit.llvm.org/use_aot.html
> * cd tools/vmjc/libvmjc
> * make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1
> And an error is occurred:
> ===========================================================> llvm[0]:
Compiling glibj.zip to llvm
> llvm[0]: Optimizing glibj.zip
> Instruction does not dominate all uses!
> %60 = getelementptr %MutatorThread* %59, i32 0, i32 6 ; <i1*>
[#uses=2]
> %191 = load i1* %60 ; <i1> [#uses=1]
> Instruction does not dominate all uses!
> %191 = load i1* %60 ; <i1> [#uses=1]
> br i1 %191, label %277, label %192
> Broken module found, compilation aborted!
> 0 opt 0x08489718
> Stack dump:
> 0. Program arguments: /home/lhtseng/llvm/obj/llvm/Release/bin/opt
> -std-compile-opts -f glibj.zip.bc -o glibj-optimized.zip.bc
> 1. Running pass 'Function Pass Manager' on module
'glibj.zip.bc'.
> 2. Running pass 'Module Verifier' on function
>
>
'@JnJVM_gnu_CORBA_CDR_VMVio_allocateObject__Ljava_lang_Class_2Ljava_lang_Class_2Ljava_lang_reflect_Constructor_2'
> ===========================================================>
> Someone suggested me to use GCMmap2 without llvm-gcc instead of MMTk.
> So I use the following arguments to reconfigure my VMKit:
> ./configure --prefix=/home/lhtseng/llvm
> --with-llvmsrc=/home/lhtseng/llvm/src/llvm
> --with-llvmobj=/home/lhtseng/llvm/obj/llvm
> --with-gnu-classpath-libs=/home/lhtseng/llvm/lib/classpath
>
> --with-gnu-classpath-glibj=/home/lhtseng/llvm/share/classpath/glibj.zip
> --with-gc=multi-mmap
> Now libvmjc.so can be generated (It takes 80+ minutes on Intel i7 920).
>
> I use this command for testing the AOT compilation:
> llcj --main=HelloWorld HelloWorld.class -o test
> A lot of undefined reference errors occurred:
> ===========================================================>
/home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `javax_xml_stream_util_XMLEventConsumer_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `javax_security_auth_Destroyable_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `java_io_FilenameFilter_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `java_awt_image_BufferedImageOp_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `gnu_javax_crypto_kwa_IKeyWrappingAlgorithm_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `javax_swing_table_TableColumnModel_VirtualMethods'
> /home/lhtseng/llvm/obj/vmkit/Release/lib/libvmjc.so: undefined reference to
> `org_w3c_dom_ls_LSParserFilter_VirtualMethods'
> ...
> ===========================================================> All of them
have the suffix `_VirtualMethods'.
>
>
> `nm libvmjc.so | grep
> javax_xml_stream_util_XMLEventConsumer_VirtualMethods' shows:
> ===========================================================>
U javax_xml_stream_util_XMLEventConsumer_VirtualMethods
> 031743b0 D javax_xml_stream_util_XMLEventConsumer_VirtualMethods3244
> ===========================================================>
> `nm liblibvmjc.so | grep
javax_security_auth_Destroyable_VirtualMethods'
> shows:
> ===========================================================>
U javax_security_auth_Destroyable_VirtualMethods
> 02f46fe0 D javax_security_auth_Destroyable_VirtualMethods1698
> ===========================================================>
> Do I miss some important steps?
>
> To checkout llvm, llvm-gcc, and vmkit from SVN's release_27 doesn't
help
> me.
> release_28 & trunk version of llvm cannot build the trunk version of
vmkit
> (llc complains it doesn't support '-f' option).
>
> My system environment is:
> Linux 2.6.33-gentoo #1 SMP Mon Apr 5 11:41:31 CST 2010 i686 Intel(R)
> Core(TM) i7 CPU 920 @ 2.67GHz GenuineIntel GNU/Linux
> gcc version 4.4.4 (Gentoo 4.4.4-r2 p1.2, pie-0.4.5)
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100928/c71955ff/attachment.html>