public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/30292]  New: ICE on compiling .java by gcc(1)
@ 2006-12-26  5:37 jan dot kratochvil at redhat dot com
  2006-12-26  5:38 ` [Bug driver/30292] " jan dot kratochvil at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2006-12-26  5:37 UTC (permalink / raw)
  To: gcc-bugs

Compilation by naive gcj usage results in ICE instead of a complaint.

gcc-4.1.1, sources are the same in HEAD.

$ gcc -o hello hello.java
hello.java:1: internal compiler error: in uses_jv_markobj_p, at
java/boehm.c:245
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

Without ICE the result would be still confusing:
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../lib64/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'
/tmp/cc4WVJmk.o: In function `hello::main(JArray<java::lang::String*>*)':
hello.java:(.text+0x12): undefined reference to `_Jv_InitClass'
hello.java:(.text+0x20): undefined reference to `java::lang::System::class$'
hello.java:(.text+0x25): undefined reference to `_Jv_InitClass'
hello.java:(.text+0x2c): undefined reference to `java::lang::System::out'
/tmp/cc4WVJmk.o: In function `hello::hello()':
hello.java:(.text+0x61): undefined reference to `java::lang::Object::Object()'
/tmp/cc4WVJmk.o:(.data+0x80): undefined reference to
`java::lang::Object::finalize()'
/tmp/cc4WVJmk.o:(.data+0x88): undefined reference to
`java::lang::Object::hashCode()'
/tmp/cc4WVJmk.o:(.data+0x90): undefined reference to
`java::lang::Object::equals(java::lang::Object*)'
/tmp/cc4WVJmk.o:(.data+0x98): undefined reference to
`java::lang::Object::toString()'
/tmp/cc4WVJmk.o:(.data+0xa0): undefined reference to
`java::lang::Object::clone()'
/tmp/cc4WVJmk.o:(.data+0xa8): undefined reference to
`java::lang::Object::throwNoSuchMethodError()'
/tmp/cc4WVJmk.o:(.data+0x120): undefined reference to `vtable for
java::lang::Class'
/tmp/cc4WVJmk.o:(.data+0x148): undefined reference to
`java::lang::Object::class$'
/tmp/cc4WVJmk.o:(.eh_frame+0x12): undefined reference to `__gcj_personality_v0'
collect2: ld returned 1 exit status

Aware now the right way is to call: gcj -o hello --main=hello hello.java

Attached patch errors out by:
'hello.java' must be compiled by the java gcj(1) driver

but maybe some more spec-friendly solution would exist?

Originally submitted as:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=208454


-- 
           Summary: ICE on compiling .java by gcc(1)
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jan dot kratochvil at redhat dot com
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30292


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-29 20:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-26  5:37 [Bug driver/30292] New: ICE on compiling .java by gcc(1) jan dot kratochvil at redhat dot com
2006-12-26  5:38 ` [Bug driver/30292] " jan dot kratochvil at redhat dot com
2006-12-26 13:08 ` [Bug java/30292] " pinskia at gcc dot gnu dot org
2006-12-26 20:55 ` tromey at gcc dot gnu dot org
2006-12-27  2:52 ` pinskia at gcc dot gnu dot org
2006-12-27 11:14 ` tromey at gcc dot gnu dot org
2007-01-29 20:03 ` tromey at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).