diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index 22b58c13949e2..ef55682d541ec 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -231,7 +231,11 @@ impl<'a> ArArchiveBuilder<'a> { "gnu" => ArchiveKind::Gnu, "bsd" => ArchiveKind::Bsd, "darwin" => ArchiveKind::Darwin, - "coff" => ArchiveKind::Coff, + "coff" => { + // FIXME: ar_archive_writer doesn't support COFF archives yet. + // https://github.com/rust-lang/ar_archive_writer/issues/9 + ArchiveKind::Gnu + } "aix_big" => ArchiveKind::AixBig, kind => { self.sess.dcx().emit_fatal(UnknownArchiveKind { kind }); diff --git a/compiler/rustc_target/src/spec/base/msvc.rs b/compiler/rustc_target/src/spec/base/msvc.rs index efe949a4e9074..44fc376fea084 100644 --- a/compiler/rustc_target/src/spec/base/msvc.rs +++ b/compiler/rustc_target/src/spec/base/msvc.rs @@ -14,6 +14,7 @@ pub fn opts() -> TargetOptions { pre_link_args, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, + archive_format: "coff".into(), // Currently this is the only supported method of debuginfo on MSVC // where `*.pdb` files show up next to the final artifact.