Skip to content

Commit dae55bd

Browse files
committed
Ensure jimage static jdk library get statically linked
1 parent 8ce7298 commit dae55bd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
*/
6262
public final class JRTSupport {
6363

64-
static class Options {
64+
public static class Options {
6565
@Option(help = "Enable support for reading Java modules (jimage format) and the jrt:// file system. Requires java.home to be set at runtime.", type = OptionType.Expert) //
6666
public static final HostedOptionKey<Boolean> AllowJRTFileSystem = new HostedOptionKey<>(false);
6767
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,23 @@
2828

2929
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
3030
import com.oracle.svm.core.feature.InternalFeature;
31+
import com.oracle.svm.core.jdk.JRTSupport;
32+
import com.oracle.svm.core.jdk.NativeLibrarySupport;
3133
import com.oracle.svm.hosted.FeatureImpl;
3234

3335
@AutomaticallyRegisteredFeature
3436
public class JRTFeature implements InternalFeature {
3537

38+
@Override
39+
public boolean isInConfiguration(IsInConfigurationAccess access) {
40+
return JRTSupport.Options.AllowJRTFileSystem.getValue();
41+
}
42+
3643
@Override
3744
public void beforeAnalysis(BeforeAnalysisAccess access) {
3845
access.registerReachabilityHandler(duringAnalysisAccess -> {
3946
FeatureImpl.BeforeAnalysisAccessImpl beforeAnalysisAccess = (FeatureImpl.BeforeAnalysisAccessImpl) access;
47+
NativeLibrarySupport.singleton().preregisterUninitializedBuiltinLibrary("jimage");
4048
beforeAnalysisAccess.getNativeLibraries().addStaticJniLibrary("jimage");
4149
if (!Platform.includedIn(Platform.WINDOWS.class)) {
4250
beforeAnalysisAccess.getNativeLibraries().addDynamicNonJniLibrary("stdc++");

0 commit comments

Comments
 (0)