void-packages/srcpkgs/rust/patches/0014-Void-fix-linkage-again...

32 lines
1.4 KiB
Diff

From 07efbc3bdd67de4e13b0f3f4df853a9de0800ec3 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 3 May 2020 18:05:22 +0200
Subject: [PATCH 14/15] Void: fix linkage against host/target LLVM in cross
setups
---
src/librustc_llvm/build.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index 621363bed..01322e1d2 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -242,9 +242,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.26.2