Skip to content

Commit 87d1985

Browse files
committed
Preserve Darwin absolute load semantics
1 parent b03f147 commit 87d1985

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/NativeLibraries.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ private boolean loadBuiltinDarwinLibraryAbsoluteFallback(File file) {
167167
if (builtInName == null) {
168168
return false;
169169
}
170+
if (file.exists()) {
171+
/*
172+
* Preserve System.load(<absolute path>) semantics for real files. The fallback is only
173+
* intended for builtin JDK libraries whose image/java.home path does not exist as a
174+
* loadable dylib in the generated image.
175+
*/
176+
return false;
177+
}
170178
try {
171179
return isBuiltinDarwinLibraryLocation(file) && addLibrary(builtInName, true);
172180
} catch (IOException e) {

0 commit comments

Comments
 (0)