[kaffe] questions about 1.0.6 on embedded mips

Brad Parker brad at parker.boston.ma.us
Thu Jun 6 08:08:47 PDT 2002


Hi,

I'm new here, so please forgive any ignorance on my part.

I'm been cross compiling 1.0.6 for an Alchemy AU1000 MIP board running
linux, using Montavista's HHL 2.0 (journeyman tools).

the au1000 is a MIPS32 cpu

the gcc/binutils are :
    gcc version 2.95.3 20010315 (release/MontaVista)
    GNU ld version 2.10.91 (with BFD 2.10.91.0.2)

on the target the kernel is 2.4.17

   libc.so.6 -> libc-2.2.3.so

It has floating point emulation built in.

I initially build with the jit turned on but the VM would crash, so I backed
off to a static build and the interpreter only.  Here's how I config:

CC=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-gcc \
CPP=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-cpp \
AR=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-ar \
LD=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-ld \
RANLIB=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-ranlib \
ac_cv_c_bigendian=no \
ac_cv_sizeof_short=2 \
ac_cv_sizeof_int=4 \
ac_cv_sizeof_long=4 \
ac_cv_sizeof_long_long=8 \
ac_cv_sizeof___int64=8 \
ac_cv_sizeof_voidp=4 \
KAFFEH=/work3/kaffe/x86/kaffe/kaffeh/kaffeh \
../kaffe-1.0.6/configure --prefix=/opt/kaffe/mips --host=mips-spartacus-linux-gnu --target=mips-spartacus-linux-gnu --with-includes= --without-x --with-staticvm --with-engine=intrp

This almost works but I crash with an unhandle exception

init-2.04# /opt/kaffe/mips/bin/java HelloWorld
Internal error: caught an unexpected exception.
Please check your CLASSPATH and your installation.
java/lang/ArithmeticException
        at java.util.HashMap.put(HashMap.java:116)
        at java.util.Hashtable.put(Hashtable.java:106)
        at java.lang.System.initProperties(System.java:native)
        at java.lang.System.<clinit>(System.java:47)
        at java.lang.ThreadGroup.add(ThreadGroup.java:86)
Aborted

I tracked this down to kaffe.def:define_insn(FDIV)

I added printf's of the args, and it's not dividing by zero.  And, sometimes
it works and sometimes it doesn't.  It's as if something is not initialized.

If I force the argument to int's and do an int divide the hello world works,
but caffine failes...

One thing has me puzzled.  In intrp/slots.c

    ...
    #define	stack(N)		(&sp[-(N)])
    #define	stack_long(N)		(&sp[-(N)-1])
    ...

What's with the "-1"?  The slots struct is a union and 8 bytes on my
machine.  So, it looks like all of the entries will be the same size -
this "-1" code looks like a vestige of an implementation where int's
and long's took up a different amount of space on the stack (but,
since the slot struct is a union, it seems like they will always take
up the same amount of space, 8 bytes).

This may have nothing to do with the fdiv problem, but I thought I'd
mention it.

am I lost in space?  Any advise on how to debug this?

-brad





More information about the kaffe mailing list