Patch: java class registration via .jcr section, take 3

Fergus Henderson fjh@cs.mu.oz.au
Fri Aug 10 21:48:00 GMT 2001


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.



More information about the Gcc-patches mailing list