Closed radlotus closed 1 year ago
whoops, closed accidentaly.
Official builds are made with Emscripten 3.1.18. Newer versions often cause breaking regressions, so this might be the case too. Could you test with 3.1.18 and see if that solves it?
@akien-mga, yes, using 3.1.18 solves it. I've checked and the latest version that still works is 3.1.36.
The issue is also present in Godot 4. Last working Emscripten version is also 3.1.36
This seems to be an upstream bug, see: https://github.com/emscripten-core/emscripten/issues/19774 and https://github.com/emscripten-core/emscripten/issues/19781 .
For the record, I can confirm the issue is still reproducible with latest Emscripten 3.1.45.
Tested build with scons p=web target=template_release production=yes verbose=yes
.
Fails with:
wasm-ld: error: /home/akien/Projects/godot/emscripten/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc-mt-debug.a(scalbnf.o): attempt to add bitcode file after LTO.
em++: error: '/home/akien/Projects/godot/emscripten/emsdk/upstream/bin/wasm-ld -o bin/godot.web.template_release.wasm32.wasm platform/web/audio_driver_web.web.template_release.wasm32.o platform/web/display_server_web.web.template_release.wasm32.o platform/web/http_client_web.web.template_release.wasm32.o platform/web/javascript_bridge_singleton.web.template_release.wasm32.o platform/web/web_main.web.template_release.wasm32.o platform/web/os_web.web.template_release.wasm32.o platform/web/api/web_tools_editor_plugin.web.template_release.wasm32.o platform/web/web_runtime.web.template_release.wasm32.o main/libmain.web.template_release.wasm32.a modules/libmodules.web.template_release.wasm32.a modules/libmodule_ktx.web.template_release.wasm32.a modules/libmodule_msdfgen.web.template_release.wasm32.a modules/libmodule_theora.web.template_release.wasm32.a modules/libmodule_vorbis.web.template_release.wasm32.a modules/libmodule_basis_universal.web.template_release.wasm32.a modules/libmodule_bmp.web.template_release.wasm32.a modules/libmodule_csg.web.template_release.wasm32.a modules/libmodule_dds.web.template_release.wasm32.a modules/libmodule_enet.web.template_release.wasm32.a modules/libmodule_freetype.web.template_release.wasm32.a modules/libmodule_gdscript.web.template_release.wasm32.a modules/libmodule_glslang.web.template_release.wasm32.a modules/libmodule_gltf.web.template_release.wasm32.a modules/libmodule_gridmap.web.template_release.wasm32.a modules/libmodule_hdr.web.template_release.wasm32.a modules/libmodule_jpg.web.template_release.wasm32.a modules/libmodule_jsonrpc.web.template_release.wasm32.a modules/libmodule_lightmapper_rd.web.template_release.wasm32.a modules/libmodule_mbedtls.web.template_release.wasm32.a modules/libmodule_meshoptimizer.web.template_release.wasm32.a modules/libmodule_minimp3.web.template_release.wasm32.a modules/libmodule_mobile_vr.web.template_release.wasm32.a modules/libmodule_multiplayer.web.template_release.wasm32.a modules/libmodule_navigation.web.template_release.wasm32.a modules/libmodule_noise.web.template_release.wasm32.a modules/libmodule_ogg.web.template_release.wasm32.a modules/libmodule_raycast.web.template_release.wasm32.a modules/libmodule_regex.web.template_release.wasm32.a modules/libmodule_squish.web.template_release.wasm32.a modules/libmodule_svg.web.template_release.wasm32.a modules/libmodule_text_server_adv.web.template_release.wasm32.a modules/libmodule_tga.web.template_release.wasm32.a modules/libmodule_upnp.web.template_release.wasm32.a modules/libmodule_vhacd.web.template_release.wasm32.a modules/libmodule_webp.web.template_release.wasm32.a modules/libmodule_webrtc.web.template_release.wasm32.a modules/libmodule_websocket.web.template_release.wasm32.a modules/libmodule_webxr.web.template_release.wasm32.a modules/libmodule_zip.web.template_release.wasm32.a platform/libplatform.web.template_release.wasm32.a drivers/libdrivers.web.template_release.wasm32.a scene/libscene.web.template_release.wasm32.a servers/libservers.web.template_release.wasm32.a core/libcore.web.template_release.wasm32.a modules/text_server_adv/libharfbuzz_builtin.web.template_release.wasm32.a modules/text_server_adv/libgraphite_builtin.web.template_release.wasm32.a modules/text_server_adv/libicu_builtin.web.template_release.wasm32.a modules/freetype/libfreetype_builtin.web.template_release.wasm32.a modules/msdfgen/libmsdfgen_builtin.web.template_release.wasm32.a -L/home/akien/Projects/godot/emscripten/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto /home/akien/Projects/godot/emscripten/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/crtbegin.o -lGL-mt-webgl2-ofb -lal -lhtml5 -lbulkmemory -lstubs-debug -lc-mt-debug -ldlmalloc-mt -lcompiler_rt-mt -lc++-mt-noexcept -lc++abi-debug-mt-noexcept -lsockets-mt -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr /tmp/tmpowj6vflhlibemscripten_js_symbols.so --import-memory --shared-memory --strip-debug --export-if-defined=main --export-if-defined=_emscripten_thread_init --export-if-defined=_emscripten_thread_exit --export-if-defined=_emscripten_thread_crashed --export-if-defined=_emscripten_tls_init --export-if-defined=pthread_self --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-if-defined=fflush --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=_emscripten_thread_free_data --export=emscripten_main_runtime_thread_id --export=emscripten_main_thread_process_queued_calls --export=_emscripten_run_on_main_thread_js --export=emscripten_stack_set_limits --export=__get_temp_ret --export=__set_temp_ret --export=__funcs_on_exit --export=__wasm_call_ctors --export=_emscripten_thread_init --export=_emscripten_thread_exit --export-table -z stack-size=65536 --initial-memory=33554432 --max-memory=2147483648 --no-entry --stack-first' failed (returned 1)
scons: *** [bin/godot.web.template_release.wasm32.js] Error 1
Full build log: godot_build_web_lto_emscripten_3.1.45.log.zip
The issue is also present in Godot 4. Last working Emscripten version is also 3.1.36
I tried to confirm this and got different results, for me all versions up to 3.1.41 are working fine. The LTO linking step breaks from 3.1.42 onward, up to 3.1.45 (current latest). That seems consistent with upstream bug reports which report a regression in 3.1.42.
Did you test specifically that 3.1.37 and later weren't working? Are you sure it was the same error?
We can probably try to define -Wl,-u,scalbnf
when we detect Emscripten >= 3.1.42, as described in https://github.com/emscripten-core/emscripten/issues/19781#issuecomment-1704365864.
I'll have a look at this after finalizing #80719 which refactors the compiler version detection, so this can be done cleanly.
Godot version
3.5.2
System information
AMD EPYC 7B13; 32 GB RAM Ubuntu 22.04.2 LTS; Python 3.11.1; Emscripten 3.1.44; clang 17; Scons 4.0.1
Issue description
Compiling with LTO gives this error:
Steps to reproduce
scons platform=javascript tools=no target=release use_lto=yes
Does anyone else have this issue?
Is it something related to a newer version of Emscripten? Python? Scons?
I did not have this issue before. I am using a fresh build setup.