JNA broken with r251668 as libc.so cant be loaded
Konstantin Belousov
kostikbel at gmail.com
Fri Oct 4 21:49:29 UTC 2013
On Fri, Oct 04, 2013 at 05:39:37PM -0400, Jung-uk Kim wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 2013-10-04 17:14:58 -0400, Jung-uk Kim wrote:
> > On 2013-10-04 11:20:00 -0400, Konstantin Belousov wrote:
> >> On Fri, Oct 04, 2013 at 02:07:09PM +0400, Sevan / Venture37
> >> wrote:
> >>> On 04/10/2013 09:08, Konstantin Belousov wrote:
> >>>> Does the source contain some workaround for Linux, already ?
> >>>> Linux uses script for libc.so for very long time, and should
> >>>> have the same issue unless code explicitely dlopen()s
> >>>> libc.so.6 or such.
> >>>
> >>>
> >>> No
> >>> https://svn.java.net/svn/jna~svn/trunk/jnalib/test/com/sun/jna/LibraryLoadTest.java
> >
> >>>
> >>>
> >> I do not know what should I see in the pointer you provided, and
> >> how it implies the answer 'No' to my question.
> >
> >> I just verified dlopen("libc.so") on some fresh Linux box, and
> >> the function returned expected error '/lib/libc.so: invalid ELF
> >> header'.
> >
> > I haven't verified it but it seems to have special case for Linux.
> > Please see:
> >
> > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.java#L206
> >
> >
> https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.java#L741
> > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.java#L768
>
> Verified.
> >
> This simple patch fixed the problem for me.
>
> http://people.freebsd.org/~jkim/jna.diff
The patch looks like a proper solution.
Thank you for figuring it out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-java/attachments/20131005/7c82ee5f/attachment.sig>
More information about the freebsd-java
mailing list