Skip to content

Commit 52cefe8

Browse files
authored
Fix auto-generation of struct_info with -sMEMORY64=1 (#16512)
We always want to use =2 internally when building the struct_info json file. The results will be the same either way but this removes the need to run the output in a VM with memory64 enabled.
1 parent 29adc84 commit 52cefe8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/gen_struct_info.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ def inspect_headers(headers, cflags):
268268
'-Wno-format',
269269
'-nostdlib',
270270
compiler_rt,
271-
'-sMEMORY64=' + str(settings.MEMORY64),
272271
'-sBOOTSTRAPPING_STRUCT_INFO=1',
273272
'-sLLD_REPORT_UNDEFINED=1',
274273
'-sSTRICT',
@@ -286,6 +285,11 @@ def inspect_headers(headers, cflags):
286285
if settings.LTO:
287286
cmd += ['-flto=' + settings.LTO]
288287

288+
if settings.MEMORY64:
289+
# Always use =2 here so that we don't generate binar that actually requires
290+
# memeory64 to run. All we care about is that the output is correct.
291+
cmd += ['-sMEMORY64=2']
292+
289293
show(shared.shlex_join(cmd))
290294
try:
291295
subprocess.check_call(cmd, env=system_libs.clean_env())

0 commit comments

Comments
 (0)