about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorO01eg <o01eg@yandex.ru>2018-12-24 18:52:03 +0300
committerO01eg <o01eg@yandex.ru>2018-12-24 18:52:03 +0300
commit4e7d53db7127d0a5315cee002d4e891f4e92977e (patch)
treedc8b71036499e06becbc1ed25145df4158322601 /src/librustc
parent94bf2c15eb3d072e92855a605783a29920df9e46 (diff)
downloadrust-4e7d53db7127d0a5315cee002d4e891f4e92977e.tar.gz
rust-4e7d53db7127d0a5315cee002d4e891f4e92977e.zip
Search codegen backends based on target libdir instead of sysroot.
Fixes cases with custom libdir when it consists of two or more parts.
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/session/filesearch.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs
index c204556d517..8c72869eb12 100644
--- a/src/librustc/session/filesearch.rs
+++ b/src/librustc/session/filesearch.rs
@@ -124,6 +124,13 @@ pub fn make_target_lib_path(sysroot: &Path, target_triple: &str) -> PathBuf {
     sysroot.join(&relative_target_lib_path(sysroot, target_triple))
 }
 
+pub fn target_lib_path(target_triple: &str) -> PathBuf {
+    let mut p = PathBuf::from(RUST_LIB_DIR);
+    p.push(target_triple);
+    p.push("lib");
+    p
+}
+
 pub fn get_or_default_sysroot() -> PathBuf {
     // Follow symlinks.  If the resolved path is relative, make it absolute.
     fn canonicalize(path: Option<PathBuf>) -> Option<PathBuf> {