[kaffe] Use Kaffe as bootstraping JavaVM for JC

jserv at linux2.cc.ntu.edu.tw jserv at linux2.cc.ntu.edu.tw
Tue Apr 27 02:25:03 PDT 2004


Hi all,

  JC Virtual Machine[1] takes an unusual way to implement JavaVM via
converting class files into C source files using the Soot[2] Java 
bytecode analysis framework, compiles them with GCC, and loads them 
using a built-in ELF object file loader. The documents shipped with 
JC mentions that JC needs Java2 compatible runtime for generating
codes. I attempted to use Kaffe as bootstrapping JavaVM for JC, and
it worked fortunately. Here is my instruction:

* Download classpath-0.08
  # wget http://ftp.gnu.org/gnu/classpath/classpath-0.08.tar.gz

* build and install Classpath
  # ./configure --prefix=/usr/local/jc --enable-jni --with-jikes
  # make install

* patch JC-1.1 with the following:

diff -u jc-1.1/configure jc-1.1-fixed/configure
--- jc-1.1/configure    2004-04-12 00:35:44.000000000 +0800
+++ jc-1.1-fixed/configure      2004-04-15 20:47:02.000000000 +0800
@@ -1171,7 +1171,7 @@
 uname -s = `(uname -s) 2>/dev/null || echo unknown`
 uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/usr/bin/uname  = `(/usr/bin/uname) 2>/dev/null || echo unknown`
 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
 
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo
unknown`
@@ -9807,7 +9807,7 @@
 
 
 # Get host architecture
-JC_ARCH=`uname -p | sed -e 's/i[456]86/i386/g'`
+JC_ARCH=`uname -m | sed -e 's/i[456]86/i386/g'`

* Build and install JC
  # JAVA=/usr/lib/kaffe/bin/kaffe sh configure --prefix=/usr/local
  # make install

  where JAVA indicates where Kaffe was installed. I found JC could
  cooperate with Kaffe version 1.1.4.

* Create your personalized .jc startup file (~/.jc)
  # JC defaults
  verbose=gc,gen

* consult JC's manual for advanced usage
  # jc --help

That's all.

cheers,
Jim Huang
 
[1] http://jcvm.sourceforge.net/
[2] http://www.sable.mcgill.ca/soot/





More information about the kaffe mailing list