diff options
| author | bors <bors@rust-lang.org> | 2019-01-05 12:21:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-01-05 12:21:44 +0000 |
| commit | 68614265d312fc2cbe8a696f7dabb9416eb6f221 (patch) | |
| tree | 4e446f4cb80a2ec9d199eb6e55f7babf009c6889 /src/librustc/session | |
| parent | cae623c5ce12df8f237264d8f2c31fdaa664c382 (diff) | |
| parent | 4e7d53db7127d0a5315cee002d4e891f4e92977e (diff) | |
| download | rust-68614265d312fc2cbe8a696f7dabb9416eb6f221.tar.gz rust-68614265d312fc2cbe8a696f7dabb9416eb6f221.zip | |
Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton
Search codegen backends based on target libdir instead of sysroot Fixes #57014 Fixes cases with custom libdir when it consists of two or more parts.
Diffstat (limited to 'src/librustc/session')
| -rw-r--r-- | src/librustc/session/filesearch.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc/session/filesearch.rs b/src/librustc/session/filesearch.rs index 19f1c7a18fa..c6e68ba379e 100644 --- a/src/librustc/session/filesearch.rs +++ b/src/librustc/session/filesearch.rs @@ -114,6 +114,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> { |
