Skip to content

Commit 791a0fb

Browse files
committed
espresso: Enable PreinitializeContexts only if host and target are glibc
1 parent 32e7e93 commit 791a0fb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

espresso/mx.espresso/mx_espresso.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ def javavm_build_args():
115115
result += mx_sdk_vm_impl.svm_experimental_options(['-H:+DumpThreadStacksOnSignal', '-H:+CopyLanguageResources'])
116116
if mx_sdk_vm_ng.get_bootstrap_graalvm_version() >= mx.VersionSpec("25.0"):
117117
result.append('-H:-IncludeLanguageResources')
118-
if mx.is_linux() and mx.get_os_variant() != "musl":
118+
if mx.is_linux() and (mx.get_os_variant() != "musl" and mx_subst.path_substitutions.substitute("<multitarget_libc_selection>") == "glibc"):
119+
# Currently only enabled if the native image build runs on glibc and also targets glibc.
120+
# In practice it's enough that host and target are matching, but we do not get this info out of mx.
119121
result += [
120122
'-Dpolyglot.image-build-time.PreinitializeContexts=java',
121123
'-Dpolyglot.image-build-time.PreinitializeContextsWithNative=true',

0 commit comments

Comments
 (0)