From owner-freebsd-java@FreeBSD.ORG Fri Oct 4 21:49:29 2013 Return-Path: Delivered-To: java@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BB95B568; Fri, 4 Oct 2013 21:49:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5774B28C4; Fri, 4 Oct 2013 21:49:29 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r94LnOF4061074; Sat, 5 Oct 2013 00:49:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r94LnOF4061074 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r94LnOYo061073; Sat, 5 Oct 2013 00:49:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 5 Oct 2013 00:49:24 +0300 From: Konstantin Belousov To: Jung-uk Kim Subject: Re: JNA broken with r251668 as libc.so cant be loaded Message-ID: <20131004214924.GB41229@kib.kiev.ua> References: <524DFB7D.2000207@gmail.com> <20131004050824.GK41229@kib.kiev.ua> <524E934D.70303@gmail.com> <20131004152000.GS41229@kib.kiev.ua> <524F2FD2.3020801@FreeBSD.org> <524F3599.4060708@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opzWO/wrBSGPRF8K" Content-Disposition: inline In-Reply-To: <524F3599.4060708@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: jlh@freebsd.org, java@FreeBSD.org, Sevan / Venture37 , Jimmy Olgeni X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 21:49:29 -0000 --opzWO/wrBSGPRF8K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 04, 2013 at 05:39:37PM -0400, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > 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 ?=20 > >>>> Linux uses script for libc.so for very long time, and should=20 > >>>> have the same issue unless code explicitely dlopen()s > >>>> libc.so.6 or such. > >>>=20 > >>>=20 > >>> No=20 > >>> https://svn.java.net/svn/jna~svn/trunk/jnalib/test/com/sun/jna/Librar= yLoadTest.java > > > >>>=20 > >>>=20 > >> I do not know what should I see in the pointer you provided, and=20 > >> how it implies the answer 'No' to my question. > >=20 > >> I just verified dlopen("libc.so") on some fresh Linux box, and > >> the function returned expected error '/lib/libc.so: invalid ELF=20 > >> header'. > >=20 > > I haven't verified it but it seems to have special case for Linux.=20 > > Please see: > >=20 > > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.= java#L206 > > > >=20 > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.ja= va#L741 > > https://github.com/twall/jna/blob/master/src/com/sun/jna/NativeLibrary.= java#L768 >=20 > Verified. > >=20 > This simple patch fixed the problem for me. >=20 > http://people.freebsd.org/~jkim/jna.diff The patch looks like a proper solution. Thank you for figuring it out. --opzWO/wrBSGPRF8K Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iQIcBAEBAgAGBQJSTzfjAAoJEJDCuSvBvK1BWBQP/3Ynfv/h9gt4zaKSsGqPEao6 JH2VDjYOr8ehGDwNW7LUMbzwYe5Jw9pP/bMYqEAxDCTTgneGqYrjkIfSKZzwo/BH pjJgQtf9AIh3GdLtvaOhMPgYaqUBu1vzbuP/FigAComdGIJygLuwsqYq7W26ZNTQ mmrwhNCiWG/Wa7zOWznxD5ksrDNf3EcUg8YtloB/pPRNHmartOf0THlCH44ufZnC F3gxcQtwrpeb6CqILZbbWgU1G0sELVsnZD1rkddVnbVm++TrRK8oR2Bn9Dc45tL2 CMSIiaJ0UeGHYbYb+and3mjmDfaQPDFjhbL0W1KDo0MRSL/NcTsNcHX6cNkjmia8 BLSIep3e7AqJ4qAM1W0cgvAkdBSkFWe0S9HUKRaIeyc/yE7LMehRd9sREZlE1vpB WXS0JYKmCQ4te+ivl2/1yIpsShAP5P6SqzhltWOnRKMh2W5CxGn37Cb2eOXRwltv CrAvizF1+Pgh4KJhkCq55fo1otWFwNLxKlGJxqPX4ODITsYwJcgoDUbte3evw2xO CC79VVigT++H+fPfbopbYMfGBFmcXAnaVIQcART1MP97kLAjTz96N2qZjXBtHFlH +v6FKlsXd9tA1K8B3Tv8PPpGTKcd4AuMbEzTtQvRnPwZdJy/pB+hBVsUlk7Wou0w WK2Ozujh2m94c3tybSxB =xlIu -----END PGP SIGNATURE----- --opzWO/wrBSGPRF8K--