Repository navigation
Conversation
Collaborator
Author
|
Well that doesn't pass CI... |
Collaborator
|
So you are suggesting the What kind of side modules are you building that require this? Could you switch to just using |
Collaborator
|
I think I tracked down the issue and came up with an alternative fix: #28055 |
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
Collaborator
|
Closing in favor of #28055 |
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 fixes a regression introduced in #25930. Closes #27403.