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]

gcj-2.95.1 recipe for sparc-sun-solaris2.7


I'am finally able to say that gcj-2.95.1 now works on my
sparc-sun-solaris2.7 box. Here is the recipe.

1. To get gcc-2.95.1 working. The problem is to get as and ld to
work. Sun as and Sun ld seems to have problems, and binutils-2.9.1
is buggy too (see
http://egcs.cygnus.com/install/specific.html#sparc-sun-solaris*).
I had problems with recent snapshots of binutils too, until now,
when I installed binutils-991021
(http://sourceware.cygnus.com/binutils/). Install binutils in your
path (some makefiles use ld explicitly), and then explicitly tell
configure where to find them with --with-as= and --with-ld=, when
you compile gcc (otherwise /usr/css/bin/{as,ld} will be used
instead).

2. To get libgcj-2.95.1 working. The main problem is the garbage
collector. libgcj (both 2.95.1 and recent snapshots) is using
Boehm's gc4.12alpha2, but this version have problems finding the
stack base on SunOS 5.7, see
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/recent_changes.
I replaced the boehm-gc directory in libgcj with
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc5.0alpha3.tar.gz.

Then I copied the following files from the original boehm-gc
directory: configure.in configure.host acinclude.m4 aclocal.m4
Makefile.in Makefile.am quick_threads.c. I edited gc.h to include
GC_REGISTER_FINALIZER_NO_ORDER,
GC_register_finalizer_no_order. Execute ln -s gcconfig.h config.h,
and finally autoconf.

If you want to use threads (you specify --enable-threads to the
configure script for gcc and libgcj) you also have to edit
libjava/configure.in (fixed in snapshots of libgcj):

       THREADSPEC="$THREADSPEC -lrt"], [
         THREADSPEC="$THREADSPEC -lposix4"])])])

Execute (cd libjava; autoconf).

If you use threads you also have to set the stack limit to 8MB
(limit stack 8M in zsh). Otherwise you get a warning from the
garbage collector:

  Large stack limit(2147479552): only scanning 8 MB

See
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/recent_changes.

3. Do you still have problems with gcj-2.95.1? Try a snapshot of
gcc (ftp://egcs.cygnus.com/pub/egcs/snapshots/). I had for example
the following problem using -O1:

  Helicopter.o: In function `Helicopter::iterate(double)':
  Helicopter.o(.text+0xd8): undefined reference to `LLJv0'
  Helicopter.o(.text+0xdc): undefined reference to `LLJv0'
  Helicopter.o(.text+0xe0): undefined reference to `LLJv0'
  Helicopter.o(.text+0x150): undefined reference to `LLJv1'
  Helicopter.o(.text+0x154): undefined reference to `LLJv1'
  Helicopter.o(.text+0x158): undefined reference to `LLJv1'
  Helicopter.o: In function `Helicopter::derivatives_of(JArray<double> *)':
  Helicopter.o(.text+0x354): undefined reference to `LLJv2'
  Helicopter.o(.text+0x358): undefined reference to `LLJv2'
  Helicopter.o(.text+0x35c): undefined reference to `LLJv2'
  collect2: ld returned 1 exit status
  
egcs-19991013 seems to be okay (egcs-19991019 doesn't compile).

--
Patrik Hägglund

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