This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj, shared libraries, and -Bsymbolic

Andrew Haley wrote:

Richard Henderson writes:
> On Wed, Jan 26, 2005 at 09:54:58AM +0000, Andrew Haley wrote:
> > I know. However, at present this breaks CNI. The Right Way to solve
> > this is to fix CNI so that calls to Java methods use the Java
> > runtime's name resolution scheme. However, we have a pressing
> > deadline for the 4.0 release.
> > How much work do you think it is?

Hard to say because we don't have a complete design yet.

To call Java from CNI requires some static initialization code to be
generated to call Java's resolver for static method addresses,
classes, and so on.

To call CNI from Java requires some static initialization code to be
generated to register C++ methods with the java runtime.

One approach would be to have the C++ compiler emit something in the .jcr section to register CNI methods and indirect dispatch tables. This ties in with improving our class metadata, as CNI method registration should probably follow the same model that we use to register classes.

Apart from that, I think its mostly a matter of getting the declarations and code for BC-ABI dispatch from GCJ into the C++ front end somehow, and using it for extern "Java" calls. Ideally this should involve sharing, rather than duplicating, this code between the front ends - perhaps in a java-abi.c at the top level. Doing this is probably the hard part :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]