Skip to content

Commit a28d76b

Browse files
branchseerclaude
andcommitted
add zigcc linker wrappers for cross-compiling musl bindeps
Artifact dependencies (fspy_test_bin) target linux-musl, which requires a musl-capable linker. On non-Linux hosts, delegate to cargo-zigbuild's zig cc via wrapper scripts in .cargo/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent be30d20 commit a28d76b

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.cargo/config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ rustflags = ["--cfg", "tokio_unstable"] # also update .github/workflows/ci.yml
33

44
[unstable]
55
bindeps = true
6+
7+
# Linker wrappers for cross-compiling bindep targets (fspy_test_bin) via cargo-zigbuild.
8+
# On native Linux the system linker can handle musl targets; these are needed on non-Linux hosts.
9+
[target.x86_64-unknown-linux-musl]
10+
rustflags = ["-C", "linker=.cargo/zigcc-x86_64-unknown-linux-musl"]
11+
12+
[target.aarch64-unknown-linux-musl]
13+
rustflags = ["-C", "linker=.cargo/zigcc-aarch64-unknown-linux-musl"]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec cargo-zigbuild zig cc -- -fno-sanitize=all -target aarch64-linux-musl "$@"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec cargo-zigbuild zig cc -- -fno-sanitize=all -target x86_64-linux-musl "$@"

0 commit comments

Comments
 (0)