Add support for setting dynamically available target features #3100
Labels
A-interpreter
Area: affects the core interpreter
C-enhancement
Category: a PR with an enhancement or an issue tracking an accepted enhancement
Currently one can tell Miri that, e.g., AVX is available by setting
-C target-feature="avx"
. However, that corresponds to building a binary that statically requires AVX to be available. For real Rust, there's also the possibility of building code without AVX being globally available, but then at run-time detecting AVX to be available. It would be great if Miri could emulate that.This will require at least:
-Zmiri-target-feature
.is_target_feature_enabled!
respects this dynamic set.The test added in #3099 can then be made more subtle by enabling AVX dynamically, at which point the currently reported UB should disappear -- but we should still see UB due to the ABI mismatch!
The text was updated successfully, but these errors were encountered: