From 28b5b6dc97a30653dadff68176b55a54e9967dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sat, 9 Dec 2023 16:51:42 +0100 Subject: [PATCH] Fix some LTO-related emscripten link-time error I have absolutely no idea. The error in question is the following: wasm-ld: error: /home/lbphacker/.emscripten_cache/sysroot/lib/wasm32-emscripten/lto/libhtml5.a(callback.o): attempt to add bitcode file after LTO (_emscripten_run_callback_on_thread) I have no idea where we use _emscripten_run_callback_on_thread, and I have no idea why LTO would think it's not required when it's obviously required. This commit fixes it by holding the linker's hand even more than it already had. --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 7d78d3237..db7963020 100644 --- a/meson.build +++ b/meson.build @@ -212,6 +212,7 @@ if host_platform == 'emscripten' '-s', 'FS_DEBUG', '-s', 'MODULARIZE', '-s', 'EXPORT_NAME=create_' + app_exe, + '-Wl,-u,_emscripten_run_callback_on_thread', '-lidbfs.js', ] emcc_args = [