Skip to content

Commit

Permalink
Fix name mapping difference between AIX JDK 8 and Semeru JDK 18
Browse files Browse the repository at this point in the history
AIX JDK mapped dynamic libraries to ".a", while Semeru maps dynamic
libraries to ".so". This change unifies this to ".a".
  • Loading branch information
matthiasblaesing committed Jun 14, 2022
1 parent f58b0f8 commit 4cca440
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/com/sun/jna/NativeLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ else if (Platform.isLinux() || Platform.isFreeBSD()) {
}
}
else if (Platform.isAIX()) { // can be libx.a, libx.a(shr.o), libx.so
if (libName.startsWith("lib")) {
if (isVersionedName(libName) || libName.endsWith(".so") || libName.startsWith("lib") || libName.endsWith(".a")) {
// A specific version was requested - use as is for search
return libName;
}
}
Expand All @@ -791,7 +792,12 @@ else if (Platform.isWindows()) {
}
}

return System.mapLibraryName(libName);
String mappedName = System.mapLibraryName(libName);
if(Platform.isAIX() && mappedName.endsWith(".so")) {
return mappedName.replaceAll(".so$", ".a");
} else {
return mappedName;
}
}

private static boolean isVersionedName(String name) {
Expand Down

0 comments on commit 4cca440

Please sign in to comment.