This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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: Making shared objects with GCJ


Sal wrote:

I'm trying to build a shared object (.so, .dll) with GCJ. The purpose is
to make libraries for projects to use from any language.  I understand
that making .dlls on windows may not work yet, so .so will be fine for me
for the interim (I may try to cross compile later on).

I'm wondering is this currently possible? I know GCJ can generate .so
files, however the exported symbols are mangled, and you need CNI, or some
library to interoperate with them properly. I'm wondering if it would be
possible to make a .so with 'friendly' exported symbols that can easily be
used in any compiler that can load symbols from a .so.



You would do this by writing a connecting layer in C++ or C which exposes your library API as extern "C" functions. These glue functions would then call into your java code using CNI or JNI and the invocation APIs.


Regards

Bryce


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