problem with GCJ while running java code

Andrew Haley aph@redhat.com
Thu Feb 14 14:34:00 GMT 2008


gforgcc wrote:
> 
> Andrew Haley wrote:
>> I recently finished the work to port gcj to ARM.  It was on
>> the new ARM EABI, not the "old" one (which is what I think you have).
>>
>> http://wiki.debian.org/ArmEabiPort
>>
>> gcc 4.0.1 may or may not work with gcj.  Sorry.
>>
>> Andrew.
>>
>>
> 
> 
> oh.. Great andrew... :) thanks again for the valuable info..
> and can u please detail it """ what is new ARM EABI and what is OLD""" ?

That's why I posted the link.

> is there something wrong in my configuring options ? or the only problem is
> GCC verison i am using ? or some any other reasons ?

I have no way to know.

> and will you please suggest me what version of GCC can i cross compile for
> ARM architecture to get GCJ (cross compiled) to be working...

Top of trunk, i.e. http://gcc.gnu.org/svn/gcc/trunk

Get it with

svn co http://gcc.gnu.org/svn/gcc/trunk

> i.e. if i compile my java code using cross compiled GCJ (which will generate
> the executable for ARM) .. the executable should give the output.....
> Please give me some links or share your knowledge regarding how to Cross
> compile GCJ for ARM with working version specifications and configuring
> options... 

Cross compiling for ARM Linux is easy.  Here's how to do it on
Fedora 8.

You already have a cross-linker, assembler, etc.  Make sure they're
in your path.

Download http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f8.tar.bz2
and unpack it:

cd /local/x-arm-gcc/rootfs-f8
tar xf ~/rootfs-f8.tar.bz2

In the top level directory of the gcc source, do:

./contrib/download_ecj

Build gcc in a clean directory with --with-sysroot= pointing at your ARM
root filesystem:

/home/aph/gcc/trunk/configure --prefix=/local/x-arm-gcc/install \
--with-sysroot=/local/x-arm-gcc/rootfs-f8 --disable-libssp --disable-libgomp \
--disable-libmudflap --enable-libgcj --disable-bootstrap --disable-multilib \
--disable-static --disable-sjlj-exceptions --target=arm-linux-gnueabi --enable-languages=c,c++,java

make

make install

This should work equally well for Debian, etc.  You can use the root FS
from any ARM EABI Linux system.

Testing, first compiling on the x86 host:

$ /local/x-arm-gcc/install/bin/arm-linux-gnueabi-gcj Hello.java  --main=Hello

And then running on the target, with the a.out we just made:

$ ./a.out
Hello, World!

Andrew.



More information about the Java mailing list