diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 8bba7a532..3ed49c779 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -55,12 +55,17 @@ pub fn build(target: Option<&str>, f: F) -> Result> where F: FnOnce(&mut Command) -> &mut Command, { - // Always use rust-lld and -Zbuild-std in case we're cross-compiling. let mut cmd = Command::new("cargo"); cmd.args(["build", "--message-format=json"]); if let Some(target) = target { - let config = format!("target.{target}.linker = \"rust-lld\""); - cmd.args(["--target", target, "--config", &config]); + cmd.args(["--target", target]); + // Always use rust-lld on macOS hosts. See + // https://github.com/aya-rs/aya/pull/908#issuecomment-2402813711 + #[cfg(target_os = "macos")] + { + let config = format!("target.{target}.linker = \"rust-lld\""); + cmd.args(["--target", target, "--config", &config]); + } } f(&mut cmd);