Bug 12893 - The included test case does not link
Summary: The included test case does not link
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks: 13607 19758
  Show dependency treegraph
 
Reported: 2003-11-04 08:22 UTC by oyvind.harboe
Modified: 2007-01-30 20:08 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-20 18:44:19


Attachments
Testcase that does not compile when running compile.cmd (803.74 KB, application/x-zip-compressed)
2003-11-04 08:23 UTC, oyvind.harboe
Details
Linking errors (204 bytes, text/plain)
2003-11-04 08:24 UTC, oyvind.harboe
Details
Update of testcase1 that includes a makefile (288.92 KB, application/octet-stream)
2004-01-08 17:10 UTC, dog@bluezoo.org
Details

Note You need to log in before you can comment on or make changes to this bug.
Description oyvind.harboe 2003-11-04 08:22:32 UTC
I think it is supposed to link.

http://gcc.gnu.org/ml/java/2003-10/msg00304.html
Comment 1 oyvind.harboe 2003-11-04 08:23:50 UTC
Created attachment 5052 [details]
Testcase that does not compile when running compile.cmd
Comment 2 oyvind.harboe 2003-11-04 08:24:16 UTC
Created attachment 5053 [details]
Linking errors
Comment 3 Andrew Pinski 2003-11-09 02:34:16 UTC
I had look into the and the problem was that one of the class files calls the super's 
functions and the super class was abstract so it was causing a link problem.  Is there any 
way to get the source to gnu.inet.ftp.* classes, I could not find them any where.
Comment 4 dog@bluezoo.org 2003-11-09 09:25:21 UTC
Subject: Re:  The included test case does not link

pinskia at gcc dot gnu dot org wrote:
> I had look into the and the problem was that one of the class files 
> calls the super's
> functions and the super class was abstract so it was causing a link 
> problem.  Is there any
> way to get the source to gnu.inet.ftp.* classes, I could not find them 
> any where.

from classpath cvs, module inetlib.

thanks for looking into it,
Comment 5 Andrew Pinski 2003-11-09 19:09:22 UTC
The code does excatlly what I said it did.
GCJ should have rejected this code when compiling to *.class like javac does:
D.java:13: abstract method f() cannot be accessed directly
  void f(){super.f();}
                ^
1 error


Simplified version:
class A
{
  void f(){}
}
abstract class B extends A
{
  abstract void f();
}
class C extends B
{
  void f(){super.f();}
}

Can you report my findings to classpath for this module?
Comment 6 dog@bluezoo.org 2004-01-08 17:10:31 UTC
Created attachment 5435 [details]
Update of testcase1 that includes a makefile

I've created a makefile that should be a bit more portable, and attempted to
build using that.
The original error(s) were not specified on the bugzilla issue. make gives me:

/usr/local/bin/gcj -c -o activation.o
--classpath=/usr/local/share/java/libgcj-3.4.jar activation.jar
/var/tmp//cclKloMi.s:23974:FATAL:Symbol
__GLOBAL__I__ZN3gnu10activation16MagicFileTypeMapC1Ev already defined.
make: *** [activation.o] Error 1

I can build javax-security.o and send.o, but the others all give this
already-defined error.
Comment 7 dog@bluezoo.org 2004-01-08 17:14:24 UTC
Comment on attachment 5435 [details]
Update of testcase1 that includes a makefile

I've created a makefile that should be a bit more portable, and attempted to
build using that.
The original error(s) were not specified on the bugzilla issue. make gives me:

/usr/local/bin/gcj -c -o activation.o
--classpath=/usr/local/share/java/libgcj-3.4.jar activation.jar
/var/tmp//cclKloMi.s:23974:FATAL:Symbol
__GLOBAL__I__ZN3gnu10activation16MagicFileTypeMapC1Ev already defined.
make: *** [activation.o] Error 1

I can build javax-security.o and send.o, but the others all give this
already-defined error.
Comment 8 Andrew Pinski 2004-01-08 18:17:03 UTC
Note what exact version are you using to get the link errors?
Comment 9 Tom Tromey 2004-01-09 07:12:58 UTC
I tried this tonight.
I had to edit the Makefile a bit to get things to work.

I see the same errors that Andrew sees in comment #3.
I don't see a duplicate definition.

This PR looks like it might be related to Bug 13273.
How did you generate the .class files in question?
Was it with gcj or some other compiler?

I'm using
gcj (GCC) 3.4.0 20040107 (experimental)
Comment 10 Tom Tromey 2007-01-30 20:08:54 UTC
I believe this is now fixed.