Unnamed repository; edit this file 'description' to name the repository.
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.
bors 2023-08-23
parent 8b8c7d7 · parent c5d4f73 · commit f5b7c60
-rw-r--r--crates/proc-macro-test/build.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/proc-macro-test/build.rs b/crates/proc-macro-test/build.rs
index 19a5caa4cc..7827157865 100644
--- a/crates/proc-macro-test/build.rs
+++ b/crates/proc-macro-test/build.rs
@@ -71,6 +71,10 @@ fn main() {
.arg("--target-dir")
.arg(&target_dir);
+ if let Ok(target) = std::env::var("TARGET") {
+ cmd.args(["--target", &target]);
+ }
+
println!("Running {cmd:?}");
let output = cmd.output().unwrap();