RFR: 8319516: AIX System::loadLibrary needs support to load a shared library from an archive object [v27]
Mandy Chung
mchung at openjdk.org
Mon Apr 15 18:38:05 UTC 2024
On Mon, 15 Apr 2024 16:10:38 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:
>
> - new line
> - spaces fix
> - spaces fix
Copying the library from JDK and renamed as `.a` is not the best idea. I am not sure how much work to execute the tool chain on AIX to generate a proper archive for a shared object. It's okay with me with this approach provided that the AIX Reviewer approves it.
test/jdk/java/lang/RuntimeTests/loadLibrary/aix/LoadAIXLibraryFromArchiveObject.java line 43:
> 41: // launches a java application passing this directory through "-Djava.library.path".
> 42: // the java application then attempts to load the library using System.loadLibrary()
> 43: public static void main(final String[] args) throws Exception {
Suggestion:
public static void main(String[] args) throws Exception {
You can drop `final` in the method signature and local variables below in the method body.
test/jdk/java/lang/RuntimeTests/loadLibrary/aix/LoadAIXLibraryFromArchiveObject.java line 53:
> 51: final Path testNativeLibDir = Path.of("native").toAbsolutePath();
> 52: Files.createDirectories(testNativeLibDir);
> 53: final Path libDummyArchive = testNativeLibDir.resolve(archiveFileName);
Suggestion:
Path libFooBarArchive = testNativeLibDir.resolve(archiveFileName);
Nit: match the expected library name.
-------------
PR Review: https://git.openjdk.org/jdk/pull/17945#pullrequestreview-2001874277
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1566259916
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1566262563
More information about the core-libs-dev
mailing list