diff --git a/src/lib.rs b/src/lib.rs index a4ba8457e..262424287 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -522,12 +522,14 @@ impl Build { let mut cmd = compiler.to_command(); let is_arm = target.contains("aarch64") || target.contains("arm"); let clang = compiler.family == ToolFamily::Clang; + let gnu = compiler.family == ToolFamily::Gnu; command_add_output_file( &mut cmd, &obj, self.cuda, target.contains("msvc"), clang, + gnu, false, is_arm, ); @@ -1377,6 +1379,7 @@ impl Build { let msvc = target.contains("msvc"); let compiler = self.try_get_compiler()?; let clang = compiler.family == ToolFamily::Clang; + let gnu = compiler.family == ToolFamily::Gnu; let (mut cmd, name) = if msvc && asm_ext == Some(AsmFileExt::DotAsm) { self.msvc_macro_assembler()? @@ -1396,7 +1399,9 @@ impl Build { ) }; let is_arm = target.contains("aarch64") || target.contains("arm"); - command_add_output_file(&mut cmd, &obj.dst, self.cuda, msvc, clang, is_asm, is_arm); + command_add_output_file( + &mut cmd, &obj.dst, self.cuda, msvc, clang, gnu, is_asm, is_arm, + ); // armasm and armasm64 don't requrie -c option if !msvc || !is_asm || !is_arm { cmd.arg("-c"); @@ -3578,10 +3583,11 @@ fn command_add_output_file( cuda: bool, msvc: bool, clang: bool, + gnu: bool, is_asm: bool, is_arm: bool, ) { - if msvc && !clang && !cuda && !(is_asm && is_arm) { + if msvc && !clang && !gnu && !cuda && !(is_asm && is_arm) { let mut s = OsString::from("-Fo"); s.push(&dst); cmd.arg(s);