From f056fe0842a345475166a598d7cc910dad241312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:04:20 +0800 Subject: [PATCH] clang-cl: use `/arch:SSE2` for `x86` target arch - Official Rust Windows targets require `SSE2` as part of baseline target features. - `i586` Windows target without SSE2 is in process of being removed, so wasn't changed in this commit. - STL is built with `/arch:SSE2` and no longer `/arch:IA32` since . This was noticed in rust-lang/rust CI for `i686-pc-windows-msvc`, where `rustc_llvm` builds failed because `__m128i` wasn't available, and we suspected it was due to `/arch:IA32`. --- src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c4fc9e45..ded30395 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2224,7 +2224,16 @@ impl Build { cmd.push_cc_arg("-m64".into()); } else if target.arch == "x86" { cmd.push_cc_arg("-m32".into()); - cmd.push_cc_arg("-arch:IA32".into()); + // See + // . + // + // NOTE: Rust officially supported Windows targets all require SSE2 as part + // of baseline target features. + // + // NOTE: The same applies for STL. See: - + // , and - + // . + cmd.push_cc_arg("-arch:SSE2".into()); } else { cmd.push_cc_arg(format!("--target={}", target.llvm_target).into()); }