meson
meson copied to clipboard
emcc requires static_libraries to have .bc suffix
Describe the bug Emcc will only treat static libraries as static libraries when linking if they have a .bc suffix on their name, currently meson doesnt handle this.
To Reproduce
lib = static_library('yup', 'yup.c')
executable('main', 'main.c', link_with : lib)
Expected behavior Application builds without issue
Actual behavior
emcc: error: libyup.a: Unknown format, not a static library!
system parameters cross build setup with
[binaries]
c = 'emcc'
cpp = 'em++'
ar = 'emar'
ranlib = 'emranlib'
exe_wrapper = 'node'
[properties]
needs_exe_wrapper = true
[host_machine]
cpu = 'mvp'
cpu_family = 'wasm32'
endian = 'little'
system = 'emscripten'
Linux DESKTOP-89QIKNE 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 GNU/Linux Python 3.9.2 meson version: 1.0.1 ninja version: 1.10.1
Seems to be a very old version of emscripten, I'm pretty sure they've moved away from the .bc suffix ever since the switch to upstream LLVM WASM backend, and .a has been working for some time even before that.