This is the mail archive of the
mailing list for the Java project.
A working libgcj.dll
- From: Anthony Green <green at redhat dot com>
- To: java at gcc dot gnu dot org
- Date: 23 Dec 2002 19:51:57 -0800
- Subject: A working libgcj.dll
The binutils and cygwin hackers have given us a little present...
$ ls -l hw.exe libgcj.dll
-rwxrwxr-x 1 green green 5632 Dec 23 19:25 hw.exe
-rwxrwxr-x 1 green green 6057984 Dec 23 19:25 libgcj.dll
$ wine hw.exe
Those are stripped sizes. Unstripped they are 381844 and 25216670 bytes
Here's what I did...
1) I configured and built an i686-pc-mingw32 cross toolchain for Linux.
Rather than use Ranjit's scripts/patches, I used the latest binutils
source and the GCC 3.3 branch directly. There were a couple of hiccups,
but it wasn't so bad.
2) I manually rebuilt libgcj like so....
$ i686-pc-mingw32-gcj -shared -o libgcj.dll -Wl,--out-implib,libgcj.a
3) Grab pseudo-reloc.c from the cygwin sources on sources.redhat.com.
(winsup/cygwin/lib/pseudo-reloc.c) This file is in the public domain,
so we could include it directly in libgcj for mingw32 toolchains
(careful to ignore it when targeting cygwin).
4) Compile the hello world app like so...
$ i686-pc-mingw32-gcj -o hw.exe --main=hw hw.java pseudo-reloc.c
We could simply add this last option to libgcj.spec.
The --export-all-symbols and --enable-runtime-pseudo-reloc options are
the new bits which make this work.
Now that we know this is possible, I'm hoping there's a motivated hacker
out there to help shoe-horn this into the libgcj build machinery.