You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building a static library with two object files leads to a wasm-ld crash. The crash can be reproduced without any linking to boost libraries (using a >= 1.80 version). For boost <= 1.79 everything works.
Version of emscripten/emsdk:
> emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.32-git (36c194dfff84504434f8db4b8161071fa71f6c97)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Building the object files, using emar to combine them and finally producing a side module leads to a wasm-ld crash: emcc -flto -O0 -o exported_api.cpp.o -c exported_api.cpp -I/home/user/boost_1.80_headers/ emcc -flto -O0 -o reader.cpp.o -c reader.cpp -I/home/user/boost_1.80_headers/ emar -rcs lib_combined.a reader.cpp.o exported_api.cpp.o emcc -O3 -o lib.wasm lib_combined.a -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS=[_reader_destroy]
Does this issue still happen if you build without -sSIDE_MODULE=2 ?
BTW, normally when building a side module (or code that gets dynamically linked) you would compiler the sources with -fPIC. Does doing that help in this case?
Building a static library with two object files leads to a wasm-ld crash. The crash can be reproduced without any linking to boost libraries (using a >= 1.80 version). For boost <= 1.79 everything works.
Version of emscripten/emsdk:
Here is a simple repro case:
reader.hpp:
reader.cpp:
exported_api.cpp:
Building the object files, using emar to combine them and finally producing a side module leads to a wasm-ld crash:
emcc -flto -O0 -o exported_api.cpp.o -c exported_api.cpp -I/home/user/boost_1.80_headers/
emcc -flto -O0 -o reader.cpp.o -c reader.cpp -I/home/user/boost_1.80_headers/
emar -rcs lib_combined.a reader.cpp.o exported_api.cpp.o
emcc -O3 -o lib.wasm lib_combined.a -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS=[_reader_destroy]
Rerunning the wasm-ld part with --verbose gives:
Using the object files directly, removing flto or using boost < 1.80 works as expected.
The text was updated successfully, but these errors were encountered: