Skip to content

Commit 9131f33

Browse files
authored
clang-cl: use /arch:SSE2 for x86 target arch (#1425)
- 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 <microsoft/STL#4741>. 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`.
1 parent 8ea5e95 commit 9131f33

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/lib.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,16 @@ impl Build {
22242224
cmd.push_cc_arg("-m64".into());
22252225
} else if target.arch == "x86" {
22262226
cmd.push_cc_arg("-m32".into());
2227-
cmd.push_cc_arg("-arch:IA32".into());
2227+
// See
2228+
// <https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86?view=msvc-170>.
2229+
//
2230+
// NOTE: Rust officially supported Windows targets all require SSE2 as part
2231+
// of baseline target features.
2232+
//
2233+
// NOTE: The same applies for STL. See: -
2234+
// <https://github.com/microsoft/STL/issues/3922>, and -
2235+
// <https://github.com/microsoft/STL/pull/4741>.
2236+
cmd.push_cc_arg("-arch:SSE2".into());
22282237
} else {
22292238
cmd.push_cc_arg(format!("--target={}", target.llvm_target).into());
22302239
}

0 commit comments

Comments
 (0)