Open susoferreira opened 1 year ago
It looks like zig-out/lib/libemu.a
was compiled against a different version of libc++ to the one in emscripten. The symbol in zig-out/lib/libemu.a
all start with std::__1::
but the symbols in emscripten's libc++ all start with std::__2::
? How was libemu.a compiled? It looks like it was not compiled with emscripten.
Yes, they were both compiled with zig (which uses llvm)
zig cc --version
clang version 16.0.1 (https://github.com/ziglang/zig-bootstrap bf1b2cdb83141ad9336eec42160c9fe87f90198d)
Target: x86_64-unknown-linux-musl
Thread model: posix
InstalledDir: /usr/bin
Given that zig uses a different version of libc++ I don't see how you can expect to link zip-generated libraries into an emscripten project. Is that supposed to be something supported by zig?
In order to make that work I think the zip build would have to be run against the emscripten sysroot.. but I don't know how zig works. Maybe file a bug with them?
What im doing
Im trying to compile 2 libraries
libsokol
andlibemu
to wasm using entry.c (just a wrapper in c to call the real main, insidelibemu
), i get undefined symbol error for libc++ symbols, but libc++ is being linked if i understand the debug output correctly? i also tried adding-lc++
andEMCC_FORCE_STDLIBS=1
to the command, giving the same results,however when i add both of those options to the command at the same time i get duplicate symbol errors for those same symbolsMaybe this has something to do with the libraries being compiled from zig? They compiled without errors though
Version of emscripten/emsdk:
Failing command line in full:
Full link command and output with
-v
appended: