Skip to content

Commit d95b6c1

Browse files
committed
MSVC targets should use COFF as their archive format
1 parent 0fd5712 commit d95b6c1

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

Diff for: .github/workflows/ci.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,16 @@ jobs:
5858
- name: mingw-check-tidy
5959
os: ubuntu-20.04-4core-16gb
6060
env: {}
61-
- name: x86_64-gnu-llvm-17
61+
- name: x86_64-msvc
6262
env:
63-
ENABLE_GCC_CODEGEN: "1"
64-
os: ubuntu-20.04-16core-64gb
65-
- name: x86_64-gnu-tools
66-
os: ubuntu-20.04-16core-64gb
67-
env: {}
63+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
64+
SCRIPT: make ci-msvc
65+
os: windows-2019-8core-32gb
66+
- name: i686-msvc
67+
env:
68+
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
69+
SCRIPT: make ci-msvc
70+
os: windows-2019-8core-32gb
6871
defaults:
6972
run:
7073
shell: "${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}"

Diff for: compiler/rustc_codegen_ssa/src/back/archive.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ impl<'a> ArArchiveBuilder<'a> {
231231
"gnu" => ArchiveKind::Gnu,
232232
"bsd" => ArchiveKind::Bsd,
233233
"darwin" => ArchiveKind::Darwin,
234-
"coff" => ArchiveKind::Coff,
234+
"coff" => {
235+
// TODO: ar_archive_writer doesn't support COFF archives yet.
236+
ArchiveKind::Gnu
237+
},
235238
"aix_big" => ArchiveKind::AixBig,
236239
kind => {
237240
self.sess.dcx().emit_fatal(UnknownArchiveKind { kind });

Diff for: compiler/rustc_target/src/spec/base/msvc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub fn opts() -> TargetOptions {
1414
pre_link_args,
1515
abi_return_struct_as_int: true,
1616
emit_debug_gdb_scripts: false,
17+
archive_format: "coff".into(),
1718

1819
// Currently this is the only supported method of debuginfo on MSVC
1920
// where `*.pdb` files show up next to the final artifact.

Diff for: src/ci/github-actions/ci.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,17 @@ jobs:
357357
- name: mingw-check-tidy
358358
<<: *job-linux-4c
359359

360-
- name: x86_64-gnu-llvm-17
360+
- name: x86_64-msvc
361361
env:
362-
ENABLE_GCC_CODEGEN: "1"
363-
<<: *job-linux-16c
362+
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
363+
SCRIPT: make ci-msvc
364+
<<: *job-windows-8c
364365

365-
- name: x86_64-gnu-tools
366-
<<: *job-linux-16c
366+
- name: i686-msvc
367+
env:
368+
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-msvc
369+
SCRIPT: make ci-msvc
370+
<<: *job-windows-8c
367371

368372
auto:
369373
<<: *base-ci-job

0 commit comments

Comments
 (0)