|
48 | 48 | import com.oracle.svm.core.option.SubstrateOptionsParser; |
49 | 49 | import com.oracle.svm.core.util.ArchiveSupport; |
50 | 50 | import com.oracle.svm.core.util.UserError; |
51 | | -import com.oracle.svm.core.util.VMError; |
52 | 51 | import com.oracle.svm.hosted.ImageClassLoader; |
53 | 52 | import com.oracle.svm.hosted.NativeImageClassLoaderSupport; |
54 | 53 | import com.oracle.svm.hosted.c.NativeLibraries; |
@@ -337,15 +336,9 @@ public static Map<String, OptionLayerVerificationRequests> collectLayerVerificat |
337 | 336 |
|
338 | 337 | @SuppressFBWarnings(value = "NP", justification = "FB reports null pointer dereferencing because it doesn't see through UserError.guarantee.") |
339 | 338 | public static void setupSharedLayerLibrary(NativeLibraries nativeLibs) { |
340 | | - Path sharedLibPath = HostedImageLayerBuildingSupport.singleton().getLoadLayerArchiveSupport().getSharedLibraryPath(); |
341 | | - Path parent = sharedLibPath.getParent(); |
342 | | - VMError.guarantee(parent != null, "Shared layer library path doesn't have a parent."); |
343 | | - nativeLibs.getLibraryPaths().add(parent.toString()); |
344 | | - Path fileName = sharedLibPath.getFileName(); |
345 | | - VMError.guarantee(fileName != null, "Cannot determine shared layer library file name."); |
346 | | - String fullLibName = fileName.toString(); |
347 | | - VMError.guarantee(fullLibName.startsWith("lib") && fullLibName.endsWith(".so"), "Expecting that shared layer library file starts with lib and ends with .so. Found: %s", fullLibName); |
348 | | - String libName = fullLibName.substring("lib".length(), fullLibName.length() - ".so".length()); |
| 339 | + LoadLayerArchiveSupport archiveSupport = HostedImageLayerBuildingSupport.singleton().getLoadLayerArchiveSupport(); |
| 340 | + nativeLibs.getLibraryPaths().add(archiveSupport.getSharedLibraryPath().toString()); |
| 341 | + String libName = archiveSupport.getSharedLibraryBaseName(); |
349 | 342 | HostedDynamicLayerInfo.singleton().registerLibName(libName); |
350 | 343 | nativeLibs.addDynamicNonJniLibrary(libName); |
351 | 344 | } |
|
0 commit comments