Bug 208454

Summary: java ICE - just on incorrect driver arguments
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: aph, tromey
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-26 19:33:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The "hello.java" trivia source referenced above none

Description Jan Kratochvil 2006-09-28 18:23:51 UTC
Description of problem:
Compilation by naive gcj usage results in ICE instead of a complaint.

Version-Release number of selected component (if applicable):
gcc-java-4.1.1-26.i386

How reproducible:
Always.

Steps to Reproduce:
1. gcc -o hello hello.java

Actual results:
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.

Expected results:
/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

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

Comment 1 Jan Kratochvil 2006-09-28 18:23:53 UTC
Created attachment 137329 [details]
The "hello.java" trivia source referenced above

Comment 2 Jakub Jelinek 2006-09-29 14:21:27 UTC
Note this happens also with gcc -o hello hello.class, so can't be simply
WONTFIXed as we don't support direct .java -> .o compilation using gcj.
When using the gcj driver as opposed to gcc, -fuse-boehm-gc is passed among
other options and with that switch this doesn't ICE.

Comment 3 Andrew Haley 2006-09-29 14:28:50 UTC
We should probably delete the -fuse-boehm-gc option, since we never use anything
else.  By the way, the best way to get stuff like this fixed is to file it upstream.


Comment 4 Tom Tromey 2006-09-29 18:25:31 UTC
In comment #2: I assume you mean we don't support direct .java->.o
compilation using *gcc* (not gcj)?

In comment #3: yeah, we should probably delete that option.
We still won't support using the gcc driver, though, since
there are other options passed via the .spec file.

Maybe we could make the gcc driver give an error if it sees
something intended for jc1.


Comment 5 Jan Kratochvil 2006-12-26 19:33:33 UTC
Posted upstream, simple patch included but ICE fix required by pinskia there:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30292