Skip to content

Commit 1604c82

Browse files
authored
Error on --emrun with EXIT_RUNTIME=0 (#23096)
The emrun post.js file depend on `addOnExit` to report the exit of the program. We were already forcing `-sEXIT_RUNTIME` but this adds an error if the user tries to explicitly disable it.
1 parent 19345a7 commit 1604c82

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/link.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,11 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
664664
if options.emrun:
665665
options.pre_js.append(utils.path_from_root('src/emrun_prejs.js'))
666666
options.post_js.append(utils.path_from_root('src/emrun_postjs.js'))
667+
if settings.MINIMAL_RUNTIME:
668+
exit_with_error('--emrun is not compatible with MINIMAL_RUNTIME')
667669
# emrun mode waits on program exit
670+
if user_settings.get('EXIT_RUNTIME') == '0':
671+
exit_with_error('--emrun is not compatible with EXIT_RUNTIME=0')
668672
settings.EXIT_RUNTIME = 1
669673

670674
if options.cpu_profiler:
@@ -972,9 +976,6 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
972976
if settings.MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and settings.MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION:
973977
exit_with_error('MINIMAL_RUNTIME_STREAMING_WASM_COMPILATION and MINIMAL_RUNTIME_STREAMING_WASM_INSTANTIATION are mutually exclusive!')
974978

975-
if options.emrun and settings.MINIMAL_RUNTIME:
976-
exit_with_error('--emrun is not compatible with MINIMAL_RUNTIME')
977-
978979
if options.use_closure_compiler:
979980
settings.USE_CLOSURE_COMPILER = 1
980981

0 commit comments

Comments
 (0)