@@ -198,7 +198,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
198
198
"arm" => ( "arm" , "--32" ) ,
199
199
_ => panic ! ( "unsupported arch {}" , sess. target. arch) ,
200
200
} ;
201
- let result = std:: process:: Command :: new ( dlltool)
201
+ let result = std:: process:: Command :: new ( & dlltool)
202
202
. args ( [
203
203
"-d" ,
204
204
def_file_path. to_str ( ) . unwrap ( ) ,
@@ -218,12 +218,15 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
218
218
219
219
match result {
220
220
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
+ } ) ;
222
225
}
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 ( ) => {
224
228
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 ) ,
227
230
} )
228
231
}
229
232
_ => { }
@@ -431,7 +434,7 @@ fn string_to_io_error(s: String) -> io::Error {
431
434
432
435
fn find_binutils_dlltool ( sess : & Session ) -> OsString {
433
436
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 {
435
438
return dlltool_path. clone ( ) . into_os_string ( ) ;
436
439
}
437
440
0 commit comments