diff options
| author | Jan Niklas Hasse <jhasse@gmail.com> | 2014-01-11 20:44:39 +0100 |
|---|---|---|
| committer | Jan Niklas Hasse <jhasse@gmail.com> | 2014-01-11 20:44:39 +0100 |
| commit | e330d4b8bc5ac5baa512a9a9fad9e151769fc2bf (patch) | |
| tree | c4cbf263842f3339593785b870fabdcfe8d951d9 | |
| parent | 7fe8692d3347c4eabfad2fbbd8a336069102c63f (diff) | |
Use target libraries instead of host libraries. Fixes #11243
| -rw-r--r-- | src/librustpkg/context.rs | 3 | ||||
| -rw-r--r-- | src/librustpkg/path_util.rs | 5 | ||||
| -rw-r--r-- | src/librustpkg/util.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/librustpkg/context.rs b/src/librustpkg/context.rs index 681ae1dc807..96b7669d5ca 100644 --- a/src/librustpkg/context.rs +++ b/src/librustpkg/context.rs @@ -163,7 +163,8 @@ impl Context { pub fn in_target(sysroot: &Path) -> bool { debug!("Checking whether {} is in target", sysroot.display()); let mut p = sysroot.dir_path(); - p.set_filename(rustlibdir()); + p.pop(); + p.push(rustlibdir()); p.is_dir() } diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index aaaf56af436..78ff748c3b9 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -17,7 +17,7 @@ pub use target::{OutputType, Main, Lib, Test, Bench, Target, Build, Install}; pub use version::{Version, ExactRevision, NoVersion, split_version, split_version_general, try_parsing_version}; pub use rustc::metadata::filesearch::rust_path; -use rustc::metadata::filesearch::libdir; +use rustc::metadata::filesearch::{libdir, relative_target_lib_path}; use rustc::driver::driver::host_triple; use std::libc; @@ -213,10 +213,9 @@ pub fn library_in_workspace(path: &Path, short_name: &str, where: Target, library_in(short_name, version, &dir_to_search) } -// rustc doesn't use target-specific subdirectories pub fn system_library(sysroot: &Path, crate_id: &str) -> Option<Path> { let (lib_name, version) = split_crate_id(crate_id); - library_in(lib_name, &version, &sysroot.join(libdir())) + library_in(lib_name, &version, &sysroot.join(relative_target_lib_path(host_triple()))) } fn library_in(short_name: &str, version: &Version, dir_to_search: &Path) -> Option<Path> { diff --git a/src/librustpkg/util.rs b/src/librustpkg/util.rs index c1fa67171b5..1c76b652975 100644 --- a/src/librustpkg/util.rs +++ b/src/librustpkg/util.rs @@ -459,7 +459,7 @@ impl<'a> Visitor<()> for ViewItemVisitor<'a> { }; debug!("Finding and installing... {}", lib_name); // Check standard Rust library path first - let whatever = system_library(&self.context.sysroot(), lib_name); + let whatever = system_library(&self.context.sysroot_to_use(), lib_name); debug!("system library returned {:?}", whatever); match whatever { Some(ref installed_path) => { |
