From b747006fe4bb3fe6e2ad5655fff4d4e4bd4915e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Fri, 26 Jun 2026 17:15:31 +0200 Subject: [PATCH 1/6] Remove windows-gnu* test ignores --- .../rustc_target/src/spec/base/windows_gnu.rs | 1 - .../src/spec/base/windows_gnullvm.rs | 1 - src/bootstrap/mk/Makefile.in | 4 +- tests/codegen-llvm/align-struct.rs | 1 - tests/codegen-llvm/issues/issue-56927.rs | 1 - .../simd-intrinsic-transmute-array.rs | 1 - .../by-value-non-immediate-argument.rs | 1 - tests/debuginfo/embedded-visualizer.rs | 1 - tests/debuginfo/empty-string.rs | 1 - tests/debuginfo/method-on-enum.rs | 2 - tests/debuginfo/numeric-types.rs | 2 - tests/debuginfo/pretty-huge-vec.rs | 1 - tests/debuginfo/pretty-slices.rs | 1 - tests/debuginfo/pretty-std-collections.rs | 1 - tests/debuginfo/pretty-std.rs | 1 - tests/debuginfo/pretty-uninitialized-vec.rs | 1 - tests/debuginfo/rc_arc.rs | 1 - tests/debuginfo/thread-names.rs | 1 - tests/run-make/avr-rjmp-offset/rmake.rs | 4 - tests/run-make/dump-ice-to-disk/rmake.rs | 1 - .../run-make/foreign-rust-exceptions/rmake.rs | 4 - tests/run-make/lto-long-filenames_cn/rmake.rs | 6 -- tests/run-make/panic-abort-eh_frame/rmake.rs | 4 - tests/run-make/prune-link-args/rmake.rs | 2 - .../raw-dylib-alt-calling-convention/lib.rs | 76 +++++++++---------- tests/run-make/reproducible-build-2/rmake.rs | 3 - .../rmake.rs | 1 - .../unstable-feature-usage-metrics/rmake.rs | 1 - tests/ui/alloc-error/alloc-error-backtrace.rs | 3 - .../ui/linking/executable-no-mangle-strip.rs | 1 - tests/ui/lto/weak-works.rs | 2 - tests/ui/runtime/backtrace-debuginfo.rs | 3 - 32 files changed, 37 insertions(+), 97 deletions(-) diff --git a/compiler/rustc_target/src/spec/base/windows_gnu.rs b/compiler/rustc_target/src/spec/base/windows_gnu.rs index 1a343c737ad45..e35946982f773 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnu.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnu.rs @@ -99,7 +99,6 @@ pub(crate) fn opts() -> TargetOptions { late_link_args_static, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, - requires_uwtable: true, eh_frame_header: false, debuginfo_kind: DebuginfoKind::Dwarf, // FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to diff --git a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs index 5db5fb95924c5..3be80d0a4e4c7 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs @@ -42,7 +42,6 @@ pub(crate) fn opts() -> TargetOptions { late_link_args, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, - requires_uwtable: true, eh_frame_header: false, no_default_libraries: false, has_thread_local: true, diff --git a/src/bootstrap/mk/Makefile.in b/src/bootstrap/mk/Makefile.in index 4d4b37eec08b0..7edf7fc7e3ba0 100644 --- a/src/bootstrap/mk/Makefile.in +++ b/src/bootstrap/mk/Makefile.in @@ -123,9 +123,9 @@ ci-msvc: ci-msvc-py ci-msvc-ps1 # Used to split tests across multiple CI runners. # Test both x and bootstrap entrypoints. ci-mingw-x: - $(Q)$(CFG_SRC_DIR)/x test --stage 2 $(TEST_SET1) + $(Q)$(CFG_SRC_DIR)/x test --stage 2 --no-fail-fast $(TEST_SET1) ci-mingw-bootstrap: - $(Q)$(BOOTSTRAP) test --stage 2 $(TEST_SET2) + $(Q)$(BOOTSTRAP) test --stage 2 --no-fail-fast $(TEST_SET2) ci-mingw: ci-mingw-x ci-mingw-bootstrap .PHONY: dist diff --git a/tests/codegen-llvm/align-struct.rs b/tests/codegen-llvm/align-struct.rs index d4cc65e9158cf..186c2371f6f7d 100644 --- a/tests/codegen-llvm/align-struct.rs +++ b/tests/codegen-llvm/align-struct.rs @@ -1,7 +1,6 @@ //@ compile-flags: -C no-prepopulate-passes -Z mir-opt-level=0 // 32bit MSVC does not align things properly so we suppress high alignment annotations (#112480) //@ ignore-i686-pc-windows-msvc -//@ ignore-i686-pc-windows-gnu #![crate_type = "lib"] diff --git a/tests/codegen-llvm/issues/issue-56927.rs b/tests/codegen-llvm/issues/issue-56927.rs index 415ef073e03ac..d05f628f15f07 100644 --- a/tests/codegen-llvm/issues/issue-56927.rs +++ b/tests/codegen-llvm/issues/issue-56927.rs @@ -1,7 +1,6 @@ //@ compile-flags: -C no-prepopulate-passes // 32bit MSVC does not align things properly so we suppress high alignment annotations (#112480) //@ ignore-i686-pc-windows-msvc -//@ ignore-i686-pc-windows-gnu #![crate_type = "rlib"] diff --git a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs index 05c2f7e1bdfc1..f6f959f836a59 100644 --- a/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs +++ b/tests/codegen-llvm/simd-intrinsic/simd-intrinsic-transmute-array.rs @@ -2,7 +2,6 @@ //@ compile-flags: -C no-prepopulate-passes // 32bit MSVC does not align things properly so we suppress high alignment annotations (#112480) //@ ignore-i686-pc-windows-msvc -//@ ignore-i686-pc-windows-gnu #![crate_type = "lib"] #![allow(non_camel_case_types)] diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index 4ecb76ee0846d..8ec1da1ce3e72 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -3,7 +3,6 @@ //@ min-gdb-version: 13.0 //@ compile-flags:-g //@ disable-gdb-pretty-printers -//@ ignore-windows-gnu: #128973 //@ ignore-aarch64-unknown-linux-gnu (gdb tries to read from 0x0; FIXME: #128973) //@ ignore-powerpc64: #128973 on both -gnu and -musl diff --git a/tests/debuginfo/embedded-visualizer.rs b/tests/debuginfo/embedded-visualizer.rs index 3f403d57abe9b..824cc35c3ffa4 100644 --- a/tests/debuginfo/embedded-visualizer.rs +++ b/tests/debuginfo/embedded-visualizer.rs @@ -1,6 +1,5 @@ //@ compile-flags:-g //@ ignore-lldb -//@ ignore-windows-gnu: #128981 // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/empty-string.rs b/tests/debuginfo/empty-string.rs index 7454d171a4592..dba1745af9b19 100644 --- a/tests/debuginfo/empty-string.rs +++ b/tests/debuginfo/empty-string.rs @@ -1,4 +1,3 @@ -//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g //@ ignore-backends: gcc diff --git a/tests/debuginfo/method-on-enum.rs b/tests/debuginfo/method-on-enum.rs index 6c724622a89e6..dc8b36e6f045f 100644 --- a/tests/debuginfo/method-on-enum.rs +++ b/tests/debuginfo/method-on-enum.rs @@ -5,8 +5,6 @@ //@ compile-flags:-g //@ disable-gdb-pretty-printers -//@ ignore-windows-gnu: #128973 - // === GDB TESTS =================================================================================== //@ gdb-command:run diff --git a/tests/debuginfo/numeric-types.rs b/tests/debuginfo/numeric-types.rs index 468c6553af2cc..9408d779079ff 100644 --- a/tests/debuginfo/numeric-types.rs +++ b/tests/debuginfo/numeric-types.rs @@ -1,7 +1,5 @@ //@ compile-flags:-g -//@ ignore-windows-gnu: #128981 - // Note: u128 visualization was not supported in 10.0.22621.3233 but was fixed in 10.0.26100.2161. // FIXME(#133107): this is temporarily marked as `only-64bit` because of course 32-bit msvc has diff --git a/tests/debuginfo/pretty-huge-vec.rs b/tests/debuginfo/pretty-huge-vec.rs index 2cea3f224c4a1..1518726c92ea0 100644 --- a/tests/debuginfo/pretty-huge-vec.rs +++ b/tests/debuginfo/pretty-huge-vec.rs @@ -1,4 +1,3 @@ -//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ ignore-aix: FIXME(#137965) //@ compile-flags:-g diff --git a/tests/debuginfo/pretty-slices.rs b/tests/debuginfo/pretty-slices.rs index e8813e00ae637..576ab1dc17619 100644 --- a/tests/debuginfo/pretty-slices.rs +++ b/tests/debuginfo/pretty-slices.rs @@ -1,5 +1,4 @@ //@ ignore-android: FIXME(#10381) -//@ ignore-windows-gnu: #128981 //@ compile-flags:-g //@ ignore-backends: gcc diff --git a/tests/debuginfo/pretty-std-collections.rs b/tests/debuginfo/pretty-std-collections.rs index 4f0b51e8589dd..41bbecf576bf8 100644 --- a/tests/debuginfo/pretty-std-collections.rs +++ b/tests/debuginfo/pretty-std-collections.rs @@ -1,5 +1,4 @@ //@ ignore-android: FIXME(#10381) -//@ ignore-windows-gnu: #128981 //@ compile-flags:-g //@ ignore-backends: gcc diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std.rs index 3ecaf02ab7d26..225199357b579 100644 --- a/tests/debuginfo/pretty-std.rs +++ b/tests/debuginfo/pretty-std.rs @@ -1,5 +1,4 @@ // ignore-tidy-linelength -//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g // LLDB 1800+ tests were not tested in CI, broke, and now are disabled diff --git a/tests/debuginfo/pretty-uninitialized-vec.rs b/tests/debuginfo/pretty-uninitialized-vec.rs index f3e02fa06f9f0..d34f50650ead2 100644 --- a/tests/debuginfo/pretty-uninitialized-vec.rs +++ b/tests/debuginfo/pretty-uninitialized-vec.rs @@ -1,4 +1,3 @@ -//@ ignore-windows-gnu: #128981 //@ ignore-android: FIXME(#10381) //@ compile-flags:-g //@ ignore-backends: gcc diff --git a/tests/debuginfo/rc_arc.rs b/tests/debuginfo/rc_arc.rs index b22b7e0d1611d..6f69e75ccec13 100644 --- a/tests/debuginfo/rc_arc.rs +++ b/tests/debuginfo/rc_arc.rs @@ -1,4 +1,3 @@ -//@ ignore-windows-gnu: #128981 //@ compile-flags:-g //@ min-cdb-version: 10.0.18317.1001 diff --git a/tests/debuginfo/thread-names.rs b/tests/debuginfo/thread-names.rs index 19d27f55f80de..a4d32bc50747e 100644 --- a/tests/debuginfo/thread-names.rs +++ b/tests/debuginfo/thread-names.rs @@ -4,7 +4,6 @@ //@[macos] only-macos //@[win] only-windows //@ ignore-sgx -//@ ignore-windows-gnu: gdb on windows-gnu does not print thread names // === GDB TESTS ================================================================================== // diff --git a/tests/run-make/avr-rjmp-offset/rmake.rs b/tests/run-make/avr-rjmp-offset/rmake.rs index a4a219436ad26..592c3e75b7eec 100644 --- a/tests/run-make/avr-rjmp-offset/rmake.rs +++ b/tests/run-make/avr-rjmp-offset/rmake.rs @@ -11,10 +11,6 @@ //! "emit-asm" is used, as described in the issue description of #129301: //! https://github.com/rust-lang/rust/issues/129301#issue-2475070770 -// FIXME(#133480): this has been randomly failing on `x86_64-mingw` due to linker hangs or -// crashes... so I'm going to disable this test for windows for now. -//@ ignore-windows-gnu - use run_make_support::{llvm_objdump, path, rustc, rustc_minicore}; fn main() { diff --git a/tests/run-make/dump-ice-to-disk/rmake.rs b/tests/run-make/dump-ice-to-disk/rmake.rs index 319cbc6e0ca89..b80b8a8823892 100644 --- a/tests/run-make/dump-ice-to-disk/rmake.rs +++ b/tests/run-make/dump-ice-to-disk/rmake.rs @@ -26,7 +26,6 @@ //! backtrace becomes ``. //@ ignore-cross-compile (exercising ICE dump on host) -//@ ignore-i686-pc-windows-gnu (unwind mechanism produces unpredictable backtraces) //@ ignore-i686-pc-windows-msvc (sometimes partial backtrace becomes ``) use std::cell::OnceCell; diff --git a/tests/run-make/foreign-rust-exceptions/rmake.rs b/tests/run-make/foreign-rust-exceptions/rmake.rs index 9c917078aaae1..2fc4d5172b0f5 100644 --- a/tests/run-make/foreign-rust-exceptions/rmake.rs +++ b/tests/run-make/foreign-rust-exceptions/rmake.rs @@ -10,10 +10,6 @@ //@ needs-unwind // Reason: unwinding panics is exercised in this test -//@ ignore-i686-pc-windows-gnu -// Reason: This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder -// so cross-DLL unwinding does not work. - use run_make_support::{run_fail, rustc}; fn main() { diff --git a/tests/run-make/lto-long-filenames_cn/rmake.rs b/tests/run-make/lto-long-filenames_cn/rmake.rs index fc25a2ac166b2..e70694e6b0b2a 100644 --- a/tests/run-make/lto-long-filenames_cn/rmake.rs +++ b/tests/run-make/lto-long-filenames_cn/rmake.rs @@ -1,10 +1,4 @@ //@ ignore-cross-compile -// gnu ld is confused with intermediate files having multibytes characters in their names: -// = note: ld.exe: cannot find f0d5ff18d6510ebc-???_???_??????????_?_?????_?_???????.d50c2 \ -// 4c0c4ea93cc-cgu.0.rcgu.o: Invalid argument -// as this is not something rustc can fix by itself, -// we just skip the test on windows-gnu for now. Hence: -//@ ignore-windows-gnu use run_make_support::{rfs, rustc}; diff --git a/tests/run-make/panic-abort-eh_frame/rmake.rs b/tests/run-make/panic-abort-eh_frame/rmake.rs index 5c859a7482674..72b6546873565 100644 --- a/tests/run-make/panic-abort-eh_frame/rmake.rs +++ b/tests/run-make/panic-abort-eh_frame/rmake.rs @@ -7,10 +7,6 @@ // See https://github.com/rust-lang/rust/pull/112403 and // https://github.com/rust-lang/rust/pull/143613. -//@ only-linux -// FIXME(Oneirical): the DW_CFA symbol appears on Windows-gnu, because uwtable -// is forced to true on Windows targets (see #128136). - use run_make_support::{llvm_objdump, rustc}; fn main() { diff --git a/tests/run-make/prune-link-args/rmake.rs b/tests/run-make/prune-link-args/rmake.rs index ea4ffa732bf3f..41c85a614cd54 100644 --- a/tests/run-make/prune-link-args/rmake.rs +++ b/tests/run-make/prune-link-args/rmake.rs @@ -6,8 +6,6 @@ // See https://github.com/rust-lang/rust/pull/10749 //@ ignore-cross-compile -//@ ignore-windows-gnu -// Reason: The space is parsed as an empty linker argument on windows-gnu. use run_make_support::rustc; diff --git a/tests/run-make/raw-dylib-alt-calling-convention/lib.rs b/tests/run-make/raw-dylib-alt-calling-convention/lib.rs index dcb5fee9ecc76..f14ac4ba679bd 100644 --- a/tests/run-make/raw-dylib-alt-calling-convention/lib.rs +++ b/tests/run-make/raw-dylib-alt-calling-convention/lib.rs @@ -50,7 +50,7 @@ extern "fastcall" { fn fastcall_fn_10_renamed(i: i32); } -#[cfg(target_env = "msvc")] +#[cfg(any(target_env = "msvc", all(target_env = "gnu", target_abi = "llvm")))] #[link(name = "extern", kind = "raw-dylib")] extern "vectorcall" { fn vectorcall_fn_1(i: i32); @@ -66,49 +66,43 @@ extern "vectorcall" { fn vectorcall_fn_10_renamed(i: i32); } -pub fn library_function(run_msvc_only: bool) { +pub fn library_function(_run_msvc_only: bool) { unsafe { - if !run_msvc_only { - stdcall_fn_1(14); - stdcall_fn_2(16, 3.5); - stdcall_fn_3(3.5); - stdcall_fn_4(1, 2, 3.0); - stdcall_fn_5(S { x: 1, y: 2 }, 16); - stdcall_fn_6(Some(&S { x: 10, y: 12 })); - stdcall_fn_7(S2 { x: 15, y: 16 }, 3); - stdcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); - stdcall_fn_9(1, 3.0); - stdcall_fn_10_renamed(19); + stdcall_fn_1(14); + stdcall_fn_2(16, 3.5); + stdcall_fn_3(3.5); + stdcall_fn_4(1, 2, 3.0); + stdcall_fn_5(S { x: 1, y: 2 }, 16); + stdcall_fn_6(Some(&S { x: 10, y: 12 })); + stdcall_fn_7(S2 { x: 15, y: 16 }, 3); + stdcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); + stdcall_fn_9(1, 3.0); + stdcall_fn_10_renamed(19); - fastcall_fn_1(14); - fastcall_fn_2(16, 3.5); - fastcall_fn_3(3.5); - fastcall_fn_4(1, 2, 3.0); - fastcall_fn_6(Some(&S { x: 10, y: 12 })); - fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); - fastcall_fn_9(1, 3.0); - fastcall_fn_10_renamed(19); - } else { - // FIXME: 91167 - // rustc generates incorrect code for the calls to fastcall_fn_5 and fastcall_fn_7 - // on i686-pc-windows-gnu; disabling these until the indicated issue is fixed. - fastcall_fn_5(S { x: 1, y: 2 }, 16); - fastcall_fn_7(S2 { x: 15, y: 16 }, 3); + fastcall_fn_1(14); + fastcall_fn_2(16, 3.5); + fastcall_fn_3(3.5); + fastcall_fn_4(1, 2, 3.0); + fastcall_fn_6(Some(&S { x: 10, y: 12 })); + fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); + fastcall_fn_9(1, 3.0); + fastcall_fn_10_renamed(19); + fastcall_fn_5(S { x: 1, y: 2 }, 16); + fastcall_fn_7(S2 { x: 15, y: 16 }, 3); - // GCC doesn't support vectorcall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485 - #[cfg(target_env = "msvc")] - { - vectorcall_fn_1(14); - vectorcall_fn_2(16, 3.5); - vectorcall_fn_3(3.5); - vectorcall_fn_4(1, 2, 3.0); - vectorcall_fn_5(S { x: 1, y: 2 }, 16); - vectorcall_fn_6(Some(&S { x: 10, y: 12 })); - vectorcall_fn_7(S2 { x: 15, y: 16 }, 3); - vectorcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); - vectorcall_fn_9(1, 3.0); - vectorcall_fn_10_renamed(19); - } + // GCC doesn't support vectorcall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485 + #[cfg(any(target_env = "msvc", all(target_env = "gnu", target_abi = "llvm")))] + { + vectorcall_fn_1(14); + vectorcall_fn_2(16, 3.5); + vectorcall_fn_3(3.5); + vectorcall_fn_4(1, 2, 3.0); + vectorcall_fn_5(S { x: 1, y: 2 }, 16); + vectorcall_fn_6(Some(&S { x: 10, y: 12 })); + vectorcall_fn_7(S2 { x: 15, y: 16 }, 3); + vectorcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] }); + vectorcall_fn_9(1, 3.0); + vectorcall_fn_10_renamed(19); } } } diff --git a/tests/run-make/reproducible-build-2/rmake.rs b/tests/run-make/reproducible-build-2/rmake.rs index 1de5ca1e6f7fb..3a5a911be36ee 100644 --- a/tests/run-make/reproducible-build-2/rmake.rs +++ b/tests/run-make/reproducible-build-2/rmake.rs @@ -8,9 +8,6 @@ //@ ignore-cross-compile -//@ ignore-windows-gnu -// GNU Linker for Windows is non-deterministic. - use run_make_support::{bin_name, is_windows_msvc, rfs, rust_lib_name, rustc}; fn main() { diff --git a/tests/run-make/unstable-feature-usage-metrics-incremental/rmake.rs b/tests/run-make/unstable-feature-usage-metrics-incremental/rmake.rs index 61ad07717b658..59ab277ef329e 100644 --- a/tests/run-make/unstable-feature-usage-metrics-incremental/rmake.rs +++ b/tests/run-make/unstable-feature-usage-metrics-incremental/rmake.rs @@ -11,7 +11,6 @@ //! `i686-pc-windows-gnu`. //@ ignore-cross-compile (exercises metrics incremental on host) -//@ ignore-i686-pc-windows-gnu (unwind mechanism produces unpredictable backtraces) use std::path::{Path, PathBuf}; diff --git a/tests/run-make/unstable-feature-usage-metrics/rmake.rs b/tests/run-make/unstable-feature-usage-metrics/rmake.rs index 85ea50e7065ab..b13ba79a249bd 100644 --- a/tests/run-make/unstable-feature-usage-metrics/rmake.rs +++ b/tests/run-make/unstable-feature-usage-metrics/rmake.rs @@ -10,7 +10,6 @@ //! - Forked from `dump-ice-to-disk` test, where `i686-pc-windows-gnu` has unpredictable backtraces. //@ ignore-cross-compile (exercises metrics dump on host) -//@ ignore-i686-pc-windows-gnu (unwind mechanism produces unpredictable backtraces) use std::path::{Path, PathBuf}; diff --git a/tests/ui/alloc-error/alloc-error-backtrace.rs b/tests/ui/alloc-error/alloc-error-backtrace.rs index 7109458d976cd..f6aa7aba5374b 100644 --- a/tests/ui/alloc-error/alloc-error-backtrace.rs +++ b/tests/ui/alloc-error/alloc-error-backtrace.rs @@ -17,9 +17,6 @@ //@ ignore-watchos needs the `.dSYM` files to be moved to the device //@ ignore-visionos needs the `.dSYM` files to be moved to the device -// FIXME(#117097): backtrace (possibly unwinding mechanism) seems to be different on at least -// `i686-mingw` (32-bit windows-gnu)? cc #128911. -//@ ignore-windows-gnu //@ ignore-backends: gcc //@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test diff --git a/tests/ui/linking/executable-no-mangle-strip.rs b/tests/ui/linking/executable-no-mangle-strip.rs index 240c16af67bdb..4e6ffed1db04a 100644 --- a/tests/ui/linking/executable-no-mangle-strip.rs +++ b/tests/ui/linking/executable-no-mangle-strip.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ ignore-windows-gnu: only statics marked with used can be GC-ed on windows-gnu //@ ignore-wasm: wasm, for better or worse, exports all #[no_mangle] // Regression test for . diff --git a/tests/ui/lto/weak-works.rs b/tests/ui/lto/weak-works.rs index 1ff47ca602d24..99aa557ac3220 100644 --- a/tests/ui/lto/weak-works.rs +++ b/tests/ui/lto/weak-works.rs @@ -1,8 +1,6 @@ //@ run-pass //@ compile-flags: -C codegen-units=8 -Z thinlto -//@ ignore-i686-pc-windows-gnu -//@ ignore-x86_64-pc-windows-gnu #![feature(linkage)] diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index cc6132495f4ce..49a2f1953e031 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -16,9 +16,6 @@ //@ ignore-watchos needs the `.dSYM` files to be moved to the device //@ ignore-visionos needs the `.dSYM` files to be moved to the device -// FIXME(#117097): backtrace (possibly unwinding mechanism) seems to be different on at least -// `i686-mingw` (32-bit windows-gnu)? cc #128911. -//@ ignore-windows-gnu //@ ignore-backends: gcc use std::env; From e15140b0f74da3416dca840301520a00e3f2d0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 27 Jun 2026 01:04:35 +0200 Subject: [PATCH 2/6] gnullvm: default to static unwinder for bins --- compiler/rustc_codegen_ssa/src/back/link.rs | 11 +++++++++- .../src/spec/base/windows_gnullvm.rs | 20 +++++++++++++++++++ library/unwind/src/lib.rs | 5 ----- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index b7e153f47b024..44ce6f1bff504 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2136,7 +2136,16 @@ fn add_late_link_args( || crate_info.dependency_formats.iter().any(|(ty, list)| { *ty == crate_type && list.iter().any(|&linkage| linkage == Linkage::Dynamic) }); - if any_dynamic_crate { + let (override_static, override_dynamic) = if sess.target.crt_static_respected { + // borrowed from https://github.com/rust-lang/rust/blob/40557f6225e337d68c8d4f086557ce54135f5dd9/compiler/rustc_session/src/session.rs#L390 + let requested_features = sess.opts.cg.target_feature.split(','); + let found_negative = requested_features.clone().any(|r| r == "-crt-static"); + let found_positive = requested_features.clone().any(|r| r == "+crt-static"); + (found_positive, found_negative) + } else { + (false, false) + }; + if (any_dynamic_crate && !override_static) || override_dynamic { if let Some(args) = sess.target.late_link_args_dynamic.get(&flavor) { cmd.verbatim_args(args.iter().map(Deref::deref)); } diff --git a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs index 3be80d0a4e4c7..4a9f5b8f67241 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs @@ -22,6 +22,24 @@ pub(crate) fn opts() -> TargetOptions { TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), mingw_libs); add_link_args(&mut late_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), mingw_libs); + // LLD doesn't support push/pop + let dynamic_unwind_libs = &["-lunwind"]; + let mut late_link_args_dynamic = + TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), dynamic_unwind_libs); + add_link_args( + &mut late_link_args_dynamic, + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + dynamic_unwind_libs, + ); + let static_unwind_libs = &["-l:libunwind.a"]; + let mut late_link_args_static = + TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), static_unwind_libs); + add_link_args( + &mut late_link_args_static, + LinkerFlavor::Gnu(Cc::Yes, Lld::No), + static_unwind_libs, + ); + TargetOptions { os: Os::Windows, env: Env::Gnu, @@ -40,6 +58,8 @@ pub(crate) fn opts() -> TargetOptions { pre_link_objects_self_contained: pre_mingw_self_contained(), link_self_contained: LinkSelfContainedDefault::InferredForMingw, late_link_args, + late_link_args_dynamic, + late_link_args_static, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, eh_frame_header: false, diff --git a/library/unwind/src/lib.rs b/library/unwind/src/lib.rs index 4e380d8894781..7f923a773131d 100644 --- a/library/unwind/src/lib.rs +++ b/library/unwind/src/lib.rs @@ -208,8 +208,3 @@ cfg_select! { #[cfg(target_os = "hurd")] #[link(name = "gcc_s")] unsafe extern "C" {} - -#[cfg(all(target_os = "windows", target_env = "gnu", target_abi = "llvm"))] -#[link(name = "unwind", kind = "static", modifiers = "-bundle", cfg(target_feature = "crt-static"))] -#[link(name = "unwind", cfg(not(target_feature = "crt-static")))] -unsafe extern "C" {} From f0248237c1ececa0f5a2f40701519bc7aa4db647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 27 Jun 2026 01:32:47 +0200 Subject: [PATCH 3/6] test gnullvm --- src/ci/github-actions/jobs.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index f58b385db87ac..b9b4296f54235 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -47,8 +47,7 @@ runners: os: windows-11-arm <<: *base-job - - &job-aarch64-linux - # Free some disk space to avoid running out of space during the build. + - &job-aarch64-linux # Free some disk space to avoid running out of space during the build. free_disk: true os: ubuntu-24.04-arm <<: *base-job @@ -72,8 +71,7 @@ runners: <<: *base-job envs: - production: - &production + production: &production DEPLOY_BUCKET: rust-lang-ci2 # AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named # AWS_SECRET_ACCESS_KEY_. Including the key id in the name allows to @@ -108,7 +106,6 @@ jobs: DOCKER_SCRIPT: dist.sh <<: *job-linux-36c-codebuild - # Jobs that run on each push to a pull request (PR). # # These jobs automatically inherit envs.pr, to avoid repeating it in each job @@ -686,16 +683,16 @@ auto: # SourceForge is notoriously flaky, so we mirror it on our own infrastructure. # x86_64-mingw is split into two jobs to run tests in parallel. - - name: x86_64-mingw-1 + - name: x86_64-llvm-mingw-1 env: SCRIPT: make ci-mingw-x - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnullvm <<: *job-windows - - name: x86_64-mingw-2 + - name: x86_64-llvm-mingw-2 env: SCRIPT: make ci-mingw-bootstrap - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnullvm <<: *job-windows - name: dist-x86_64-msvc From 7a452340d001d7d9e30d6d77d9b82fbbda7da582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 27 Jun 2026 14:12:07 +0200 Subject: [PATCH 4/6] test 32-bit gnu --- src/ci/github-actions/jobs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index b9b4296f54235..05ccd8ae4db34 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -683,16 +683,16 @@ auto: # SourceForge is notoriously flaky, so we mirror it on our own infrastructure. # x86_64-mingw is split into two jobs to run tests in parallel. - - name: x86_64-llvm-mingw-1 + - name: i686-mingw-1 env: SCRIPT: make ci-mingw-x - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnullvm + RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu <<: *job-windows - - name: x86_64-llvm-mingw-2 + - name: i686-mingw-2 env: SCRIPT: make ci-mingw-bootstrap - RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnullvm + RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu <<: *job-windows - name: dist-x86_64-msvc From a7925efe4fbba8d8f21a2b9a5ffd816a874536e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 27 Jun 2026 14:39:20 +0200 Subject: [PATCH 5/6] restore forced uwtables --- compiler/rustc_target/src/spec/base/windows_gnu.rs | 1 + compiler/rustc_target/src/spec/base/windows_gnullvm.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/compiler/rustc_target/src/spec/base/windows_gnu.rs b/compiler/rustc_target/src/spec/base/windows_gnu.rs index e35946982f773..1a343c737ad45 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnu.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnu.rs @@ -99,6 +99,7 @@ pub(crate) fn opts() -> TargetOptions { late_link_args_static, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, + requires_uwtable: true, eh_frame_header: false, debuginfo_kind: DebuginfoKind::Dwarf, // FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to diff --git a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs index 4a9f5b8f67241..ccd1da357147f 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs @@ -62,6 +62,7 @@ pub(crate) fn opts() -> TargetOptions { late_link_args_static, abi_return_struct_as_int: true, emit_debug_gdb_scripts: false, + requires_uwtable: true, eh_frame_header: false, no_default_libraries: false, has_thread_local: true, From 7a0ea3421883c65accc45839173d7b6a06abbb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sat, 27 Jun 2026 14:40:46 +0200 Subject: [PATCH 6/6] back to 64-bit jobs --- src/ci/github-actions/jobs.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 05ccd8ae4db34..a20237dd432cc 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -683,16 +683,28 @@ auto: # SourceForge is notoriously flaky, so we mirror it on our own infrastructure. # x86_64-mingw is split into two jobs to run tests in parallel. - - name: i686-mingw-1 + - name: x86_64-mingw-1 env: SCRIPT: make ci-mingw-x - RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu <<: *job-windows - - name: i686-mingw-2 + - name: x86_64-mingw-2 env: SCRIPT: make ci-mingw-bootstrap - RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu + <<: *job-windows + + - name: x86_64-llvm-mingw-1 + env: + SCRIPT: make ci-mingw-x + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-llvm + <<: *job-windows + + - name: x86_64-llvm-mingw-2 + env: + SCRIPT: make ci-mingw-bootstrap + RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-llvm <<: *job-windows - name: dist-x86_64-msvc