This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
-findirect-dispatch problem
- From: Michael Baranov <michael dot baranov at gmail dot com>
- To: java at gcc dot gnu dot org
- Date: Thu, 1 Dec 2005 14:17:38 +0200
- Subject: -findirect-dispatch problem
Hello!
I'm compiling a java application of mine with Mohan Embar's GCC/GCJ
v.4.0.2 (http://www.thisiscool.com/gcc_mingw.htm)
The comands are:
gcj -c my.jar -o my.o -fjni -findirect-dispatch
gcj --main=My -o my.exe my.o -fjni
All goes smoothly, but at runtime it can not find org.w3c.dom.Document
class and many more alike that.
It looks like -findirect-dispatch modifies the code to lookup classes
at runtime AND prevents those classes
from being linked in (does not notice them during compillation?) All
those classes it looks for ARE in my libgcj.
Specifying --classpath or -I to point to libgcj-4.0.2.jar while
compiling doesn't help.
The linker does not demand additional libs.
Instead if I manually extract the classes it can not find (whole
packages) from libgcj-4.0.2.jar
and place them into my.jar - everything compiles and works fine. But
the size of the executable tells me that
code duplication happens then :-( And it is simply wrong...
So, I definetely miss something... It looks like I need to modify my
compile step and make the compiler see those
classes of interest in my libgcj.
Michael.
P.S. never imagined that gcj comunity could be that helpful!
Since I joined, none of my troubles remained unnoticed.
Thanks to all the members of the list and gcc/gcj team!