Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-cl: use /arch:SSE2 for x86 target arch #1425

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// <https://learn.microsoft.com/en-us/cpp/build/reference/arch-x86?view=msvc-170>.
//
// NOTE: Rust officially supported Windows targets all require SSE2 as part
// of baseline target features.
//
// NOTE: The same applies for STL. See: -
// <https://github.com/microsoft/STL/issues/3922>, and -
// <https://github.com/microsoft/STL/pull/4741>.
cmd.push_cc_arg("-arch:SSE2".into());
} else {
cmd.push_cc_arg(format!("--target={}", target.llvm_target).into());
}
Expand Down