Skip to content

Commit

Permalink
[GR-52754] Propagate native compiler options to the native-image proc…
Browse files Browse the repository at this point in the history
…ess.

PullRequest: graal/17361
  • Loading branch information
ansalond committed Mar 27, 2024
2 parents 6dea009 + e4f548e commit f6c7945
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "7.16.3",
"mx_version": "7.18.0",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand Down
16 changes: 13 additions & 3 deletions sdk/mx.sdk/mx_sdk_vm_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,12 +2408,22 @@ def _get_command_file(self):
return self.subject.output_file() + '.cmd'

def get_build_args(self):
experimental_build_args = [
'-H:+GenerateBuildArtifactsFile', # generate 'build-artifacts.json'
]

alt_c_compiler = getattr(self.args, 'alt_cl' if mx.is_windows() else 'alt_cc')
if alt_c_compiler is not None:
experimental_build_args += ['-H:CCompilerPath=' + shutil.which(alt_c_compiler)]
if self.args.alt_cflags is not None:
experimental_build_args += ['-H:CCompilerOption=' + self.args.alt_cflags]
if self.args.alt_ldflags is not None:
experimental_build_args += ['-H:NativeLinkerOption=' + self.args.alt_ldflags]

build_args = [
'-EJVMCI_VERSION_CHECK', # Propagate this env var when running native image from mx
'--parallelism=' + str(self.parallelism),
] + svm_experimental_options([
'-H:+GenerateBuildArtifactsFile', # generate 'build-artifacts.json'
]) + [
] + svm_experimental_options(experimental_build_args) + [
'--macro:' + GraalVmNativeProperties.macro_name(self.subject.native_image_config), # last to allow overrides
]
if self.subject.native_image_config.is_polyglot:
Expand Down
2 changes: 1 addition & 1 deletion sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# SOFTWARE.
#
suite = {
"mxversion": "7.11.0",
"mxversion": "7.18.0",
"name" : "sdk",
"version" : "24.1.0",
"release" : False,
Expand Down

0 comments on commit f6c7945

Please sign in to comment.