Unable to compile for web using MSYS2, WSL, or Ubuntu
ToxicBanana1 opened this issue · 5 comments
I have been occasionally attempting to build the web version for about a year now, and have yet to successfully do so. I've mostly been trying to use MINGW64, but I've also tried WSL and Google Colab (Ubuntu). I've gotten a few different warnings and errors throughout my efforts, but they've mostly been the same, ending with the only file in the us_web build folder being level_rules.mk
Every single attempt so far has had emcc: warning: linker flag ignored during compilation: '--source-map-base' [-Wunused-command-line-argument] and emcc: warning: please replace -g4 with -gsource-map [-Wdeprecated] plastered all over it.
Many attempts also gave emcc: error: 'C:/msys64/home/Toxic/emsdk/upstream/bin\clang.exe -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -Werror=implicit-function-declaration -IC:\msys64\home\Toxic\emsdk\upstream\emscripten\cache\sysroot\include\SDL2 --sysroot=C:\msys64\home\Toxic\emsdk\upstream\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat -fsyntax-only -fsigned-char -DRAPI_GL=1 -DWAPI_SDL2=1 -DAAPI_SDL2=1 -DCAPI_SDL2=1 -DHAVE_SDL2=1 -IC:/msys64/mingw32/include/SDL2 -Dmain=SDL_main -Iinclude -Ibuild/us_web -Ibuild/us_web/include -Isrc -I. -Wall -Wextra -Wno-format-security -DVERSION_US -D_LANGUAGE_C -DNIGHTLY -DGIT_HASH="54cd27c" -DNON_MATCHING -DAVOID_UB -DTARGET_WEB -DUSE_GLES -DF3DEX_GBI_2E -DEXT_OPTIONS_MENU -MMD -MP -MT build/us_web/src/pc/gfx/gfx_opengl.o -MF build/us_web/src/pc/gfx/gfx_opengl.d src/pc/gfx/gfx_opengl.c' failed (returned 1) as the final output.
Considering the fact that others have successfully built it, I'm assuming it's my own error, but any help is appreciated.
I don't know if this information is useful, but I have successfully compiled the PC build multiple times without a single error.
I don't know if the issue is with me simply doing it wrong, if there's something wrong with Emscripten, or if something else is going on. Again, any help will be appreciated.
Edit: I also get a few errors going something along the lines of make sdl2_config: no such file or directory (may not be exact, going from memory), but SDL2 was installed along with the rest of the dependencies, and I even tried installing it manually on it's own, which didn't seem to affect anything.
I've been able to get the web build to complete successfully, but when I actually load the generated site, I get an error in the browser:
`autoResumeAudioContext` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='$autoResumeAudioContext')
I followed its advice and added -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='autoResumeAudioContext' (and several variations with/without/escaping the $) but then I just get errors during build about autoResumeAudioContext symbol not found
Actually, I fixed the makefile, and it finds the function during compile, but I still get the same error in the browser
I've been able to get the web build to complete successfully
That's still farther than I've gotten. I've been trying occasionally over the past year (actually a bit longer) and have yet to get it to compile once. Sadly, I don't think many people are paying very much attention to sm64 porting anymore.
I've got a docker container that will automatically build the web version, with some extra parameters for setting the screen size in the web page. Works for both master and nightly branches.
I have been able to get it to successfully compile using Google Colab (I was at school and only had a chromebook available at the moment) after installing emsdk 1.39.5 instead of latest.