[kaffe] Re: Kaffe and MIPS CPUs

Jim Pick jim@kaffe.org
09 Jul 2002 12:15:28 -0700


On Tue, 2002-07-09 at 12:05, Mark and Janice Juszczec wrote:
> 
> Hello all
> 
> Since there have been some posts about Kaffe and MIPS, I thought I'd let 
> everyone know what I'm up to.  A side project a work has me trying to 
> compile Kaffe v1.0.7 to run on a Helio pda.  It runs
> a 75MHz Philips R3912 little endian mips processor.

Cool.  I've got about 8 of them here in a box.  :-)

(I did the original Linux kernel port to it)
 
> In order to get the hang of cross compiling something as large and involved 
> as Kaffe, I decided to start by compiling v1.0.5.  Its runs on MIPS, since I 
> downloaded the binary and libraries from kaffe.org.
> 
> I build the cross compile toolchain out of:
> 
> binutils-2.11.90.0.25
> glibc-2.2.3
> gcc-3.0.1
> 
> After some trial and error, I've come up with the following configure call:
> 
> CC=/usr/local/mipsel-linux/bin/gcc
> LD=/usr/local/mipsel-linux/bin/ld
> NM=/usr/local/mipsel-linux/bin/nm
> AR=/usr/local/mipsel-linux/bin/ar RANLIB=/usr/local/mipsel-linux/bin/ranlib  
> STRIP=/usr/local/mipsel-linux/bin/strip CXX=/usr/local/mipsel-linux/bin/gcc
> AS=/usr/local/mipsel-linux/bin/as
> KAFFEH=/usr/bin/kaffeh
> ../kaffe-1.0.5/configure --target=mipsel-linux --host=i686-pc-linux-gnu 
> --with-includes=/usr/local/mipsel-linux/include  
> --with-libraries=/usr/local/mipsel-linux/lib --with-engine=jit3 
> --cache-file=../helio.config.cache.working.1.0.5.v4
> 
> This compiles up to kaffe/kaffevm/jit3/machine.c which chokes on
> config/i386/trampolines.c giving:
> 
> /tmp/ccB9xikZ.s: Assembler messages:
> /tmp/ccB9xikZ.s:12663: Error: unrecognized opcode `call 
> soft_fixup_trampoline'
> /tmp/ccB9xikZ.s:12665: Error: unrecognized opcode `popl %ecx'
> /tmp/ccB9xikZ.s:12667: Error: unrecognized opcode `jmp *%eax'
> 
> 
> I don't have a mips assembly reference handy, but I'm guessing this file 
> contains some intel assemble code that needs to be rewritten.

Definitely.

> I'm more concerned that I'm compiling something that lives in config/i386.  
> Is this an error in my config?

I wouldn't be surprised to see that the configure script and/or
makefiles are broken.  You're probably better off working with the
latest stuff in CVS, and trying to apply some of the patches that have
been posted to the list recently.  I'm going to revisit the MIPS port in
few days, and see if I can get what's in CVS working.
 
> Jim, thanks for the reference to the Pocketlinux stuff.  I'll do some 
> comparisons and see if anything suggests itself.

That's probably the best place to start.  We had it running on the Helio
at one time (it was fun trying to get the kernel + libc + kaffe + class
libraries + applications to fit into 2MB of ROM).  It's a pity the Helio
didn't have a nicer screen and IR - then it would have been possible to
do a lot more with it. 

Cheers,

 - Jim