Skip to content

Commit f6442ba

Browse files
committed
Fixed sulong tests on JDK-21.
1 parent 6884c2c commit f6442ba

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

sulong/mx.sulong/mx_sulong_unittest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def apply(self, config, overrideSulongConfig=None):
101101
native_access_target_module = 'ALL-UNNAMED'
102102
vmArgs += [f'--enable-native-access={native_access_target_module}']
103103
# GR-59703: Migrate sun.misc.* usages.
104-
vmArgs += ['--sun-misc-unsafe-memory-access=allow']
104+
mx_truffle.enable_sun_misc_unsafe(vmArgs)
105105
if mx.get_opts().use_llvm_standalone is not None:
106106
vmArgs += [f'-Dsulongtest.testAOTImage={mx_sulong.get_lli_path()}']
107107
else:

sulong/tests/com.oracle.truffle.llvm.tests/src/com/oracle/truffle/llvm/tests/util/ProcessHarnessManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ private ProcessHarnessInstance startInstance() throws IOException {
270270
commandArgs.add("--enable-native-access=ALL-UNNAMED");
271271
}
272272
// GR-59703: Migrate sun.misc.* usages.
273-
commandArgs.add("--sun-misc-unsafe-memory-access=allow");
273+
if (Runtime.version().feature() >= 23) {
274+
commandArgs.add("--sun-misc-unsafe-memory-access=allow");
275+
}
274276

275277
copyProperty(commandArgs, "polyglot.engine.WarnInterpreterOnly");
276278
copyProperty(commandArgs, "truffle.nfi.library");

truffle/mx.truffle/mx_truffle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def enable_sun_misc_unsafe(vmArgs):
222222
list of JVM arguments if the JDK version is 23 or higher. It then returns the
223223
updated list of arguments.
224224
"""
225-
if mx.VersionSpec("23.0.0") <= mx.get_jdk(tag="graalvm").version:
225+
if mx.VersionSpec("23.0.0") <= mx.get_jdk(tag="default").version:
226226
vmArgs.extend(['--sun-misc-unsafe-memory-access=allow'])
227227
return vmArgs
228228

0 commit comments

Comments
 (0)