gcj cross for ARM?

Anthony Green green@redhat.com
Thu Feb 20 20:03:00 GMT 2003


On Thu, 2003-02-20 at 10:04, G. Hauer wrote:
> Has anyone been able to build a gcj cross-compiler for ARM? Any pointers
> to current documentation would be appreciated.

Here's a very high level description.  If you need more details, please
ask.

There are a number of separate packages you need to be concerned with:
gcc, binutils, newlib and gdb.  For gcj hackers, I suggest using the
latest development sources for gcc, but stick with the most recent
stable releases of binutils, newlib and gdb.

I usually set my build area like this...

	../i     <- my "prefix", where I install everything
          /bgcc  <- where I build gcc
	  /gcc   <- gcc/newlib sources
 	  /bbin  <- where I build binutils
 	  /binutils-*  <- binutils sources
	  /bgdb  <- where I build gdb
	  /gdb   <- gdb sources

I'm sure there are cleaner ways of doing this, but this works for me.
Note that it's a good idea to merge the newlib and gcc source trees. 
Some targets, like mips-elf, don't configure properly if you don't copy
the newlib/newlib and newlib/libgloss directories into gcc/newlib and
gcc/libgloss.

Start with binutils...

	cd bbin
	../binutils/configure --target=arm-elf --prefix=`(cd ../i; pwd)`
	make all
	make install
	cd ..

Add the install dir to your path, so the gcc build machinery can find
arm-elf-as and arm-elf-ld....

	export PATH=`(cd i; pwd)`:$PATH

Then go to gcc...

	cd bgcc
	../gcc/configure --target=arm-elf --prefix=`(cd ../i; pwd)`
--enable-languages=c,c++,java
	make all
	make install
	cd ..
	
The, if you want to run your programs in gcc's simulator...

	cd bgdb
	../gdb/configure --target=arm-elf --prefix=`(cd ../i; pwd)`
	make all
	make install
	cd ..

And you're done.

AG




More information about the Java mailing list