GMH-Code/Quake-WASM

failure to build glquake on raspberry pi

Kurtjwest opened this issue · 2 comments

receiving the error:

emcc chase.o cl_demo.o cl_input.o cl_main.o cl_parse.o cl_tent.o cmd.o common.o console.o crc.o cvar.o host.o host_cmd.o keys.o mathlib.o menu.o net_bsd.o net_dgrm.o net_loop.o net_main.o net_udp.o net_vcr.o pr_cmds.o pr_edict.o pr_exec.o r_part.o sbar.o snd_dma.o snd_mem.o snd_mix.o sv_main.o sv_move.o sv_phys.o sv_user.o view.o wad.o world.o zone.o gl_draw.o gl_mesh.o gl_model.o gl_refrag.o gl_rlight.o gl_rmain.o gl_rmisc.o gl_rsurf.o gl_screen.o gl_test.o gl_warp.o cd_null.o snd_sdl.o sys_sdl.o vid_sdl.o -O3 -sUSE_SDL=2 -sINITIAL_MEMORY=64MB -sTOTAL_STACK=2MB -sALLOW_MEMORY_GROWTH --preload-file=id1 --shell-file shell.html -lidbfs.js /home/kjw/gl4es/lib/libGL.a -sFULL_ES2=1 -o index.html
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glEnd
wasm-ld: error: gl_draw.o: undefined symbol: glColor4f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glTexCoord2f
wasm-ld: error: gl_draw.o: undefined symbol: glVertex2f
wasm-ld: error: gl_draw.o: undefined symbol: glEnd
wasm-ld: error: gl_draw.o: undefined symbol: glColor4f
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
emcc: error: '/home/kjw/emsdk/upstream/bin/wasm-ld -o index.wasm chase.o cl_demo.o cl_input.o cl_main.o cl_parse.o cl_tent.o cmd.o common.o console.o crc.o cvar.o host.o host_cmd.o keys.o mathlib.o menu.o net_bsd.o net_dgrm.o net_loop.o net_main.o net_udp.o net_vcr.o pr_cmds.o pr_edict.o pr_exec.o r_part.o sbar.o snd_dma.o snd_mem.o snd_mix.o sv_main.o sv_move.o sv_phys.o sv_user.o view.o wad.o world.o zone.o gl_draw.o gl_mesh.o gl_model.o gl_refrag.o gl_rlight.o gl_rmain.o gl_rmisc.o gl_rsurf.o gl_screen.o gl_test.o gl_warp.o cd_null.o snd_sdl.o sys_sdl.o vid_sdl.o /home/kjw/gl4es/lib/libGL.a -L/home/kjw/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten /home/kjw/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libSDL2.a -lGL -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 /tmp/tmpz_0hxip1libemscripten_js_symbols.so --strip-debug --export-if-defined=main --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_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=malloc --export=free --export=__wasm_call_ctors --export-table -z stack-size=2097152 --initial-memory=67108864 --max-memory=2147483648 --no-entry --global-base=1024' failed (returned 1)

You're getting all the way to the final link, which is good, and I can't see anything wrong with how you're building Quake-WASM.

Let's try some things:

  • I presume you have been successful in building Quake without OpenGL support? If not, give that a try first.

  • When building Quake-WASM, run make clean before make to get rid of any non-GL or GL-related objects from previous builds, especially if you've changed the GLQUAKE option.

  • You may have already done this, but try cloning a new copy of GL4ES and building it from scratch using these instructions (not the ones for the Pi):

git clone https://github.com/ptitSeb/gl4es.git
cd gl4es
mkdir build; cd build; emcmake cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DNOX11=ON -DNOEGL=ON -DSTATICLIB=ON; make
  • Check you used the current and same version of Emscripten for GL4ES and Quake-WASM (3.1.50).

  • Don't forget you can build Quake-WASM on any architecture if you're only looking to host it on the Pi.

If that works, let me know. If not then we can potentially look inside the libGL.a archive and figure out why Emscripten's compiler can't find the objects within.

I'm closing this as completed, because a month has elapsed and the build is still working in my tests. If you have further trouble building the project, let me know.