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

* [Bug driver/30292] ICE on compiling .java by gcc(1)
  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 ` jan dot kratochvil at redhat dot com
  2006-12-26 13:08 ` [Bug java/30292] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2006-12-26  5:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jan dot kratochvil at redhat dot com  2006-12-26 05:38 -------
Created an attachment (id=12843)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12843&action=view)
Fix using a new gcc.c variable.

4.1.1 testsuite results not affected.


-- 


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


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

* [Bug java/30292] ICE on compiling .java by gcc(1)
  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 ` pinskia at gcc dot gnu dot org
  2006-12-26 20:55 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-26 13:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-12-26 13:08 -------
No, compiling .java should work with the gcc driver and if it does not, then
there is a bug there.  And we should not error out.

Also the ICE is a bug which needs to fixed seperately from the "driver" issue
anyways.

The result without the ICE is not confusing at all:

Without ICE the result would be still confusing at least to most
C/C++/Fortran/Ada programmers :):
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/../../../../lib64/crt1.o: In function
`_start':
(.text+0x20): undefined reference to `main'

that means you did not include a main function.

hello.java:(.text+0x12): undefined reference to `_Jv_InitClass'
that means you did not include the library libgcj.  These are all normal common
problems for beginner programmers.


-- 


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


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

* [Bug java/30292] ICE on compiling .java by gcc(1)
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-12-26 20:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2006-12-26 20:55 -------
FWIW making the gcc driver work properly here is not easy.
gcj reads a spec file with internal options in it.
These are required for the proper operation of jc1.


-- 


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


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

* [Bug java/30292] ICE on compiling .java by gcc(1)
  2006-12-26  5:37 [Bug driver/30292] New: ICE on compiling .java by gcc(1) jan dot kratochvil at redhat dot com
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-27  2:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-12-27 02:52 -------
(In reply to comment #3)
> FWIW making the gcc driver work properly here is not easy.
Why, every other language works the correct way.


-- 


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


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

* [Bug java/30292] ICE on compiling .java by gcc(1)
  2006-12-26  5:37 [Bug driver/30292] New: ICE on compiling .java by gcc(1) jan dot kratochvil at redhat dot com
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-12-27 11:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tromey at gcc dot gnu dot org  2006-12-27 11:14 -------
The reason we did this is that, when we wrote libgcj, we wanted to
be able to control various abi-changing things via command-line 
arguments.  And, the best place to do much of the checking was in
the libgcj configure script; many of the discoveries made here need to
be known both to libgcj and to gcj at compile-time.


-- 


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


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

* [Bug java/30292] ICE on compiling .java by gcc(1)
  2006-12-26  5:37 [Bug driver/30292] New: ICE on compiling .java by gcc(1) jan dot kratochvil at redhat dot com
                   ` (4 preceding siblings ...)
  2006-12-27 11:14 ` tromey at gcc dot gnu dot org
@ 2007-01-29 20:03 ` tromey at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-29 20:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tromey at gcc dot gnu dot org  2007-01-29 20:03 -------
I thought I'd point out that you'll have to submit this patch the
usual way; patches generally aren't reviewed in bugzilla.  Also
since this is a driver patch it probably won't get attention by
the appropriate people, since it is filed as a java bug.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-29 20:03:22
               date|                            |


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).