10 messages in net.java.dev.jna.usersRE: [jna-users] libc loading on solaris
FromSent OnAttachments
Cauchie, JulienJul 9, 2008 5:15 am 
Cauchie, JulienJul 9, 2008 5:21 am 
Timothy WallJul 9, 2008 5:24 am 
Cauchie, JulienJul 9, 2008 5:35 am 
Timothy WallJul 9, 2008 5:50 am 
Cauchie, JulienJul 9, 2008 5:51 am 
Cauchie, JulienJul 9, 2008 7:04 am 
Timothy WallJul 9, 2008 8:04 am 
Anthony GreenJul 9, 2008 8:17 am 
Stefan EndrullisJul 9, 2008 9:17 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: [jna-users] libc loading on solarisActions...
From:Cauchie, Julien (juli@viveo.com)
Date:Jul 9, 2008 7:04:16 am
List:net.java.dev.jna.users

Ok, we made a build on our Solaris 8 - SunOS 5.8 box, and after a few changes, we successfully obtained a jar file.

The interesting bit is that, in the end, that jar worked successfully to locate and load libc.so.1

To reach that point, we had to make a few changes: - the Makefile.in had to be modified to correctly reference where libtool was
stored - some #define in native/libffi/src/sparc/v8.S where problematic: #ifdef SPARC64 #define WS 8 #define nword xword #define uanword uaxword #else #define WS 4 #define nword long #define uanword uaword #endif

after the preprocessor ran, the few lines that showed .nword and .uanword

ended up with: . long and . uaword

with an extra space. Something the compiler didn't like. To make sure it compiled, we just cheated and made the replacement that the pre-processor should have made.

Once this was done (and a few other changes in the Makefile to refer to our
local gcc), we got our jar, which we could use.

Now, it starts, it doesn't stumble on libc.so.1 anymore, but still, we have a
new issue:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load
library '/nfsusers/JCA/cif/bin/scanlibdll.so': ld.so.1: java: fatal: relocation
error: file /nfsusers/JCA/cif/bin/scanlibdll.so: symbol SetRootPublicInfos:
referenced symbol not found at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157) at com.sun.jna.Library$Handler.<init>(Library.java:123) at com.sun.jna.Native.loadLibrary(Native.java:260) at com.sun.jna.Native.loadLibrary(Native.java:246)

Probably something in the way our .so was made, because calling printf from java
did work, though. We'll continue our investigation, but it looks like it is possible to produce a
working jar file without the libc.so issue in a solaris 8 environment.

regards,

J.C.