Skip to content

Commit

Permalink
MSVC targets should use COFF as their archive format
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed Apr 4, 2024
1 parent 0fd5712 commit 9d70907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/base/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9d70907

Please sign in to comment.