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

Martin Doerr mdoerr at openjdk.org
Tue Mar 26 21:05:25 UTC 2024


On Mon, 25 Mar 2024 09:46:50 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 four additional commits since the last revision:
> 
>  - coding style
>  - set false
>  - restore fil
>  -  remove member check code

I think your new version makes sense in general. MacOS also uses `mapAlternativeName` to support different endings. And your current version still allows using a member for `System.load` which is helpful.

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

> 1: /*
> 2:  * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.

Copyright outdated.

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

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

Indentation is odd.

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

> 59:             long openBracketCount = name.chars().filter(ch -> ch == '(').count();
> 60:             long closeBracketCount = name.chars().filter(ch -> ch == ')').count();
> 61:             //Checking if the format is correct.

Space after //.

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

> 66:             int dotIndex = name.lastIndexOf('.');
> 67:             String memberName = name.substring(openBracketIndex,dotIndex);
> 68:             //Reconstruct <libname>.so(<member_name>) as <libname>.a(<member_name>)

Do we really need to support libname.so(member)? Isn't it always libname.a(member)?

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

PR Review: https://git.openjdk.org/jdk/pull/17945#pullrequestreview-1961722255
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1540103849
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1540104059
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1540104421
PR Review Comment: https://git.openjdk.org/jdk/pull/17945#discussion_r1540105840


More information about the core-libs-dev mailing list