GNU bug report logs -
#9316
AIX and JNI: *.so versus *.a
Previous Next
Full log
View this message in rfc822 format
On Aug 17, 2011, at 4:58 PM, Daniel Richard G. wrote:
> Hello,
>
> I am using Libtool 2.4 to build Java JNI modules on AIX.
Hi,
If you add -Wl,-brtl to LDFLAGS at configure time, libtool will build plain .so's
Peter
>
> I've noticed that on AIX, a shared library is initially built as an .so
> file via "gcc -shared", but then this .so is packed up into an .a file
> using ar(1). This is the case even if -export-dynamic -module is
> specified.
>
> When I go to use these JNI modules, however, the JRE makes very clear
> that it doesn't like .a files:
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: jni_test ( 0509-022 Cannot load module /tmp/jni/libjni_test.a.
> 0509-103 The module has an invalid magic number.)
> at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:994)
> at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:958)
> at java.lang.System.loadLibrary(System.java:453)
> at com.example.jnitest.JniTest.<clinit>(JniTest.java:21)
> at java.lang.J9VMInternals.initializeImpl(Native Method)
> at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
> at JniTest.main(JniTest.java:56)
>
> If I extract the .so files from the .a files, however, the JRE happily
> uses those. Currently, I am using an install-exec-hook rule to perform
> this step during "make install". There does not appear to be a Libtool
> option to skip the use of ar(1), which would be a preferable approach.
>
>
> --Daniel
>
>
> --
> NAME = Daniel Richard G. _\|/_ Remember, skunks
> MAIL = skunk <at> iSKUNK.ORG (/o|o\) _- don't smell bad---
> MAIL+= skunk <at> alum.MIT.EDU < (^),> it's the people who
> WWW = (not there yet!) / \ annoy us that do!
>
>
>
> _______________________________________________
> Bug-libtool mailing list
> Bug-libtool <at> gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-libtool
>
--
Peter O'Gorman
http://pogma.com
This bug report was last modified 13 years and 306 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.