diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 36a6d2cc3..af4e1219f 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -230,9 +230,11 @@ fn main() { for lib in output(&mut cmd).split_whitespace() { if is_crossed { if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { - println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); + println!("cargo:rustc-link-search=native={}{}", + env::var("XBPS_CROSS_BASE").unwrap(), stripped); } else if let Some(stripped) = lib.strip_prefix("-L") { - println!("cargo:rustc-link-search=native={}", stripped.replace(&host, &target)); + println!("cargo:rustc-link-search=native={}{}", + env::var("XBPS_CROSS_BASE").unwrap(), stripped); } } else if let Some(stripped) = lib.strip_prefix("-LIBPATH:") { println!("cargo:rustc-link-search=native={}", stripped); -- 2.34.1