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.
This commit is contained in:
Frank Denis
2025-12-31 00:40:44 +01:00
parent c61b078902
commit f913525a5f
+1 -1
View File
@@ -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"