Bug 30515 - mixing source (.java) and bytecode (.class) no longer works with gcj 4.3
Summary: mixing source (.java) and bytecode (.class) no longer works with gcj 4.3
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Blocks: 6993
  Show dependency treegraph
Reported: 2007-01-20 10:26 UTC by Marco Trudel
Modified: 2009-02-23 19:23 UTC (History)
2 users (show)

See Also:
Host: all
Target: all
Build: all
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Marco Trudel 2007-01-20 10:26:05 UTC
gcj -s -O2 --main=HelloWorld HelloWorld.java World.class -o foobar.exe

Works with gcj 4.2 but fails with gcj 4.3:
undefined reference to `java::lang::String* World::getWorld()'
collect2: ld returned 1 exit status


gcj -s -O2 --main=HelloWorld HelloWorld.java World.class -ofoobar.exe

(No space between "-o" and "foobar.exe"). That works with gcj 4.2 and the no space thing with gcj 4.3 usually too. But in this case, when compilation would fail anyway, it gives an internal compiler error:
C:\DOKUME~1\Marco\LOKALE~1\Temp/ccgrbaaa.jar:0: internal compiler error: in java_parse_file, at java/jcf-parse.c:1945
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

It's not really clear if it is a regression or if it was just luck that it worked before. It is, however, very useful to be able to compile mixed source and I actually run into trouble a couple of times already because of this. So I'd go for "fixing" this :-)

The see the discussion here: