Repository navigation
Enable real dynamic linking with -shared by default - #25930
Merged
Merged
Conversation
sbc100
force-pushed
the
shared_flag_part2
branch
from
December 11, 2025 00:39
655b473 to
e01726b
Compare
sbc100
commented
Dec 11, 2025
sbc100
force-pushed
the
shared_flag_part2
branch
2 times, most recently
from
December 11, 2025 00:49
6e4f78f to
3b0addc
Compare
kripken
reviewed
Dec 11, 2025
sbc100
force-pushed
the
shared_flag_part2
branch
3 times, most recently
from
May 12, 2026 04:13
3b9f050 to
d2bc4e4
Compare
sbc100
commented
May 12, 2026
sbc100
force-pushed
the
shared_flag_part2
branch
2 times, most recently
from
May 14, 2026 01:07
dbf81cc to
2a061bd
Compare
sbc100
added a commit
that referenced
this pull request
May 14, 2026
sbc100
force-pushed
the
shared_flag_part2
branch
4 times, most recently
from
May 15, 2026 19:07
d43b884 to
19b4b57
Compare
Collaborator
Author
I actually ended up leaving the cmake |
Collaborator
Author
|
OK, I think this change is in pretty good shape now |
-shared by default
Collaborator
Author
sbc100
disabled auto-merge
May 21, 2026 22:04
hoodmane
added a commit
to pyodide/pyodide
that referenced
this pull request
Jul 28, 2026
hoodmane
added a commit
to pyodide/pyodide
that referenced
this pull request
Jul 28, 2026
hoodmane
added a commit
to pyodide/pyodide
that referenced
this pull request
Jul 29, 2026
hoodmane
added a commit
to pyodide/pyodide
that referenced
this pull request
Jul 31, 2026
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Oct 23, 2026
In emscripten-core#25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-emscripten-core#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes emscripten-core#27430. Fixes: emscripten-core#27403
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Oct 23, 2026
In emscripten-core#25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-emscripten-core#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes emscripten-core#27430. Fixes: emscripten-core#27403
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Oct 23, 2026
In emscripten-core#25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-emscripten-core#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes emscripten-core#27430. Fixes: emscripten-core#27403
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Oct 23, 2026
In emscripten-core#25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-emscripten-core#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes emscripten-core#27430. Fixes: emscripten-core#27403
sbc100
added a commit
to sbc100/emscripten
that referenced
this pull request
Oct 27, 2026
In emscripten-core#25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-emscripten-core#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes emscripten-core#27430. Fixes: emscripten-core#27403
sbc100
added a commit
that referenced
this pull request
Oct 27, 2026
#28055) In #25930, `-shared` was implemented by defaulting `SIDE_MODULE` to `1` (which implies `LINKABLE=1`) and then special-casing `lld_flags` in `tools/building.py` to avoid `--whole-archive`. That special case had the unintended regression of also disabling `--whole-archive` for explicit `-sSIDE_MODULE=1` builds, while still running `wasm-ld` twice in `phase_link` for `-shared` due to `LINKABLE=1`. Instead, default `SIDE_MODULE` to `2` when `-shared` is used so `LINKABLE` remains disabled and `--whole-archive` is applied whenever `LINKABLE` is set. This restores the pre-#25930 `--whole-archive` behavior for `-sSIDE_MODULE=1` without enabling it for `-shared`. To keep native linker semantics for `-shared`, avoid passing `--no-export-dynamic` when `-shared` is specified so default-visibility symbols in object files are still exported automatically (unlike explicit `-sSIDE_MODULE=2`, which continues to DCE unexported symbols). Supersedes #27430. Fixes: #27403
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change essentially disables
FAKE_DYLIBSby default, which inturn means
-sharedwill now produce dynamic libraries by default.If you want the old behaviour you now need
-sFAKE_DYLIBS.