This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libgcj for Arm/Linux


Hi Folks,

I have built gcj (patched 2.95.2) and libgcj (patched 2000-03-02) for
ARM Linux on a NetWinder.  gcj went straight through without any
changes.  Libgcj just required a few simple mods:

zip/tailor.h:

	This file contains the following:

		#ifdef __arm
		#include "acorn/osdep.h"
		#endif

	so including RiscOS header files for all ARM compilers.  I
	don't know what the test for RiscOS is; I removed these lines.

boehm-gc/gcconfig.h:

	This file doesn't have any code to deal with ARM/Linux
	targets.  Thjere are two parts: identifying the target and
	setting various parameters.  The first is easy:

		# if defined (arm) && defined(LINUX)
		#    define ARM32
		#    define mach_type_known
		# endif
 
	For the second part, I took other Linux tagets as a base and
	modified and inserted it into the ARM section.  I have
	appended the fragment I used at the end of the message.

libffi/configure:

	It doesm't recognise the armv4l target.  I added

		armv4l-*-linux-*) TARGET=ARM; TARGETDIR=arm;;

	to the target case, but maybe `arm*-*-linux-*' would make more
	sense for the distribution.

Chris Dornan
cdornan@arm.com


----------------------------gcconfig.h insert----------------------------
# ifdef ARM32
#   define CPP_WORDSZ 32
#   define MACH_TYPE "ARM32"
#   define ALIGNMENT 4
#   ifdef NETBSD
#       define OS_TYPE "NETBSD"
#       define HEURISTIC2
        extern char etext;
#       define DATASTART ((ptr_t)(&etext))
#       define USE_GENERIC_PUSH_REGS
#   endif
#   ifdef LINUX
#	define OS_TYPE "LINUX"
#       define HEURISTIC1
#       undef STACK_GRAN
#       define STACK_GRAN 0x10000000
	/* STACKBOTTOM is usually 0xc0000000, but this changes with	*/
	/* different kernel configurations.  In particular, systems	*/
	/* with 2GB physical memory will usually move the user		*/
	/* address space limit, and hence initial SP to 0x80000000.	*/
#       if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
	/* libgcj: Linux threads don't interact well with the read() wrapper.
	   Not defining MPROTECT_VDB fixes this.  */
/* #	    define MPROTECT_VDB */
#	else
	    /* We seem to get random errors in incremental mode,	*/
	    /* possibly because Linux threads is itself a malloc client */
	    /* and can't deal with the signals.				*/
#	endif
#       ifdef __ELF__
#	     include <features.h>
#            define DYNAMIC_LOADING
#	     if defined(__GLIBC__) && __GLIBC__ >= 2
		 extern int __data_start;
#		 define DATASTART ((ptr_t)(&__data_start))
#            endif
#            if !defined(DATASTART)
#	       /* includes ro data */
	       extern int _etext;
#              define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
#            endif
	     extern int _end;
#	     define DATAEND (&_end)
#	else
	     extern int etext;
#            define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
#       endif
#       define USE_GENERIC_PUSH_REGS
#   endif
#endif
----------------------------gcconfig.h insert end------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]