exception handling

Christian Stuellenberg gcj@stuellenberg.de
Wed Sep 17 19:16:00 GMT 2003


>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:

    Jeff> Mostly likely, the throw cannot cross the DLL boundary
    Jeff> unless you also link with a shared libgcc_s.dll.  That'll be
    Jeff> a problem with libgcj.dll.

Ok, I've recompiled my dynamic libgcj_d.dll with the following
command:
$ mingw32-gcj -shared `cat l2` -o libgcj_d.dll \
-Wl,--out-implib,libgcj_d.dll.a -Wl,--export-all-symbols

That seems to have worked without any problems.  I copied the
libgcj_d.dll to the same directory the CCTest.java resides.

Then again tried to recompile my example program with
$ mingw32-gcj -o c.exe --main=CCTest CCTest.java -L. -lgcj_d \
-Wl,--enable-runtime-pseudo-reloc

That produces me "only" really huge binaries.  So I assume this are
only static binaries (and indeed; I could execute the binary without
any libraries in the path).

So, I moved the libgcj_d.dll.a also to the directory where the
CCTest.java resides (and I compile the whole thing).

That gaves me:
/site.opt/mingw32-cross/lib/gcc/mingw32/3.4/../../../../mingw32/lib/libgcj.a(prims.o)(.text+0x630): In function `Jv_ThrowNullPointerException':
/tmp/rubber/cross/gcc-build/mingw32/libjava/../../../gcc-3.4-20030830/libjava/prims.cc:345: multiple definition of `_Jv_ThrowNullPointerException'
./libgcj_d.dll.a(d000068.o)(.text+0x0): first defined here

Ok, I tried with -Wl,--allow-multiple-definition but that also only
produces statically linked binaries.

So, what I'm doing wrong here?
Is my libgcj_d.dll[.a] not correctly build?
For what purpose do I need the libgcj_d.dll.a?
Why does the gcj not use my generated libgcj.dll?

Thnx in advance,
Christian



More information about the Java mailing list