port(wasm): Error on undefined strong symbols by default and add --allow-undefined - #2345
Open
lapla-cogito wants to merge 3 commits into
Open
port(wasm): Error on undefined strong symbols by default and add --allow-undefined#2345lapla-cogito wants to merge 3 commits into
--allow-undefined#2345lapla-cogito wants to merge 3 commits into
Conversation
lapla-cogito
force-pushed
the
wasm_undef
branch
from
August 5, 2026 06:33
7fe1c8a to
77d9ca5
Compare
|
|
||
| //#Config:data | ||
| //#CompArgs: -DTEST_DATA | ||
| //#LinkArgs: --allow-undefined |
Member
There was a problem hiding this comment.
If I add -fPIC to the flags, this test fails. Same for the data test in undefined-strong.c.
| // Data | ||
| #[strum(serialize = "__data_end")] | ||
| DataEnd, | ||
| #[strum(serialize = "__global_base")] |
Member
There was a problem hiding this comment.
I'd be somewhat tempted to have at least the "__global_base" commit as a separate PR, unless there's some reason why it needs to be together with the other changes? But I don't feel strongly, so if you want to keep all three commits together in a single PR, that's also fine.
| // Data | ||
| #[strum(serialize = "__data_end")] | ||
| DataEnd, | ||
| #[strum(serialize = "__global_base")] |
Member
There was a problem hiding this comment.
It'd be good if we had integration tests for things like __global_base for the usual reasons - mostly it let's us verify against wasm-ld. But if it's not practical for some reason, then the unit tests will do.
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.
commits:
Define the linker-defined
__global_baseat the start of static data (after the stack when--stack-first), as expected by wasi-libc and similar inputs once undefined symbols are enforced.Non-weak undefined functions/globals without
EXPLICIT_NAME, and unresolved data symbols, are link errors by default.Support
--allow-undefinedwhich leave unresolved strong functions (as host imports) / undefined data.Part of #1431