meson icon indicating copy to clipboard operation
meson copied to clipboard

emcc requires static_libraries to have .bc suffix

Open apache-hb opened this issue 2 years ago • 1 comments

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

apache-hb avatar Mar 17 '23 00:03 apache-hb

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.

Akaricchi avatar Mar 22 '23 21:03 Akaricchi