[kaffe] Re: porting kaffe to arm/uCLinux

Andrea Scian andrea.scian at wawnet.biz
Wed Mar 10 10:20:03 PST 2004

> Hello again,

Hi Nick,

> first i want to thank Andrea and Holger for their help.
> There are no more errors while making, when i use the options:
> KAFFEH="/wrk2/usr/cad/nfaulwet/kaffe-native/bin/kaffeh" \
> CC="/usr/local/arm-elf/bin/gcc -elf2flt" \
> AR="/usr/local/arm-elf/bin/ar" \
> NM="/usr/local/arm-elf/bin/nm" \
> ../kaffe-1.1.4/configure \
> --host=arm-linux \
> --build=i586-linux \
> --with-rt-jar=/tmp/rt.jar \
> --enable-pure-java-math \
> --with-includes=/uClibc-0.9.11/include \
> --with-libraries=/uClibc-0.9.11/lib \
> --with-staticlib \
> --with-staticvm \
> --with-staticbin \
> --enable-static=yes \
> --disable-sound \
> --without-awt
> But the binaries create error-reports,
> when i run them on the ARM-board.
> Here is a list of the errors for the different binaries:
> # bin/kaffeh
> kaffeh: applet not found
> # bin/javac
> [: not found
> syntax error
> # bin/javah
> kaffeh: applet not found
> # jre/bin/kaffe-bin
> leads to a crash
> The other binaries in "bin" and "jre/bin" all show "syntax error".
> There are some things you could help me with:
> 1. If anyone has any idea, what i could try to make the binaries run,
please tell me.
> I have absolutely no idea what to do now.

The kaffe shell script (the one that you find under the bin directory and
that are called 'java', 'javac' and so on) cannot be run by the uClinux
shell (at least by sash and busybox-minix on my target) so you have to
manually run kaffe-bin from the jre/bin directory but first you have to set
some enviroment variable. I'm currently using:


On my target Kaffe in installed under the /kaffe directory.

> 2. To avoid the error-message "region flatmem is full" i increased the
> in the file "/usr/local/arm-elf/lib/elf2flt.ld". Can anyone tell me, how
bad this is (i suppose
> it is the reason my board dies when i start kaffe-bin). What possibilities
are there to
> make kaffe-bin smaller?
> 3. I know, that uClinux does not accept "fork()". But there are some
fork-calls in the
> source-files(e.g. in jthreads.c). If i simply replace them with vfork's,
then the threads
> will be executed one after the other, what surely isn't right. So does
anyone know how to
> let threads work parallel in uClinux at all? Or is there maybe a
configure-option for
> non-fork-supporting systems? (i saw configure printing "checking for
fork... yes". What happens,
> if the result is "no"?)

Never had that problem (fork() call exist but lead to system error when is
called). I'm not a "Kaffe internals" expert but I think that jthreads use
only one Linux thread to run all the Java threads, so that fork() call is
never done (I think it's used only to implement the external program
execution from Java code). I have also tried unix-pthread having some
problem with uClinux pthread implementation, so I suggest you to use the
unix-jthreads system.

> Thanks for your care. I wish you a nice day.


More information about the kaffe mailing list