Subject: Re: Problem with JNI, Creating Native code for JAVA
From: [email-masked] (Andrew Pollard)

26 Oct 1997 13:55:28 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
To: [email-masked]
Cc: [email-masked]

>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: [email-masked]
 2 Milbanke Court, Milbanke Way, Bracknell  | work: [email-masked]
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
"[email-masked]" with one line of text: "help".