Skip to content

Commit

Permalink
[GR-58001] Enable native access for the image builder module path only
Browse files Browse the repository at this point in the history
PullRequest: graal/18783
  • Loading branch information
zapster committed Sep 13, 2024
2 parents 53df8d1 + 99501b0 commit b8a7b4a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import com.oracle.svm.core.option.BundleMember;
import com.oracle.svm.core.option.OptionOrigin;
import com.oracle.svm.core.option.OptionUtils;
import com.oracle.svm.core.util.ArchiveSupport;
import com.oracle.svm.core.util.ClasspathUtils;
import com.oracle.svm.core.util.ExitStatus;
import com.oracle.svm.core.util.VMError;
Expand All @@ -95,7 +96,6 @@
import com.oracle.svm.driver.metainf.NativeImageMetaInfWalker;
import com.oracle.svm.hosted.NativeImageGeneratorRunner;
import com.oracle.svm.hosted.NativeImageSystemClassLoader;
import com.oracle.svm.core.util.ArchiveSupport;
import com.oracle.svm.hosted.util.JDKArgsUtils;
import com.oracle.svm.util.LogUtils;
import com.oracle.svm.util.ModuleSupport;
Expand Down Expand Up @@ -303,7 +303,7 @@ private static <T> String oR(OptionKey<T> option) {
private final List<ExcludeConfig> excludedConfigs = new ArrayList<>();
private final LinkedHashSet<String> addModules = new LinkedHashSet<>();
private final LinkedHashSet<String> limitModules = new LinkedHashSet<>();
private final LinkedHashSet<String> enableNativeAccessModules = new LinkedHashSet<>(ModuleSupport.SYSTEM_MODULES);
private final LinkedHashSet<String> enableNativeAccessModules = new LinkedHashSet<>();

private long imageBuilderPid = -1;

Expand Down Expand Up @@ -1324,6 +1324,7 @@ private int completeImageBuild() {
if (config.modulePathBuild && !finalImageClasspath.isEmpty()) {
imageBuilderJavaArgs.add(DefaultOptionHandler.addModulesOption + "=ALL-DEFAULT");
}
enableNativeAccessModules.addAll(getModulesFromPath(imageBuilderModulePath).keySet());
assert !enableNativeAccessModules.isEmpty();
imageBuilderJavaArgs.add("--enable-native-access=" + String.join(",", enableNativeAccessModules));

Expand Down

0 comments on commit b8a7b4a

Please sign in to comment.