MSVC targets should use COFF as their archive format

This commit is contained in:
Daniel Paoliello 2024-04-04 11:16:09 -07:00
parent 0fd571286e
commit 9d7090726d
2 changed files with 6 additions and 1 deletions

View File

@ -231,7 +231,11 @@ fn build_inner(self, output: &Path) -> io::Result<bool> {
"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 });

View File

@ -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.