On 8/4/25 5:57 AM, Kohei Tokunaga wrote:
Currently there are some engines that don't support wasm64 (e.g. unsupported
on Safari[1]). To mitigate this issue, the configure script allows the user
to use Emscripten's compatibility feature, "-sMEMORY64=2" flag[2].

Emscripten's "-sMEMORY64=2" flag still enables 64bit pointers in C code. But
this flag lowers the output binary into wasm32, with limiting the maximum
memory size to 4GB. So QEMU can run on wasm32 engines.

This commit adds "--wasm64-memory64" flag to the configure script. This
takes the value to propagate to Emscripten's -sMEMORY64. 1(default) targets
wasm64 engines and 2 targets wasm32 engines with still enabling 64bit
pointers.

[1] https://webassembly.org/features/
[2] https://emscripten.org/docs/tools_reference/settings_reference.html#memory64

Signed-off-by: Kohei Tokunaga <[email protected]>
---
  configure | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)

It could be worth adding the link to documentation in commit description directly in configure also. As well, the --wasm64-memory64 option help could explain that in a few words.

Reviewed-by: Pierrick Bouvier <[email protected]>

Reply via email to