This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: -findirect-dispatch: broken on Linux, working on Mingw?
- From: Andrew Haley <aph at redhat dot com>
- To: Marco Trudel <mtrudel at gmx dot ch>
- Cc: GCC Java <java at gcc dot gnu dot org>
- Date: Wed, 7 Mar 2007 10:45:54 +0000
- Subject: Re: -findirect-dispatch: broken on Linux, working on Mingw?
- References: <45EE9322.2020708@gmx.ch>
Marco Trudel writes:
> Hey all
>
> I once started a discussion that ecj1 can't be compiled for a host=Linux
> target=Linux static gcj: http://gcc.gnu.org/ml/java/2007-01/msg00082.html
> Back then, no one knew why the error occurred. I think I now stumbled
> over the answer:
>
> Having Test.java as a simple "HelloWorld" and working with the compiled
> class:
>
> On Linux:
> ---------
>
> static-gcj-for-lin Test.class --main=Test -findirect-dispatch
> -> /tmp/ccq2qpMg.o: In function `main':cc3Fk97a.i:(.text+0x30):
> undefined reference to `JvRunMainName'
> collect2: ld returned 1 exit status
>
> static-gcj-for-win Test.class --main=Test -findirect-dispatch
> -> works
>
I just can't imagine how indirect dispatch is ever going to work with
static linking. It certainly isn't designed to, and there are lots of
good technical reasons for believing it can't. The linker can't see
the symbols indirect dispatch uses, so can't find out what objects need
to be linked into the program.
> Any direct ideas? Otherwise I'll add a bugreport.
Short of fixing Mingw to work properly with shared libraries, no.
Andrew.