Repository navigation
feat(bridge): escalate silently-ignored flags to lld - #122
Merged
Merged
Conversation
…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]>
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.
Summary
Implements #121: the native engine no longer silently drops linker flags. Any flag it cannot honor escalates to the bundled
lldengine (the capable linker), matching how LTO/ICF already route.Changes
bridge.rs:ArchiveGroups,NoStdlib,SortCommon,Stats— and route the corresponding flags tolld:--start-group/--end-group/-(/-)→ArchiveGroups--nostdlib→NoStdlib--sort-common→SortCommon--stats→StatsSILENTLY_IGNORED_FLAGS: the remaining entries (--fatal-warnings,--color-diagnostics,--no-undefined-version,--undefined-version) were already routed bycollect_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).--engine=reld(forced native), these flags now fail loudly as unrecognized rather than being dropped.Tests
previously_silently_ignored_flags_now_route_to_lldasserts each flag maps to the right capability.Note
This is the correctness prerequisite for reld-as-default (#120, soldr#3262).
--start-group/--end-groupnow 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