Repository navigation
Conversation
reld is now soldr's default linker, per the polylinker direction. `fast` resolves to reld on every platform — `clang --ld-path=reld` on Linux (native ELF backend needs the driver for CRT/PT_INTERP) and direct `reld` elsewhere (lld-link/ld64.lld bridge) — and `from_env_and_config` falls back to `fast` when neither SOLDR_LINKER nor the config `linker` field is set. `SOLDR_LINKER=default` / `ld` remain explicit no-injection opt-outs. Also: - Remove the now-dead `mold_on_path` probe and fold `resolve_for_target_with_probe` into `resolve_for_target`. - Strip `reld` (not just `rust-lld`) for MSVC proc-macro dylibs (soldr#1992), since reld bridges to lld-link on MSVC. - Probe `reld` in `linker_candidate_identity` so the PEP 517 fallback cache invalidates on reld upgrades. Closes #3262. Co-Authored-By: Claude Code <[email protected]>
clang's `--ld-path=` rejects a bare linker name the same way `-fuse-ld=`
does ("invalid linker name"), so `--ld-path=reld` failed on every real
Linux link. Resolve `reld` to its absolute path on `PATH` before injecting
it; fall back to the bare name (a clear clang error, never a mislink) when
it is absent.
Also pin test fixtures to `SOLDR_LINKER=default` so real-build tests don't
depend on `reld` being installed; linker tests set it explicitly.
Co-Authored-By: Claude Code <[email protected]>
Collaborator
Author
|
Reverting this migration as premature: reld-as-default is unsafe until reld routes silently-ignored flags to a capable linker instead of dropping them (tracked in reld#121). Re-opening after that prerequisite lands. |
9 of 31 tasks
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
Makes reld soldr's default linker, per the polylinker direction (#3262). reld behaves correctly everywhere via its native ELF backend (Linux) and
lldbridge (Windows/COFF, macOS/Mach-O); any residual linking bug is a reld fix.Changes
fastnow resolves to reld:clang --ld-path=reldon Linux (reld's native ELF backend needs the driver to inject CRT/PT_INTERP), directreldelsewhere (itslld-link/ld64.lldbridge handles CRT). Removed the deadmold_on_pathprobe and foldedresolve_for_target_with_probeintoresolve_for_target.from_env_and_config(None, None)returnsFastinstead ofDefault, sosoldr cargoinjects reld when nothing is explicitly configured.SOLDR_LINKER=default/ldremain explicit opt-outs.reld(soldr#1992): reld bridges tolld-linkon MSVC, so it has the same proc-macro-DLL failure mode asrust-lld.reld(--ld-path=detection) so the cache invalidates on reld upgrades.docs/API.md, config schema) and tests updated.Tests
linkerunit tests pass, includingfast_resolves_to_reld_on_every_target,proc_macro_on_msvc_loses_the_injected_reld, and the updatednothing_falls_back_to_fast_reld.cargo_front_door_default_linker_injects_reldasserts the front door injects reld by default (clang--ld-path=reldon Linux, directreldelsewhere).cargo clippy -p soldr-cli --all-targets -- -D warningsandcargo fmt --checkclean.Closes #3262.
🤖 Generated with Claude Code