Skip to content

feat(core): add TargetProbe to derive link target from argv and inputs (#178) - #182

Merged
zackees merged 2 commits into
mainfrom
feat/meta-work-178
Sep 18, 2026
Merged

zackees merged 2 commits into
mainfrom
feat/meta-work-178

Conversation

@zackees

@zackees zackees commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Closes #178

Adds crates/reld-core/src/target_probe.rs (pub(crate) mod target_probe; in lib.rs). It derives the link target, meaning format, arch, class and endianness plus the signal that decided it, from argv and input headers. It follows the 6-step precedence (explicit emulation > inferred signals > OUTPUT_FORMAT, with -EB/-EL overrides). Header reads are bounds-checked, so malformed input returns None instead of panicking. No new dependencies and no host-platform cfg.

Local verification (rebased on origin/main bc412bf):

  • cargo test -p reld-core --lib target_probe: 4 passed
  • cargo test -p reld-core --lib tidy_tests: 4 passed
  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo clippy --workspace --all-targets --no-default-features -- -D warnings: clean
  • python3 ci/check_dependencies.py: ok
  • cargo dylint --path dylints/ban_platform_cfg_outside_boundary --workspace -- --all-targets: clean

Not run: the act hygiene lane (the repo has no .actrc). Its fmt, clippy and dependency steps were run directly above. Cargo.toml and Cargo.lock are unchanged, so cargo deny check licenses is not affected.

🤖 Generated with Claude Code

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.

routing: TargetProbe — derive the link target from argv and inputs (reld#123 Phase 3, step 1)

1 participant