gcj gives an error "java/io/CharConversionException.class:0: internal compiler error: Segmentation fault" when asked to compile a jar file. Environment: System: Linux linuix 2.4.21-99-default #1 Wed Sep 24 13:30:51 UTC 2003 i686 athlon i386 GNU/Linux Architecture: i686 <machine, os, target, libraries (multiple lines)> host: i586-suse-linux-gnu build: i586-suse-linux-gnu target: i586-suse-linux-gnu configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux How-To-Repeat: $ LC_ALL=C CLASSPATH=libintl.jar /packages/gnu-inst-gcc/3.3/bin/gcj Hello.java libintl.jar --main=Hello -o Hello java/io/CharConversionException.class: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.
Fix: Workaround is to unpack the jar and compile its contents file by file.
This one's my fault. I've got a fix; before it can go in I have to figure out how to get a .jar compilation test case in libjava.
Subject: Bug 12996 CVSROOT: /cvs/gcc Module name: gcc Changes by: tromey@gcc.gnu.org 2003-11-10 21:30:10 Modified files: libjava/testsuite: ChangeLog Added files: libjava/testsuite/libjava.jar: jar.exp simple.jar simple.java simple.out simple.xfail Log message: For PR java/12996: * libjava.jar/simple.jar: New file. * libjava.jar/simple.xfail: New file. * libjava.jar/simple.out: New file. * libjava.jar/simple.java: New file. * libjava.jar/jar.exp: New file. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.298&r2=1.299 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jar/jar.exp.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jar/simple.jar.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jar/simple.java.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jar/simple.out.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jar/simple.xfail.diff?cvsroot=gcc&r1=NONE&r2=1.1
I spoke too soon; this one isn't my fault. Instead it looks like our support for compiling a .java file and a .jar file on the same command line is a bit weak. Another workaround, perhaps more palatable, is to compile each .java and .jar file separately to .o files, then link them together.
*** Bug 12202 has been marked as a duplicate of this bug. ***
Closing as won't fix as the Java front-end has been removed from the trunk.