Skip to content

port(wasm): Add support for --export-if-defined - #2408

Merged
lapla-cogito merged 1 commit into
wild-linker:mainfrom
erscholtz:wasm-export-if-defined
Aug 16, 2026
Merged

port(wasm): Add support for --export-if-defined#2408
lapla-cogito merged 1 commit into
wild-linker:mainfrom
erscholtz:wasm-export-if-defined

Conversation

@erscholtz

Copy link
Copy Markdown
Contributor

Adds support for wasm-ld's --export-if-defined option.

Symbols passed through --export-if-defined are exported when defined and ignored otherwise. Existing --export behaviour remains unchanged and still reports missing symbols as errors.

Tested locally on NixOS with:

  • nix develop --command env RUSTFLAGS=-Dwarnings cargo test --profile ci --workspace
  • nix develop --command env NIX_HARDENING_ENABLE= RUSTFLAGS=-Dwarnings cargo test --features wasm -- wasm
  • cargo clippy --all-targets --workspace --target x86_64-unknown-linux-gnu
  • cargo clippy --all-targets --workspace --target x86_64-unknown-linux-gnu --no-default-features
  • cargo +nightly fmt --all -- --check

Related to #2335.

@lapla-cogito lapla-cogito changed the title feat(wasm): Add support for --export-if-defined port(wasm): Add support for --export-if-defined Aug 16, 2026
@lapla-cogito lapla-cogito linked an issue Aug 16, 2026 that may be closed by this pull request

@lapla-cogito lapla-cogito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@lapla-cogito
lapla-cogito merged commit b058374 into wild-linker:main Aug 16, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasm: support --export-if-defined

2 participants