Repository navigation
Description
Why
reld is a polylinker. It routes each link to an engine: native wild for ELF (and Mach-O where it applies), or bridged lld engines (lld-link, ld64.lld, lld-mingw), with lld-link now running in-process through llvm-ld-coff (#202). Today the wild engine is vendored and renamed into crates/reld-core (plus reld-diff, reld-layout-schema, reld-reloc, reld-trace) from upstream 5793935f (wild v0.9.0, 2026-08-01). Our polylinker code is mixed into those same files.
Upstream wild is now under very active development. wild-linker/wild main is 189 commits ahead of our fork point, and v0.10.0 shipped 3 days after we vendored. It includes ELF correctness fixes (canonical PLT function identity, dynsym relaxed size, --wrap under plugin LTO, -ffat-lto-objects, library search order, …), linker-script features (PHDRS/FILEHDR, ASSERT, ALIGN(expr), compound assignment), LDEMULATION, -z force-ibt/-z cet-report, AArch64 ADRP+ADD relaxation, 12 perf changes, 24 Mach-O ports, __start_/__stop_ refs resolved before GC (#2479, groundwork for our -z start-stop-gc gap), MSVC-style COFF arg parsing (#2374), and an LLD ELF test suite wired in for x86_64 and aarch64.
With the renamed, vendored copy, taking any of that in means a hand-merged diff: about 20k changed lines on our side against 53 changed files upstream, mostly the same hot files (elf_writer.rs, elf.rs, layout.rs, args/elf.rs, fs.rs). The fix is structural:
zackees/wild: a GitHub fork ofwild-linker/wildcarrying reld's engine changes as a rebaseable patch series under upstream names.- reld consumes the fork as a git submodule compiled in through Cargo path dependencies, and keeps only the polylinker layer in its own crates.
Where each change goes
Measured against 5793935f:
| reld today | Destination |
|---|---|
Changes to upstream libwild files: elf_writer.rs (~1190 changed lines), args/elf.rs (650), layout.rs (541), fs.rs (469), args.rs (459, but see seam), input_data.rs (407), output_section_part_map.rs (270), symbol_db.rs (264), elf.rs (225), linker_plugins.rs, subprocess.rs, file_writer.rs, arch files, … |
fork, patch series |
diagnostic.rs (lld-format undefined-symbol errors, color), args/response_file.rs |
fork (called from layout.rs, error.rs, args/elf.rs, so this is engine behaviour) |
platforms/ host boundary plus the ban_platform_cfg_outside_boundary Dylint |
decision D3 |
bridge.rs (3.5k), target_probe.rs (1.8k), flag_table.rs, llvm_ld.rs |
reld, new polylinker crate (working name reld-poly) |
linker-diff/-layout/-utils/-trace changes (small: +583/−423, +60, +6, +8) |
fork |
crates/reld binary, acceptance/bridge-route/color/nix-rpath tests, mold external runner, 18 reld-added test sources |
reld (test sources that exercise engine fixes move to the fork's wild/tests) |
reld-testkit, benchmarks, CI, docs, roadmap |
reld |
| Removal of the Wasm backend | don't carry it (D2) |
Decisions (recommended defaults)
- D1 · Upstream names inside the fork. Keep
libwild,linker-*,wildand theWILD_*env vars in the fork. Thereld-*crate names,ld.reld/reld-link/ld64.reld, andRELD_*env vars belong to reld's front end, which mapsRELD_*onto the engine configuration. Renaming inside the fork would make every upstream commit conflict. - D2 · Keep upstream Wasm in the fork. Wasm alone is 39 of the 189 commits; deleting it would make each of those a conflict. reld simply never routes to it. Cost:
wasm-encoder/wasmparserget compiled in, and the license job's allow-list must cover them. - D3 · The platforms/Dylint boundary. It rewrote
cfgs acrossfs.rs,subprocess.rs,save_dir.rs,timing.rs,linker_plugins.rsandargs*.rs, which is standing patch surface against upstream. Either carry it as one isolated fork commit, with the Dylint run over the submodule in reld CI, or confine the lint to reld's own crates. Recommend carrying it as a single commit, and offering it upstream. - D4 · The seam. Today
Args::parsecallsbridge::resolve_link_target, so the engine depends on the polylinker. Invert that: the fork exposes a small public entry point that takes an already-resolved target/emulation, lining up with upstream's new explicit ELF emulations (#2492/#2497) andargs/coff.rs(#2374).reld-polyresolves the route first, then either callslibwildor runs the bridge. The seam is the one fork patch that upstream will never want, so keep it minimal. - D5 · Pins stay reachable. Rebasing the fork rewrites history, but reld's submodule pins must never dangle. Every rebase lands on a new branch,
reld/<upstream-version-or-date>, and every SHA reld pins gets a tag (reld-pin-<n>). Nothing pinned is ever force-pushed away. - D6 · Upstream first. Generic fixes (engine bugs, flags, perf) are also submitted as PRs to
wild-linker/wild, and each is dropped from the patch series once merged. The goal is a patch series limited to reld-only behaviour.
Phases
P0 · Create the fork
- Fork
wild-linker/wild→zackees/wild. Add branchreld/base=5793935f. - Fork CI: keep upstream's workflows on reld branches, trimmed to the jobs that matter (ELF tests x86_64/aarch64, Mach-O, clippy/fmt).
P1 · Extract reld's changes as a patch series at the old base (behaviour-neutral)
- Script the reverse mapping:
crates/reld-core→libwild,reld-diff→linker-diff, etc.,reld_*/RELD_*→ upstream identifiers. It extendsci/upstream-diff.sh, which already knows the path mapping. - Rebuild the delta as topic commits on
reld/v0.9(fromreld/base), not one squash. Suggested topics: host platform boundary (D3); fs/fallocate/huge pages; ELF args (Burn down the native mold-suite skip list #14 flags such as--undefined-glob,--image-base, …); diagnostics; each ELF correctness fix; perf (perf(elf): make OutputSectionPartMap sparse and add pinned Clang link replay #101, ci(perf): publish paired link-time and peak-RSS comparisons for Linux ELF linkers #103, feat(bench): group Linux link-time and RSS bars in one graph #105, perf(elf): preallocate fresh outputs and close the Wild performance gap #107); the D4 seam; test sources. - Confirm the fork's own
cargo test(wild integration tests,binssubmodule) passes onreld/v0.9, as a baseline.
P2 · Ingest into reld as a submodule, still at the old base
- Add submodule
vendor/wild→zackees/wild, pinned to areld-pin-*tag onreld/v0.9. - New crate
crates/reld-polywithbridge,target_probe,flag_table,llvm_ld(and thellvm-ldfeature).crates/relddepends onlibwildviapath = "../../vendor/wild/libwild". Path deps into another workspace are supported; the fork'sworkspace = truekeys resolve against its own root, and reld'sCargo.lockgoverns. - Delete
crates/reld-core,reld-diff,reld-layout-schema,reld-relocandreld-trace, or leave thin re-export shims for one release if anything external names them. - Fix up every consumer of those paths: tidy/clang-format tests,
ci/*.pyand its tests, cache keys (include the submodule SHA),.github/workflows/*checkouts (submodules: recursive, mind the existingmoldandtests/binssubmodules), Dylint target set (D3), cargo-deny/license allow-list (D2), release packaging,UPSTREAM.md/README.md/DESIGN.md/agents/. - Exit criterion: no behaviour change. Every reld check green exactly as on
maintoday: Phase 1 (linux-gnu x86_64/aarch64, windows-msvc/gnu, macOS), self-host two generations, cross-ship, release dry run with the llvm-ld-coff smoke, mold/wild suites with unchanged skip lists, bench within noise. Byte-identical outputs on the self-host link against a pre-migration build.
P3 · Rebase onto upstream main (v0.10.0+)
- Rebase
reld/v0.9→reld/<date>onto upstream main. Drop patches upstream superseded (compare--image-basevs #2513, fallocate/huge pages vs #2468/#2508, start/stop vs #2479, COFF args vs #2374) and record each drop in the tracking notes. - Toolchain: upstream MSRV is 1.97.1 (#2341), so reld's
rust-toolchain.toml(1.95.0) andrust-versionbump with this phase. - Bump the submodule. Re-run the P2 gate, plus enable upstream's LLD ELF test suite (#2399/#2459/#2439) in reld CI. Re-check mold skip lists: entries that now pass get removed, and new failures need a reason.
- Re-evaluate
-z start-stop-gc(Polylinker no-gaps gate: classify every flag, route by target not host, prove coverage before reld becomes soldr's default #123) on top of #2479.
P4 · Steady state
- Documented sync procedure (
UPSTREAM.md): cadence (e.g. per upstream release or monthly), rebase → tag → bump the submodule via a PR that must pass the full gate. - Scheduled CI job in reld that builds reld against the fork's latest
reld/*branch rebased on upstream main, and files an issue on conflict or failure. This is an early warning, not a merge. - Replace
ci/upstream-diff.shwithgit -C vendor/wild log --oneline upstream/main..HEAD(the patch series is the delta). - Open upstream PRs for the generic patches (D6); track the patch count trending down.
Risks
- Seam churn (D4): upstream is actively reshaping
Args(emulations, COFF parsing), so the seam may need rework at each rebase. Keep it one small commit. - Submodule ergonomics: contributors need
git submodule update --init --recursive. Release source tarballs fromgit archiveexclude submodules, so the release workflow must package from a recursive checkout. - Double CI cost: the fork runs wild's suite and reld runs its gate. Acceptable, and it catches engine regressions before the pin moves.
- Upstream test harness assumptions (paths such as
wild/tests/sources, atest-config.toml): run them in the fork, not re-hosted inside reld.
Done when
reld builds the ELF/Mach-O engine from the vendor/wild submodule at a reld-pin-* tag of zackees/wild, and the vendored engine crates are gone from reld. The fork's reld branch is rebased on current upstream main. All reld CI is green. UPSTREAM.md documents the sync procedure.
Activity
zackees commentedon Sep 19, 2026
P0 progress:
zackees/wildnow exists as a GitHub fork ofwild-linker/wild. Its scheduled, release and image workflows are disabled; only CI stays enabled. Decision D3 (the platforms boundary) is being offered upstream first. The implementation is onzackees/wild:platforms-facade, and #204 tracks the 2026-10-03 check that decides whether we align or carry it as a patch.