Problem with converting a jar into a shared library with GCJ
David Michel <[email protected]>
| Newsgroups | gmane.comp.gcc.java.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I'm trying to 'convert' a jar file into a shared library (.so file) using gcj -shared -findirect-dispatch -fjni -fPIC with mixed results... While it works very well for some cases, it doesn't work at all sometimes. For insance, for the jline project (), it works like a charm: $ ls jline-0.9.94.jar $ gcj -O0 -g0 -shared -findirect-dispatch -fjni -fPIC -Bsymbolic jline-0.9.94.jar -o libjline-0.9.94.so $ ls jline-0.9.94.jar libjline-0.9.94.so With the gnu getopt port for java (http://www.urbanophile.com/arenn/coding/download.html), I get this kind of error: $ gcj -O0 -g0 -shared -findirect-dispatch -fjni -fPIC -Bsymbolic java-getopt-1.0.13.jar -o libgetopt-1.0.13.so GetoptDemo.java: In class 'GetoptDemo': GetoptDemo.java: In method 'GetoptDemo.main(java.lang.String[])': GetoptDemo.java:15: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>. It also gives a similar error message when I try to do this with a small java project that I wrote: $ gcj -O0 -g0 -shared -findirect-dispatch -fjni -fPIC Consoleterm.jar -o libconsoleterm.so Consoleterm/Consoleterm.java: In class 'Consoleterm.Consoleterm': Consoleterm/Consoleterm.java: In constructor '()': Consoleterm/Consoleterm.java:0: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>. Any idea what the problem is ? I have no idea on how to tackle this.... Cheers, David