about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorPeter Atashian <retep998@gmail.com>2016-06-16 08:38:06 -0400
committerPeter Atashian <retep998@gmail.com>2016-06-16 08:38:06 -0400
commite0992df35f7827fe09b1a54558e396511bcba12a (patch)
tree983d88328de165c69c61ab0b79b9f7eeaa768b6b /src/bootstrap
parenta479a6a7a6fa1bfe1f18d7d7411ad14e7b8ca17b (diff)
downloadrust-e0992df35f7827fe09b1a54558e396511bcba12a.tar.gz
rust-e0992df35f7827fe09b1a54558e396511bcba12a.zip
Fix issue where rustbuild expected msvc to have ar
Signed-off-by: Peter Atashian <retep998@gmail.com>
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/build/cc.rs4
-rw-r--r--src/bootstrap/build/mod.rs8
-rw-r--r--src/bootstrap/build/sanity.rs4
3 files changed, 10 insertions, 6 deletions
diff --git a/src/bootstrap/build/cc.rs b/src/bootstrap/build/cc.rs
index d0b0f1007c6..7eb50b8b86d 100644
--- a/src/bootstrap/build/cc.rs
+++ b/src/bootstrap/build/cc.rs
@@ -57,7 +57,9 @@ pub fn find(build: &mut Build) {
         let compiler = cfg.get_compiler();
         let ar = cc2ar(compiler.path(), target);
         build.verbose(&format!("CC_{} = {:?}", target, compiler.path()));
-        build.verbose(&format!("AR_{} = {:?}", target, ar));
+        if let Some(ref ar) = ar {
+            build.verbose(&format!("AR_{} = {:?}", target, ar));
+        }
         build.cc.insert(target.to_string(), (compiler, ar));
     }
 
diff --git a/src/bootstrap/build/mod.rs b/src/bootstrap/build/mod.rs
index 21d12d27d92..dadb0ffa6c9 100644
--- a/src/bootstrap/build/mod.rs
+++ b/src/bootstrap/build/mod.rs
@@ -119,7 +119,7 @@ pub struct Build {
     lldb_python_dir: Option<String>,
 
     // Runtime state filled in later on
-    cc: HashMap<String, (gcc::Tool, PathBuf)>,
+    cc: HashMap<String, (gcc::Tool, Option<PathBuf>)>,
     cxx: HashMap<String, gcc::Tool>,
     compiler_rt_built: RefCell<HashMap<String, PathBuf>>,
 }
@@ -549,7 +549,7 @@ impl Build {
         // FIXME: the guard against msvc shouldn't need to be here
         if !target.contains("msvc") {
             cargo.env(format!("CC_{}", target), self.cc(target))
-                 .env(format!("AR_{}", target), self.ar(target))
+                 .env(format!("AR_{}", target), self.ar(target).unwrap()) // only msvc is None
                  .env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
         }
 
@@ -825,8 +825,8 @@ impl Build {
     }
 
     /// Returns the path to the `ar` archive utility for the target specified.
-    fn ar(&self, target: &str) -> &Path {
-        &self.cc[target].1
+    fn ar(&self, target: &str) -> Option<&Path> {
+        self.cc[target].1.as_ref().map(|p| &**p)
     }
 
     /// Returns the path to the C++ compiler for the target specified, may panic
diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs
index a2905277429..fd6cdc702cc 100644
--- a/src/bootstrap/build/sanity.rs
+++ b/src/bootstrap/build/sanity.rs
@@ -70,7 +70,9 @@ pub fn check(build: &mut Build) {
     // also build some C++ shims for LLVM so we need a C++ compiler.
     for target in build.config.target.iter() {
         need_cmd(build.cc(target).as_ref());
-        need_cmd(build.ar(target).as_ref());
+        if let Some(ar) = build.ar(target) {
+            need_cmd(ar.as_ref());
+        }
     }
     for host in build.config.host.iter() {
         need_cmd(build.cxx(host).as_ref());