RFR: JDK-8319516 AIX System::loadLibrary needs support to load a shared library from an archive object [v13]

Martin Doerr mdoerr at openjdk.org
Mon Apr 8 10:43:11 UTC 2024


On Fri, 5 Apr 2024 18:14:36 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> Allow support for both .a and .so files in AIX.
>> If .so file is not found, allow fallback to .a extension.
>> JBS Issue: [JDK-8319516](https://bugs.openjdk.org/browse/JDK-8319516)
>
> Suchismith Roy has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - update tests
>  - update tests
>  - update tests

The fix itself looks good except minor nits.

I have looked at the test together with Joachim. The test is not valid. It only passes because https://github.com/openjdk/jdk/commit/b8ae4a8c0985d1763ac48ba78943d8b992d7be77 has a bug. The lib `/usr/lib/libperfstat.a(shr_64.o)` has already been loaded by hotspot and [JDK-8320890](https://bugs.openjdk.org/browse/JDK-8320890) prevents the loading attempt we are trying to test. This is a real problem because it breaks the ability to load several members of the same library.
@JoKern65: Please file a bug for this problem.

If you need a test for this PR, I suggest copying an existing ".so" library to e.g. "libdummyarchive.a" and use that. I think that it is possible to implement the copy step in Java and to write it to the test's temporary directory.

src/java.base/aix/classes/jdk/internal/loader/ClassLoaderHelper.java line 43:

> 41:     static boolean loadLibraryOnlyIfPresent() {
> 42:         return false;
> 43:     }

Please insert an empty line.

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

Changes requested by mdoerr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17945#pullrequestreview-1986030389
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1555591905


More information about the core-libs-dev mailing list