Skip to content

feat(bridge): escalate silently-ignored flags to lld - #122

Merged
zackees merged 1 commit into
mainfrom
escalate-ignored-flags
Sep 16, 2026
Merged

zackees merged 1 commit into
mainfrom
escalate-ignored-flags

Conversation

@zackees

@zackees zackees commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements #121: the native engine no longer silently drops linker flags. Any flag it cannot honor escalates to the bundled lld engine (the capable linker), matching how LTO/ICF already route.

Changes

  • Added four capabilities to bridge.rs: ArchiveGroups, NoStdlib, SortCommon, Stats — and route the corresponding flags to lld:
    • --start-group / --end-group / -( / -) → ArchiveGroups
    • --nostdlib → NoStdlib
    • --sort-common → SortCommon
    • --stats → Stats
  • Emptied SILENTLY_IGNORED_FLAGS: the remaining entries (--fatal-warnings, --color-diagnostics, --no-undefined-version, --undefined-version) were already routed by collect_requested_capabilities, so their silent-ignore entries were misleading dead weight. Also dropped the -(/-) short group delimiters from the short silent-ignore list (they now route too).
  • Under --engine=reld (forced native), these flags now fail loudly as unrecognized rather than being dropped.

Tests

  • New unit test previously_silently_ignored_flags_now_route_to_lld asserts each flag maps to the right capability.
  • 43 bridge tests + 189 reld-core lib tests pass; clippy/fmt clean.

Note

This is the correctness prerequisite for reld-as-default (#120, soldr#3262). --start-group/--end-group now route to lld (correct), rather than relying on the native engine's untested demand-driven cycle resolution — an equivalence test for the native path can follow separately if we later want those flags handled natively.

Closes #121.

🤖 Generated with Claude Code

…ing them

The native engine used to silently drop `--start-group`/`--end-group`,
`--nostdlib`, `--sort-common`, `--stats`, and the redundant entries for
`--fatal-warnings`/`--color-diagnostics`/`--undefined-version`. Any flag the
native engine cannot honor must escalate to a capable engine, never silently
vanish — this is the correctness prerequisite for using reld as a default
linker.

- Add `ArchiveGroups`, `NoStdlib`, `SortCommon`, `Stats` capabilities and
  route the corresponding flags to `lld`.
- Empty `SILENTLY_IGNORED_FLAGS` (drop the redundant entries already routed by
  the bridge) and the `-(`/`-)` short group delimiters.
- Add a routing unit test.

Closes #121.

Co-Authored-By: Claude Code <[email protected]>
@zackees
zackees merged commit eb722dc into main Sep 16, 2026
13 of 15 checks passed
@zackees
zackees deleted the escalate-ignored-flags branch November 5, 2026 05:51
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.

Escalate silently-ignored flags to lld — never drop linker semantics (reld-as-default prerequisite)

1 participant