Making VMKit2

Hi,

I’m trying to make VMKit & J3 on Ubuntu. I have followed the instructions at http://vmkit2.gforge.inria.fr/start.php. But after configuring vmkit2, when I’m making it using make ENABLE_OPTIMIZED=1, I receive the following:

  1. With this configuration:

ela@ela-VirtualBox:~/Desktop/vmkit2$ ./configure --with-llvmsrc=/home/ela/Desktop/llvm/ --with-llvmobj=/home/ela/Desktop/llvm/ --with-gnu-classpath-libs=/home/ela/Desktop/classpath-0.97.2/lib/ --with-gnu-classpath-glibj=/home/ela/Desktop/classpath-0.97.2/lib/ --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-classpath-impl=gnuclasspath --with-openjdk-path=/usr/lib/jvm/jav-gcj/

Then, the end part of the output is as follows:

make[2]: Entering directory `/home/ela/Desktop/vmkit2/mmtk/java’
Buildfile: /home/ela/Desktop/vmkit2/mmtk/java/build.xml

main:
[mkdir] Created dir: /home/ela/Desktop/vmkit2/mmtk/java/classes
[javac] Compiling 380 source files to /home/ela/Desktop/vmkit2/mmtk/java/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 warning
[jar] Building jar: /home/ela/Desktop/vmkit2/mmtk/java/mmtk-vmkit.jar

BUILD SUCCESSFUL
Total time: 7 seconds
llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
Illegal instruction
make[2]: *** [all] Error 132
make[2]: Leaving directory /home/ela/Desktop/vmkit2/mmtk/java' make[1]: *** [all] Error 1 make[1]: Leaving directory /home/ela/Desktop/vmkit2/mmtk’
make: *** [all] Error 1

  1. With another configuration as follows:
    ela@ela-VirtualBox:~/Desktop/vmkit2$ ./configure --with-llvmsrc=/home/ela/Desktop/llvm/ --with-llvmobj=/home/ela/Desktop/llvm/ --with-gnu-classpath-libs=/home/ela/Desktop/classpath-0.97.2/lib/ --with-gnu-classpath-glibj=/home/ela/Desktop/classpath-0.97.2/lib/ --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-classpath-impl=openjdk --with-openjdk-path=/usr/lib/jvm/java-7-openjdk/
    Then, the end part of the output is as follows:

llvm[3]: Compiling JnjvmClassLoader.s for Release+Asserts build
llvm[3]: Building Release+Asserts Archive Library libJ3.a
make[3]: Leaving directory /home/ela/Desktop/vmkit2/lib/j3/VMCore' make[3]: Entering directory /home/ela/Desktop/vmkit2/lib/j3/ClassLib’
make[4]: Entering directory `/home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK’
llvm[4]: Compiling ClasspathReflect.ll to ClasspathReflect.bc for Release+Asserts build (bytecode)
Method _ZN2j3L12getAttrBytesEPNS_8AttributEPNS_5ClassE has static linkage but uses gc_root. Functions using gc_root should not have static linkage.
0 opt 0x08eb8dc8
1 opt 0x08eb9344
2 0x40020400 __kernel_sigreturn + 0
3 0x40020416 __kernel_vsyscall + 2
4 libc.so.6 0x401b4c8f gsignal + 79
5 libc.so.6 0x401b82b5 abort + 373
6 StaticGCPass.so 0x40023f12
7 opt 0x08e3bf6c llvm::MPPassManager::runOnModule(llvm::Module&) + 588
8 opt 0x08e3f808 llvm::PassManagerImpl::run(llvm::Module&) + 168
9 opt 0x08e3f8f6 llvm::PassManager::run(llvm::Module&) + 38
10 opt 0x081a3457 main + 6103
11 libc.so.6 0x401a0113 __libc_start_main + 243
12 opt 0x081b888d
Stack dump:
0. Program arguments: /home/ela/Desktop/llvm//Release+Asserts/bin/opt /home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK/Release+Asserts/ClasspathReflect.ll -load=/home/ela/Desktop/vmkit2/Release+Asserts/lib/StaticGCPass.so -std-compile-opts -StaticGCPass -o /home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK/Release+Asserts/ClasspathReflect_gc.bc

  1. Running pass ‘Add GC information in files compiled with llvm-gcc’ on module ‘/home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK/Release+Asserts/ClasspathReflect.ll’.
    make[4]: *** [/home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK/Release+Asserts/ClasspathReflect_gc.bc] Aborted
    make[4]: Leaving directory /home/ela/Desktop/vmkit2/lib/j3/ClassLib/OpenJDK' make[3]: *** [all] Error 1 make[3]: Leaving directory /home/ela/Desktop/vmkit2/lib/j3/ClassLib’
    make[2]: *** [all] Error 1
    make[2]: Leaving directory /home/ela/Desktop/vmkit2/lib/j3' make[1]: *** [j3/.makeall] Error 2 make[1]: Leaving directory /home/ela/Desktop/vmkit2/lib’
    make: *** [all] Error 1

In both cases, I have only vmjc in the folder …/vmkit2/Release+Asserts/bin . Would you please help me to fix the problem?
Regards,
Ela

Hi Shahrokh,

Hi Nicolas,
I am so sorry for the questions. According to you, I built VMKit2 on Ubuntu11.10-desktop-amd64 on Intel(R) Corei5, and the previous problem solved. But another one appeared! With the following configuration:

elaheh@elaheh-Lenovo-G470:~/Desktop/vmkit2$ ./configure --with-llvmsrc=/home/elaheh/Desktop/llvm/ --with-llvmobj=/home/elaheh/Desktop/llvm/ --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-gnu-classpath-glibj=/home/elaheh/Desktop/classpath-0.97.2/lib/glibj.zip --with-gnu-classpath-libs=/home/elaheh/Desktop/classpath-0.97.2/lib/ --with-classpath-impl=gnuclasspath

next: elaheh@elaheh-Lenovo-G470:~/Desktop/vmkit2$ make VERBOSE=1 ENABLE_OPTIMIZED=1


then /bin/mv -f “/home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.bc.d.tmp” “/home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.bc.d”; else /bin/rm “/home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.bc.d.tmp”; exit 1; fi
llvm[2]: Compiling Selected.ll to Selected.bc for Release+Asserts build (bytecode)
/home/elaheh/Desktop/llvm//Release+Asserts/bin/opt /home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.ll -std-compile-opts -strip-debug -o /home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.bc
llvm[2]: Building Release+Asserts Bytecode Module MMTKAlloc.bc
/home/elaheh/Desktop/llvm//Release+Asserts/bin/llvm-link -o /home/elaheh/Desktop/vmkit2/Release+Asserts/lib/MMTKAlloc.bc /home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc/Release+Asserts/Selected.bc
make[2]: Leaving directory /home/elaheh/Desktop/vmkit2/mmtk/mmtk-alloc' make[2]: Entering directory /home/elaheh/Desktop/vmkit2/mmtk/java’
/usr/bin/ant -buildfile /home/elaheh/Desktop/vmkit2/mmtk/java/build.xml
Buildfile: /home/elaheh/Desktop/vmkit2/mmtk/java/build.xml

main:
[mkdir] Created dir: /home/elaheh/Desktop/vmkit2/mmtk/java/classes
[javac] Compiling 380 source files to /home/elaheh/Desktop/vmkit2/mmtk/java/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 warning
[jar] Building jar: /home/elaheh/Desktop/vmkit2/mmtk/java/mmtk-vmkit.jar

BUILD SUCCESSFUL
Total time: 6 seconds
llvm[2]: Building Release+Asserts mmtk-vmkit.jar all
/home/elaheh/Desktop/llvm//Release+Asserts/bin/opt -load=/home/elaheh/Desktop/vmkit2/Release+Asserts/lib/JITGCPass.so -std-compile-opts -JITGCPass -f /home/elaheh/Desktop/vmkit2/Release+Asserts/lib/MMTKAlloc.bc -o /home/elaheh/Desktop/vmkit2/Release+Asserts/lib/MMTKAlloc.bc
/home/elaheh/Desktop/vmkit2/Release+Asserts/bin/vmjc -std-compile-opts -load=/home/elaheh/Desktop/vmkit2/Release+Asserts/lib/MMTKRuntime.so -load=/home/elaheh/Desktop/vmkit2/Release+Asserts/lib/MMTKMagic.so -LowerMagic /home/elaheh/Desktop/vmkit2/mmtk/java/mmtk-vmkit.jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/,org/mmtk/policy/,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o mmtk-vmkit.bc -Dmmtk.properties=/home/elaheh/Desktop/vmkit2/mmtk/java/vmkit.properties -disable-stubs -assume-compiled
0 vmjc 0x0000000000eb84ef
1 vmjc 0x0000000000eb8a69
2 libpthread.so.0 0x00002b9a7357e060
3 libc.so.6 0x00002b9a7446ce24
4 vmjc 0x0000000000e96717 llvm::cl::generic_parser_base::findOption(char const*) + 55
5 vmjc 0x000000000059d038
6 vmjc 0x0000000000e600ec llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool) + 572
7 vmjc 0x0000000000aa1140 llvm::initializeBlockPlacementPass(llvm::PassRegistry&) + 144
8 vmjc 0x0000000000b35164 llvm::initializeScalarOpts(llvm::PassRegistry&) + 20
9 vmjc 0x000000000059b419 vmkit::VmkitModule::initialise(int, char**) + 57
10 vmjc 0x0000000000511160 main + 96
11 libc.so.6 0x00002b9a7436b30d __libc_start_main + 237
12 vmjc 0x000000000051103d
Segmentation fault
make[2]: *** [all] Error 139
make[2]: Leaving directory /home/elaheh/Desktop/vmkit2/mmtk/java' make[1]: *** [all] Error 1 make[1]: Leaving directory /home/elaheh/Desktop/vmkit2/mmtk’
make: *** [all] Error 1

Do you think the problem may be associated with building gnu classpath?
Would you please help me?
Regards,
Ela

Hi Ela,

I don’t know how up to date is vmkit2. The main vmkit repo (vmkit.llvm.org) is up to date (checked out yesterday) and compiles fine with vmkit trunk and llvm trunk.

Nicolas