File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
com.oracle.svm.core.posix/src/com/oracle/svm/core/posix
com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public void duringSetup(DuringSetupAccess access) {
6565}
6666
6767final class PosixNativeLibrarySupport extends JNIPlatformNativeLibrarySupport {
68+ public static final String PLM_PROPERTY_NAME = "jdk.lang.Process.launchMechanism" ;
6869
6970 @ Platforms (Platform .HOSTED_ONLY .class )
7071 private PosixNativeLibrarySupport () {
@@ -98,12 +99,17 @@ public boolean initializeBuiltinLibraries() {
9899 try {
99100 loadJavaLibrary ();
100101 loadNetLibrary ();
101- /*
102- * The JDK uses posix_spawn on the Mac to launch executables. This requires a
103- * separate process "jspawnhelper" which we don't want to have to rely on. Force the
104- * use of FORK on Linux and Mac.
105- */
106- System .setProperty ("jdk.lang.Process.launchMechanism" , "FORK" );
102+
103+ String launchMechanism = System .getProperty (PLM_PROPERTY_NAME );
104+
105+ if (launchMechanism == null ) {
106+ /*
107+ * The JDK uses posix_spawn on the Mac to launch executables. This requires a
108+ * separate process "jspawnhelper" which we don't want to have to rely on. Force
109+ * the use of FORK on Linux and Mac.
110+ */
111+ System .setProperty (PLM_PROPERTY_NAME , "FORK" );
112+ }
107113
108114 /*
109115 * Work around a bug in fork() on Darwin by eagerly calling localtime_r to make sure
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ public void afterRegistration(AfterRegistrationAccess access) {
260260 rci .initializeAtRunTime ("java.lang.Math$RandomNumberGeneratorHolder" , "Contains random seeds" );
261261 rci .initializeAtRunTime ("java.lang.StrictMath$RandomNumberGeneratorHolder" , "Contains random seeds" );
262262
263+ rci .initializeAtRunTime ("java.lang.ProcessImpl" , "launchMechanism and helperpath for jspawnhelper should be computed at run-time" );
264+
263265 rci .initializeAtRunTime ("jdk.internal.misc.InnocuousThread" , "Contains a thread group INNOCUOUSTHREADGROUP." );
264266 rci .initializeAtRunTime ("jdk.internal.util.StaticProperty" , "Contains run time specific values." );
265267
You can’t perform that action at this time.
0 commit comments