This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: java class registration via .jcr section, take 3
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: Patch: java class registration via .jcr section, take 3
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Sat, 11 Aug 2001 14:48:47 +1000
- Cc: Tom Tromey <tromey at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Henderson <rth at redhat dot com>, Anthony Green <green at redhat dot com>, gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- References: <87ae17hlbl.fsf@creche.redhat.com> <Pine.LNX.4.10.10108101511250.23724-100000@mars.deadcafe.org>
On 10-Aug-2001, Jeff Sturm <jsturm@one-point.com> wrote:
>
> On 10 Aug 2001, Tom Tromey wrote:
>
> > >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
> >
> > Jakub> Not that much, since I think whenever you're linking in some
> > Jakub> Java code you really want to use gcj for the final link, so
> > Jakub> that it will bring needed libraries etc. (that will bring in
> > Jakub> -lstdc++ and -lc too).
> >
> > I don't really understand all the issues here.
> >
> > At some point we'll support the JNI invocation API. When we do this
> > it will be possible to write a simple C program which links against
> > the libgcj runtime and starts Java via some JNI calls.
> >
> > Won't we need the magic stuff in crt0 (or whereever) for this to work?
>
> Typically, that JNI program will dynmically load libgcj and other Java
> libs. Those DSOs will have the appropriate startup code for class
> registration.
>
> It should also be possible to statically link a JNI program, in which case
> the simplest thing is to do the final link with gcj.
OK, now suppose I'm trying to link a Mercury program with some Java
code. The Mercury program needs to be linked with `ml', the Mercury
linker, which is a wrapper around `gcc'. All of a sudden doing the
final link with gcj is not so simple.
The approach of requiring that you link with a particular program
really doesn't scale to multiple languages well. We made that mistake
with `ml', but please don't repeat it with `gcj'.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.