This is the mail archive of the 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]
Other format: [Raw text]

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
Hello World!
Goodbye World!

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
-Wl,--export-all-symbols [all-object-files-here]

3) Grab pseudo-reloc.c from the cygwin sources on
(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 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. 


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