On AIX 6.1 ppc64, in order to load libm.a, our application uses the System.loadLibrary("m")
.
Or it fails with an error message
the module has invalid magic number
According to IBM documentation, this can happen when there is a mismatch between 32 bits and 64 bits binaries. Or this happens whether we use Java6 (32 bits) or Java6_64 (64 bits) JVM. So it is NOT the case.
Another possible causes is /usr/lib/libm.a
is NOT a shared library. But we just can't find a shared mode libm.a
on the platform to use!
Acccdoring to Javadoc, in System.loadLibrary("name") , the mapping of "name" on to a real library is system dependent. On most Unix system, it is mapped to lib.so, while on AIX, it is mapped on to lib.a ; Note that on AIX, .a can be hybrid, ie. it can contain both static and shared object, 32 bits as well as 64 bits object. My problem is find a shared mode libm.a on AIX.
Does anybody know how to use System.loadLibrary("m")
to load a libm.a
?
P.S
System.loadLibrary("m")
works fine on most UNIX platforms we have tested.