diff --git a/tools/link.py b/tools/link.py index ac35df22172bc..866b963e2f88b 100644 --- a/tools/link.py +++ b/tools/link.py @@ -789,6 +789,8 @@ def phase_linker_setup(options, state): # noqa: C901, PLR0912, PLR0915 else: # Otherwise the wasm file is produced alongside the final target. wasm_target = get_secondary_target(target, '.wasm') + if final_suffix in EXECUTABLE_ENDINGS: + options.executable = True if settings.SAFE_HEAP not in [0, 1, 2]: exit_with_error('emcc: SAFE_HEAP must be 0, 1 or 2')