From 0546d115288ce0d6c3a819909de12fba5ce673fd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 24 Apr 2020 11:18:59 -0700 Subject: Fix cross-compiling LLD to different platforms Looks like the native build system isn't great a coping with this, so try to work around that with a few workarounds. --- src/bootstrap/bin/llvm-config-wrapper.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/bootstrap/bin') diff --git a/src/bootstrap/bin/llvm-config-wrapper.rs b/src/bootstrap/bin/llvm-config-wrapper.rs index cf77af44ff6..89984bb55df 100644 --- a/src/bootstrap/bin/llvm-config-wrapper.rs +++ b/src/bootstrap/bin/llvm-config-wrapper.rs @@ -10,7 +10,14 @@ fn main() { let mut cmd = Command::new(real_llvm_config); cmd.args(env::args().skip(1)).stderr(Stdio::piped()); let output = cmd.output().expect("failed to spawn llvm-config"); - let stdout = String::from_utf8_lossy(&output.stdout); + let mut stdout = String::from_utf8_lossy(&output.stdout); + + if let Ok(to_replace) = env::var("LLVM_CONFIG_SHIM_REPLACE") { + if let Ok(replace_with) = env::var("LLVM_CONFIG_SHIM_REPLACE_WITH") { + stdout = stdout.replace(&to_replace, &replace_with).into(); + } + } + print!("{}", stdout.replace("\\", "/")); io::stdout().flush().unwrap(); process::exit(output.status.code().unwrap_or(1)); -- cgit 1.4.1-3-g733a5