Java System.loadLibrary ("m") error on AIX 6.1

On AIX 6.1 ppc64, our application uses System.loadLibrary("m") to download libm.a. Or it crashes with an error message

module has an invalid magic number

According to IBM documentation, this can happen if there is a mismatch between 32 bits and 64 bits. Or this happens if we use the Java6 (32 bit) or Java6_64 (64 bit) JVM. So this is not so.

Other possible reasons: /usr/lib/libm.a NOT a shared library. But we just cannot find the generic libm.a mode on the platform to use!

By purchasing Javadoc in System.loadLibrary ("name"), the mapping of "name" to a real library is system dependent. On most Unix systems, it maps to lib.so, while on AIX it maps to lib.a; Note that on AIX, .a may be hybrid, i.e. it can contain both a static and a general object, 32 bits, as well as a 64-bit object. My problem is finding libm.a generic mode on AIX.

Does anyone know how to use System.loadLibrary("m") to load libm.a ?

PS System.loadLibrary("m") works fine on most of the UNIX platforms we tested.

+4
source share
1 answer

You can use 'dump -H' (the equivalent of AIX ldd) to verify that libm.a is a shared library. The file command should distinguish between 32-bit and 64-bit libraries, but AIX also supports hybrid 32-bit and 64-bit in the same library. If the file looks fine, check that your applications are loading the correct libm using the "farm".

0
source

Source: https://habr.com/ru/post/1392325/


All Articles