PSA: Dynamic linking overhead is now much lower

16 views
Skip to first unread message

Sam Clegg

unread,
Oct 29, 2025, 4:00:29 PMOct 29
to emscripte...@googlegroups.com
I just landed a fairly major update to emscripten's dynamic linking support:  https://github.com/emscripten-core/emscripten/pull/25522

Essentially we no longer build the main module as position independent (`-pie`/``-sRELOCATABLE`).  This reduces the code size and eliminates most runtime relocations from the main module.

Basically the overhead of using dynamic linking is almost completely eliminated, at least in the main module.

Hopefully we don't find any issues with this in the wild, and we followup with more exciting changes. for example, perhaps turning on `-Bdynamic` by default (i.e. allow shared libraries to be linked by default, without needing the `-sMAIN_MODULE` flag, just like on native platforms.

cheers,
sam

Sam Clegg

unread,
Nov 4, 2025, 2:46:47 PMNov 4
to emscripte...@googlegroups.com
This change is now released as part of 4.0.19


Reply all
Reply to author
Forward
0 new messages