This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj on FreeBSD - unresolved externals with static link
"Tom Tromey" <tromey@redhat.com> wrote:
> I don't think any of the current gcj developers use FreeBSD. So
> unfortunately we'll have to rely on you for understanding of the bug,
> and perhaps even the fix.
I have fixed the bug on FreeBSD. The issue is that there is a
java/awt/List.o and a java/util/List.o, with java/util/List.o added first.
The libgcj.a is built using "ar rc", which does not compare path names when
added objects to the library. This means that the awt List.o overwrites the
util List.o, causing the problem.
My fix has been to change the ar flags to be "rcP" which copmares full path
names when adding objects to the library. Both list.o's make it in, and it
links fine, and also runs. I haven't tested it extensively, but simple for
loops, calls to System.out.println, System.out.flush and Thread.sleep seem
fine.
The big issue now is shared libraries. "hello, world" gives a SIGSEGV in
libjava/java/lang/natRuntime.cc, line 91, "if (finalize_on_exit)".
Modifying hello.java to have the println in a loop iterating 10000 times
gives a SIGSEGV in boehm-gc. I'm getting more information on this today.
Trivial diff against the 20011007 snapshot for the static linking problem:
*** ltconfig Wed Oct 10 12:30:58 2001
--- ltconfig~ Sat Jul 21 14:32:39 2001
***************
*** 1124,1130 ****
need_version=no
need_lc=no
need_lib_prefix=no
- AR_FLAGS="rcP"
;;
freebsd-*)
library_names_spec='${libname}${release}.so$versuffix
$libname.so$versuffix'
--- 1124,1129 ----
Jan Mikkelsen