From f913525a5f8e3742e00ce386e8f99279ccce43ef Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 31 Dec 2025 00:39:21 +0100 Subject: [PATCH] Emscripten: add -s SINGLE_FILE_BINARY_ENCODE=0 Emscripten 4 changed the WASM binary encoding mode from base64 to a custom UTF-8 binary encoding with binaryDecode(). The new encoding uses control characters and non-printable ASCII that get corrupted when served to browsers. --- dist-build/emscripten.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist-build/emscripten.sh b/dist-build/emscripten.sh index 68f7da5a..514e69f5 100755 --- a/dist-build/emscripten.sh +++ b/dist-build/emscripten.sh @@ -10,7 +10,7 @@ export JS_RESERVED_MEMORY_TESTS=16MB export WASM_INITIAL_MEMORY=4MB export LDFLAGS="-s RESERVED_FUNCTION_POINTERS=8" export LDFLAGS="${LDFLAGS} -s ALLOW_MEMORY_GROWTH=1" -export LDFLAGS="${LDFLAGS} -s SINGLE_FILE=1" +export LDFLAGS="${LDFLAGS} -s SINGLE_FILE=1 -s SINGLE_FILE_BINARY_ENCODE=0" export LDFLAGS="${LDFLAGS} -s ASSERTIONS=0" export LDFLAGS="${LDFLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s ALIASING_FUNCTION_POINTERS=1" export LDFLAGS="${LDFLAGS} -s DISABLE_EXCEPTION_CATCHING=1"