@@ -198,7 +198,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
198198 "arm" => ( "arm" , "--32" ) ,
199199 _ => panic ! ( "unsupported arch {}" , sess. target. arch) ,
200200 } ;
201- let result = std:: process:: Command :: new ( dlltool)
201+ let result = std:: process:: Command :: new ( & dlltool)
202202 . args ( [
203203 "-d" ,
204204 def_file_path. to_str ( ) . unwrap ( ) ,
@@ -218,12 +218,15 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
218218
219219 match result {
220220 Err ( e) => {
221- sess. emit_fatal ( ErrorCallingDllTool { error : e } ) ;
221+ sess. emit_fatal ( ErrorCallingDllTool {
222+ dlltool_path : dlltool. to_string_lossy ( ) ,
223+ error : e,
224+ } ) ;
222225 }
223- Ok ( output) if !output. status . success ( ) => {
226+ // dlltool returns '0' on failure, so check for error output instead.
227+ Ok ( output) if !output. stderr . is_empty ( ) => {
224228 sess. emit_fatal ( DlltoolFailImportLibrary {
225- stdout : String :: from_utf8_lossy ( & output. stdout ) ,
226- stderr : String :: from_utf8_lossy ( & output. stderr ) ,
229+ error : String :: from_utf8_lossy ( & output. stderr ) ,
227230 } )
228231 }
229232 _ => { }
@@ -431,7 +434,7 @@ fn string_to_io_error(s: String) -> io::Error {
431434
432435fn find_binutils_dlltool ( sess : & Session ) -> OsString {
433436 assert ! ( sess. target. options. is_like_windows && !sess. target. options. is_like_msvc) ;
434- if let Some ( dlltool_path) = & sess. opts . unstable_opts . dlltool {
437+ if let Some ( dlltool_path) = & sess. opts . cg . dlltool {
435438 return dlltool_path. clone ( ) . into_os_string ( ) ;
436439 }
437440
0 commit comments