@@ -119,7 +119,7 @@ pub struct Build {
119119 lldb_python_dir : Option < String > ,
120120
121121 // Runtime state filled in later on
122- cc : HashMap < String , ( gcc:: Tool , PathBuf ) > ,
122+ cc : HashMap < String , ( gcc:: Tool , Option < PathBuf > ) > ,
123123 cxx : HashMap < String , gcc:: Tool > ,
124124 compiler_rt_built : RefCell < HashMap < String , PathBuf > > ,
125125}
@@ -549,7 +549,7 @@ impl Build {
549549 // FIXME: the guard against msvc shouldn't need to be here
550550 if !target. contains ( "msvc" ) {
551551 cargo. env ( format ! ( "CC_{}" , target) , self . cc ( target) )
552- . env ( format ! ( "AR_{}" , target) , self . ar ( target) )
552+ . env ( format ! ( "AR_{}" , target) , self . ar ( target) . unwrap ( ) ) // only msvc is None
553553 . env ( format ! ( "CFLAGS_{}" , target) , self . cflags ( target) . join ( " " ) ) ;
554554 }
555555
@@ -825,8 +825,8 @@ impl Build {
825825 }
826826
827827 /// Returns the path to the `ar` archive utility for the target specified.
828- fn ar ( & self , target : & str ) -> & Path {
829- & self . cc [ target] . 1
828+ fn ar ( & self , target : & str ) -> Option < & Path > {
829+ self . cc [ target] . 1 . as_ref ( ) . map ( |p| & * * p )
830830 }
831831
832832 /// Returns the path to the C++ compiler for the target specified, may panic
0 commit comments