-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
-s WASM=0 -s LEGACY_VM_SUPPORT=1 with emscripten 3.1.50 results in the following warning when linking:
building:WARNING: Closure compiler completed with warnings:
building:WARNING: /tmp/emscripten_temp_qc8uptr2/libopenmpt_test.js.mem.jso4.js:1:4095: WARNING - [JSC_CONSTANT_REASSIGNED_VALUE_ERROR] constant WebAssembly assigned a value more than once.
Original definition at externs.zip//webassembly.js:29
[...]
0 error(s), 1 warning(s)
building:WARNING: (rerun with -g1 linker flag for an unminified output)
(I cut away the 100kB of minified javascript)
Building with -g1 as suggested in the output makes the problem go away.
It does not happen with either -s WASM=2 or -s LEGACY_VM_SUPPORT=0. It also did not happen with emscripten 3.1.49, so this is a regression.
The other LDFLAGS used in this particular build are -Oz -flto -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s ERROR_ON_MISSING_LIBRARIES=1 -s EXPORT_NAME="'libopenmpt'" -s EXPORTED_FUNCTIONS="['_malloc','_free']"
You can reproduce the problem by building https://github.com/OpenMPT/openmpt/tree/e5a90920223b0648be01b3f2ad917f9f4a375f85 with make CONFIG=emscripten EMSCRIPTEN_TARGET=js VERBOSE=1 TEST=1 ONLY_TEST=1 (on Linux, I have no idea if our build system works correctly on macOS).
Edit: I added -g1 unconditionally as a work-around in a later commit, so it is mandatory to use the precise commit that I linked to reproduce the issue.