Skip to content

Commit b4dcb63

Browse files
author
Christian Wimmer
committed
Register prefs library as static JNI library
1 parent 386b168 commit b4dcb63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/JNIRegistrationPrefs.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import com.oracle.svm.core.jdk.NativeLibrarySupport;
3636
import com.oracle.svm.core.jni.JNIRuntimeAccess;
3737
import com.oracle.svm.core.util.VMError;
38+
import com.oracle.svm.hosted.FeatureImpl;
39+
import com.oracle.svm.hosted.c.NativeLibraries;
3840

3941
@Platforms({InternalPlatform.PLATFORM_JNI.class})
4042
@AutomaticFeature
@@ -73,7 +75,10 @@ private static String getPlatformPreferencesClassName() {
7375
}
7476

7577
private static void handlePreferencesClassReachable(@SuppressWarnings("unused") DuringAnalysisAccess access) {
78+
NativeLibraries nativeLibraries = ((FeatureImpl.DuringAnalysisAccessImpl) access).getNativeLibraries();
79+
7680
NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("prefs");
81+
nativeLibraries.addStaticJniLibrary("prefs");
7782
if (isDarwin()) {
7883
/* Darwin allocates a string array from native code */
7984
JNIRuntimeAccess.register(String[].class);

0 commit comments

Comments
 (0)