steam-audio icon indicating copy to clipboard operation
steam-audio copied to clipboard

Unable to link with the released WASM library due to missing symbols

Open photex opened this issue 2 months ago • 1 comments

System Information Please provide the following information about your system:

  • Steam Audio version: 4.7.0
  • Operating System and version: macOS host, wasm target
  • (Optional) CPU architecture (e.g. x86-64, armv7): wasm32

Issue Description When attempting to link with libphonon.a using emcc, there are many missing symbols:

✨ Pixi task (build-web in web): emcc -O3 -DNDEBUG -std=c2y -Wall -Wextra -sWASM=1 -sALLOW_MEMORY_GROWTH -sINITIAL_MEMORY=536870912 --embed-file=content -I.sdl-web/include -Isource/vendor/steamaudio/include -Isource/vendor/stb -Isource/core -L.sdl-web/lib -Lsource/vendor/steamaudio/lib/wasm -lSDL3 -lSDL3_mixer -lphonon source/shipping.c -o bin/web/smvc.html
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_open_no_norm
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_open_data_no_norm
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_s2c
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_lookup
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_s2c
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_lookup
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_close
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_lookup
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_neighborhood
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_c2s
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_neighborhood
wasm-ld: error: source/vendor/steamaudio/lib/wasm/libphonon.a(unity_2_cxx.cxx.o): undefined symbol: mysofa_neighborhood
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
emcc: error: '/Users/chipc/workspaces/smvc/.emsdk/upstream/bin/wasm-ld -o bin/web/smvc.wasm -L.sdl-web/lib -Lsource/vendor/steamaudio/lib/wasm -lSDL3 -lSDL3_mixer -lphonon /var/folders/0p/tjkk_j8n7295rxrzwhmgfzhr0000gn/T/emscripten_temp_9cpms491/shipping.o -L/Users/chipc/workspaces/smvc/.emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -L/Users/chipc/workspaces/smvc/.emsdk/upstream/emscripten/src/lib /var/folders/0p/tjkk_j8n7295rxrzwhmgfzhr0000gn/T/emscripten_temp_9cpms491/embedded_files.o -lGL-getprocaddr -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /var/folders/0p/tjkk_j8n7295rxrzwhmgfzhr0000gn/T/tmp57vp7fkxlibemscripten_js_symbols.so --strip-debug --export=_emscripten_stack_alloc --export=__wasm_call_ctors --export=emscripten_stack_get_current --export=_emscripten_stack_restore --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-table -z stack-size=65536 --max-memory=2147483648 --initial-memory=536870912 --no-entry --table-base=1 --global-base=1024' failed (returned 1)

It seems as though mysofa and pffft are missing from the wasm archive and not provided. Is that intended? Have I just missed the documentation somewhere?

photex avatar Oct 23 '25 10:10 photex

I ran get_dependencies.py for wasm, and I see that libmysofa, libpffft, and libz were all built and I was able to add them to my copy of the release.

I didn't find a specific place where these files would get included in a release or not, but I also didn't look very closely yet either. Perhaps I can figure that out and provide a PR.

photex avatar Oct 23 '25 13:10 photex