RFR: JDK-8319516 - Native library suffix impact on the library loading in AIX- Java Class Loader [v6]

Suchismith Roy sroy at openjdk.org
Mon Apr 1 10:17:33 UTC 2024


On Thu, 28 Mar 2024 16:57:59 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> `System::loadLibrary("systeminfo")` should call `JVM_LoadLibrary` with "/usr/lib/libsysteminfo.so" argument (let the .a file exists under "/usr/lib") which in turn calls `os::dll_load`. JDK-8320005 changed `os::dll_load` to first load the given filename; if fails, it will call `dll_load_library` with "/usr/lib/libsysteminfo.a".
> 
> You can turn on `-Xlog:library` and it should print log message loading "/usr/lib/libsysteminfo.so" if you have `loadLibraryOnlyIfPresent` to return false. If you don't see log message loading "/usr/lib/libsysteminfo.so", `loadLibraryOnlyIfPresent` still returns true.
> 
> Turn on "-Xlog:os" should print "attempting shared library load of /usr/lib/libsysteminfo.so" and "attempting shared library load of /usr/lib/libsysteminfo.a" log message.

@mlchung  That should work, but then the mapAlternateName is called in NativeLibraries.java . I think the classloaderhelper for the respective platform needs to implement it. So if i remove mapAlternateName I need to probably remove the entire file from AIX, so that the classloaderhelper of unix is referred.
Also in ClassLoaderHelper of unix, the mapAlternateName return null. So should i keep it that way ? 
Other optioon is to set loadLibraryOnlyIfPresent to false in the unix classloaderhelper ? I am not sure if that would be allowed.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17945#issuecomment-2029530668


More information about the core-libs-dev mailing list