]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #80749 - as-com:target-cpu-actually-native, r=nagisa
authorbors <bors@rust-lang.org>
Sat, 9 Jan 2021 04:36:24 +0000 (04:36 +0000)
committerbors <bors@rust-lang.org>
Sat, 9 Jan 2021 04:36:24 +0000 (04:36 +0000)
Make target-cpu=native detect individual features

This PR makes target-cpu=native check for and enable/disable individual features instead of detecting and targeting a CPU by name. This brings the flag's behavior more in line with clang and gcc and ensures that the host actually supports each feature that we are compiling for.

This should resolve issues with miscompilations on e.g. "Haswell" Pentiums and Celerons that lack support for AVX, and also enable support for `aes` on Broadwell processors that support it. It should also resolve issues with failing to detect feature support in newer CPUs that aren't yet known by LLVM (see: #80633).

Fixes #54688
Fixes #48464
Fixes #38218


Trivial merge