Skip to content

routing: TargetProbe drives engine selection, plus Engine::MingwLld (reld#123 Phase 3, step 2) #184

Closed

Description

@zackees

Sub-issue of #123 (Phase 3 — D2, target-keyed routing). Follows #178/#182, which added crates/reld-core/src/target_probe.rs without wiring it in.

Why

Engine selection is still keyed on the invocation (-flavor, the executable name, else PlatformKind::host() in crates/reld-core/src/args.rs). So a link for a target other than the host — clang --target=x86_64-w64-mingw32 --ld-path=reld on Linux, or an i386/arm32 object — takes the host's route and fails or mislinks.

Scope

  • Feed TargetProbe's result into engine selection in crates/reld-core/src/bridge.rs (and platform selection in args.rs). Where they disagree, the probed target wins over the host fallback; an explicit -flavor or engine override still wins over the probe. State and test that precedence.
  • Engine::MingwLld: a COFF/MinGW link driven through ld.lld -m i386pep (lld's MinGW driver), selected when the probe says PE/COFF-for-MinGW (-m i386pep, -m i386pe, a COFF /OUT:-less GNU-style line with COFF inputs). clang --target=x86_64-w64-mingw32 --ld-path=reld must link on Linux.
  • Objects for architectures the native engine does not support (i386, arm32, mips, s390x, ppc64be, riscv32) route to ld.lld instead of failing with Unsupported architecture.
  • Update the routing docs/tests per agents/docs/routing-maintenance.md in the same PR (AGENTS.md requires routing changes to flip routing tests and CI route expectations together).

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions