Repository navigation
feat(core): route Mach-O by target to ld64.lld on any host; darwin-cc rule (#192) - #198
Merged
Merged
Conversation
…rwin-cc argv (#192) Mach-O selection is now target-driven (-arch, -platform_version, Apple --target triple, Mach-O input header) so a Linux host links Mach-O via ld64.lld. Darwin cc-driver flags are rejected with a pointer to -Clinker-flavor=ld64.lld. Adds cross-ship Linux-linked Mach-O hello run on macos-14. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…build (#192) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
11 of 20 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.
Closes #192
Summary
-arch,-platform_version, an Apple--target=/-targettriple (newSignal::DriverTarget), or a Mach-O input header route told64.lldon any host (log reasontarget:mach-o).reject_darwin_cc_argvruns before engine selection for Mach-O links (reads through@file, noRELD_UNSUPPORTEDescape). The error names the offending flag and-Clinker-flavor=ld64.lld.DARWIN_CC_DRIVER_FLAGSis separate from the ELF flag table.bridge_route.rsend-to-end tests, docs (polylinker.md,routing-maintenance.md).cross-ship.yml: link a Mach-O hello on ubuntu (hand-written libSystem TAPI v4 stub,-fuse-ld=lld --ld-path=reld) and run it on macos-14.Validation (local, Linux host)
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings: clean.cargo test -p reld-core --lib: 252 passed.cargo test -p reld --test bridge-route: 13 passed.darwin_cc_argv_fails_naming_linker_flavorexpected-nodefaultlibsto be reported, but the rejection names the first darwin-cc flag in argv order, which is--target=itself. The assertion now accepts either.--target=arm64-apple-macos11 -fuse-ld=lld --ld-path=target/release/reld -nostdlib hello.o libSystem.tbdproducedMach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>. The invocation log has"engine":"ld64.lld"and"reason":"target:mach-o". clang passed-arch arm64 -platform_version macos 11.0.0 11.0.0to reld. (The NixOS cc-wrapper clang injects-dynamic-linker, so it can't be used for a Darwin target.)reld -arch arm64 -nodefaultlibs ...fails (exit 255) with an error that names-nodefaultlibsand-Clinker-flavor=ld64.lld.act -W .github/workflows/ci.yml -j hygiene --pull=false --action-offline-mode -P ubuntu-24.04=catthehacker/ubuntu:act-24.04passed (Job succeeded): fmt, clippy-D warnings,cargo deny check licenses.--action-offline-modeis needed because act can't clone SHA-pinned actions (remote not found).🤖 Generated with Claude Code