Skip to content

Commit 0ada2ee

Browse files
authored
Fix HTML5 lib LTO build with PTHREADS
We use WebGPU, pthread and PROXY_TO_PTHREAD and noticed a linker error in our release builds where we enable LTO: wasm-ld: error: C:\\Dev\\emsdk\\upstream\\emscripten\\cache\\sysroot\\lib\\wasm32-emscripten\\lto\libhtml5.a(callback.o): attempt to add bitcode file after LTO (_emscripten_run_callback_on_thread) Judging by other tickets this seems like the place to fix it, but let me know if that's wrong.
1 parent 02bef44 commit 0ada2ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/system_libs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,11 @@ def get_libcall_files(self):
10361036
path='system/lib/libc/musl/src/errno',
10371037
filenames=['__errno_location.c'])
10381038

1039-
return math_files + exit_files + other_files + iprintf_files + errno_files
1039+
html5_files += files_in_path(
1040+
path='system/lib/html5',
1041+
filenames=['callback.c'])
1042+
1043+
return math_files + exit_files + other_files + iprintf_files + errno_files + html5_files
10401044

10411045
def get_files(self):
10421046
libc_files = []

0 commit comments

Comments
 (0)