void-packages/srcpkgs/rust/patches/use-correct-llvm-when-cross...

16 lines
811 B
Diff

Reason: rustc_codegen_llvm attempts to link against the host's llvm without this patch
--- rustc-1.28.0-src/src/librustc_llvm/build.rs.orig 2018-10-01 04:00:15.481334857 +0200
+++ rustc-1.28.0-src/src/librustc_llvm/build.rs 2018-10-01 04:01:15.145790417 +0200
@@ -227,8 +227,8 @@
println!("cargo:rustc-link-search=native={}", &lib[9..]);
} else if is_crossed {
if lib.starts_with("-L") {
- println!("cargo:rustc-link-search=native={}",
- lib[2..].replace(&host, &target));
+ println!("cargo:rustc-link-search=native={}{}",
+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
}
} else if lib.starts_with("-l") {
println!("cargo:rustc-link-lib={}", &lib[2..]);