Skip to content

Commit d3eda13

Browse files
committed
Auto merge of #15385 - inferiorhumanorgans:explicit-cross-target, r=Veykril
proc-macro-test: Pass target to cargo invocation When cross compiling macos → dragonfly the dist build fails in the proc-maro-test-impl crate with the following error: `ld: unknown option: -z\nclang: error: linker command failed with exit code 1 (use -v to see invocation)` This appears to be a wart stemming from using an Apple host for cross compiling. Passing the target along to cargo allows it to pick up a linker that it understands and DTRT.
2 parents 9e3bf69 + c5d4f73 commit d3eda13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/proc-macro-test/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ fn main() {
7171
.arg("--target-dir")
7272
.arg(&target_dir);
7373

74+
if let Ok(target) = std::env::var("TARGET") {
75+
cmd.args(["--target", &target]);
76+
}
77+
7478
println!("Running {cmd:?}");
7579

7680
let output = cmd.output().unwrap();

0 commit comments

Comments
 (0)