This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Re: Problem with JNI, Creating Native code for JAVA



>I have seen a lot of questions about creating native code for JAVA with
>gcc and there are a lot of problems and it does not seem to be anyone
>who can answer them. Has anybody had success in doing so.

I haven't done it under gnuwin32, but I have done it under Solaris2
and Linux... You need to get a libgcc.a that is compiled with the
-fPIC/-fpic flag to allow linking in with a shared object (libgcc.a
contains a lot of support routines for gcc...)

I just did it by editing the gcc makefile (added -fPIC to CCLIBFLAGS
and LIBGCC2_CFLAGS).

You can then either make a libgcc.so (I assume libgcc.dll for
gnuwin32), or link the dynamically loaded routines with this new
libgcc.a).

I don't know how applicable it is to the gnuwin32 and .dlls, but I
suspect it is a similar problem.

Hope this helps,
 Andrew.
--
 Andrew Pollard, Auto Simulations Ltd. UK.  | home: andrew@odie.demon.co.uk
 2 Milbanke Court, Milbanke Way, Bracknell  | work: andrewp@autosim.com
Tel:+44(0)1344 426486 Fax:+44(0)1344 426615 | http://www.odie.demon.co.uk
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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