Bug 208454 - java ICE - just on incorrect driver arguments
java ICE - just on incorrect driver arguments
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-28 14:23 EDT by Jan Kratochvil
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-26 14:33:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The "hello.java" trivia source referenced above (104 bytes, text/plain)
2006-09-28 14:23 EDT, Jan Kratochvil
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 30292 None None None Never

  None (edit)
Description Jan Kratochvil 2006-09-28 14:23:51 EDT
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 14:23:53 EDT
Created attachment 137329 [details]
The "hello.java" trivia source referenced above
Comment 2 Jakub Jelinek 2006-09-29 10:21:27 EDT
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 10:28:50 EDT
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 14:25:31 EDT
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 14:33:33 EST
Posted upstream, simple patch included but ICE fix required by pinskia there:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30292

Note You need to log in before you can comment on or make changes to this bug.