Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dynlib keeps exported functions alive in emscripten (#23469)
ref https://forum.nim-lang.org/t/11338 ref https://github.com/beef331/wasm3/blob/master/src/wasm3/exporter.nim ref emscripten-core/emscripten#6233 ref https://github.com/emscripten-core/emscripten/blob/3.1.56/system/include/emscripten/em_macros.h#L10 `EMSCRIPTEN_KEEPALIVE` is a macro that is used to prevent unused functions from being deadcode eliminated in emscripten, which is a simple wrapper around `__attribute__((used))`. This PR follows suits and expects dynlib is supposed to keep these functions alive. In the future, `exportwasm` might be introduced. After this PR, a function with `{.dynlib, exportc.}` can be reused from other wasm programs reliably.
- Loading branch information