Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 25821 - GCJ fails to compile hello world (internal compiler error)
Summary: GCJ fails to compile hello world (internal compiler error)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
: 29152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-08-03 10:49 UTC by Joel Palmius
Modified: 2004-01-03 21:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
HelloWorld.java (HelloWorld.java,255 bytes, text/plain)
2003-10-29 16:33 UTC, Adrian Almenar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Palmius 2003-08-03 10:49:09 UTC
Java code (compiles fine with blackdown): 

public class hello
{
  public static void main(String[] args)
  {
    System.out.println("Hello\n");
  }
}

Compile attempt:

ligur tmp # gcj hello.java
hello.java:1: Internal compiler error in make_class_data, at java/class.c:1676
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
ligur tmp #

GCJ version:

ligur tmp # gcj -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcj.spec
rename spec lib to liborig
Configured with: /var/tmp/portage/gcc-3.2.3-r1/work/gcc-3.2.3/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enable-shared
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib
--enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix
--enable-long-long --disable-checking --enable-cstdio=stdio
--enable-clocale=generic --enable-__cxa_atexit
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include/g++-v3
--with-local-prefix=/usr/local --enable-shared --enable-nls
--without-included-gettext
Thread model: posix
gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
ligur tmp #

Compile attempt with syntactically erronous java code (having inserted "blurk!?"
as the first line in the code file):

ligur tmp # gcj hello.java
hello.java:1: Class or interface declaration expected.
   blurk!?
   ^
1 error
ligur tmp #

(Thus the syntax checking works fine, the problem arises later than that)


Reproducible: Always
Steps to Reproduce:
1.Write a hello world java file
2.Try to compile it with GCJ
3.

Actual Results:  
It failed with an internal compiler error

Expected Results:  
It should have produced a native machine code executable. (Or, actually, it
should probably have complained that I hadn't specified the "main" class. Doing
this doesn't help though). 

Portage 2.0.48-r5 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1)
=================================================================
System uname: 2.4.21_rc8-gss-jp5 i686 AMD Athlon(TM) XP 1800+
GENTOO_MIRRORS="http://skrotix.itm.mh.se/gentoo http://gentoo.oregonstate.edu/
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /opt/tomcat/conf
/usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow avi crypt encode foomaticdb gif jpeg libg++ mad mikmod mmx
mpeg ncurses nls pdflib png quicktime spell xml2 xmms xv zlib gtkhtml alsa gdbm
berkdb slang readline arts tetex aalib bonobo svga tcltk java guile ruby X sdl
gpm tcpd pam libwww ssl python esd imlib oggvorbis gtk qt kde motif opengl -apm
cups apache2 cdr dga dvd -fbcon gd gnome imap matrox mbox mozilla mysql perl
postgres samba truetype directfb wmf"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe"
CXXFLAGS="-march=athlon-xp -O3 -pipe"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache fixpackages"
Comment 1 Joshua Kinard gentoo-dev 2003-10-29 15:37:45 UTC
*** Bug 29152 has been marked as a duplicate of this bug. ***
Comment 2 Adrian Almenar 2003-10-29 16:33:25 UTC
Created attachment 19955 [details]
HelloWorld.java

HelloWorld.java i tested
Comment 3 Adrian Almenar 2003-10-29 16:34:53 UTC
I compiled it with this command line:

gcj
--classpath=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/java/libgcj-3.3.2.jar
-o HelloWorld --main=HelloWorld HelloWorld.java

Generated file says:
HelloWorld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.6.0, dynamically linked (uses shared libs), not stripped
Comment 4 Matthew Kennedy (RETIRED) gentoo-dev 2004-01-03 21:28:55 UTC
I am pretty sure this can be resolved.  The bug reporter should check what CLASSPATH environment variable is defined (it probably contains the blackdown .rt.jar etc)

mkennedy@killr:~$ gcj --bootclasspath=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/java/libgcj-3.3.2.jar --classpath="" -o HelloWorld HelloWorld.java --main=HelloWorld
mkennedy@killr:~$ ./HelloWorld
Starting
Finished