# LLVM optional target-cpu features enabled by default
Main issue: "-C target_cpu=cortex-a72 (and -target-cpu=native on Raspberry Pi) wrongly enables crypto features that are optional on Cortex-A72" rust-lang#125033
LLVM's [policy](https://github.com/llvm/llvm-project/issues/90365#issuecomment-2117644294) is that
* `-march=...` enables only *required* architectural features
* `-mcpu=...` enables *common* architectural features and users are expected to use `+no{feature}` target feature flags to out-out of common-but-not-required features
For Rust, we would prefer to only enable required architectural features in both cases. (Is there disagreement on this point?)
Doing otherwise opens the possibility of unsound behavior when unsupported instructions are attempted to be executed by the processor.
It seems there are basically two options:
1. We fix this in LLVM. Two issues have been filed already but don't seem to have much traction currently.
* Issues: https://github.com/llvm/llvm-project/issues/90365, https://github.com/llvm/llvm-project/issues/113008
* LLVM doesn't seem strongly opposed, but we will probably need to drive a fix ourselves.
2. We work around this by maintaining our own lists of required and optional target features per arch and cpu.
* Certainly possible but would be additional, ongoing work everytime we update LLVM and potentially support new archs and cpus.
* Target Modifiers RFC suggests we will need to maintain our own lists of ABI modifying target features but this seems like substantially less work than duplicating LLVM's arch and cpu data.
Other options?