emscripten-core / emscripten-core/emscripten

dynamic linking fails with cmake

Open
#16,157 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

The Emscripten.cmake toolchain file has:
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)

which makes modules with SIDE_MODULE assert with:
Aborted(Assertion failed: need to see wasm magic number)

I have a small test which has one main and two small libs (main is MAIN_MODULE)
It will fail if I create the libraries like so:
add_library(_a STATIC lib_a.cpp)

If I comment out that line in Emscripten.cmake file that still fails.

But if I also change to shared lib:
add_library(_a SHARED lib_a.cpp)

it will work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.