Skip to content

add option to filter away unsupported target features - #5306

Open
RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:unsupported-target-features
Open

RalfJung wants to merge 1 commit into
rust-lang:masterfrom
RalfJung:unsupported-target-features

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

See #5294 for discussion: with this option, aarch64 code that checks cfg!(target_feature = "aes") and has a fallback path will automatically do the right thing in Miri.

Unfortunately we cannot use a -Zmiri flag here as only the actual binary sees that flag, but all crates need to to have their cfg updated. So I made it a new environment variable instead. Kind of hacky but I cannot think of anything better...

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Sep 4, 2026
@RalfJung
RalfJung marked this pull request as draft September 4, 2026 20:36
@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Sep 4, 2026
@RalfJung
RalfJung force-pushed the unsupported-target-features branch 2 times, most recently from 2d3cd06 to ed3203a Compare September 5, 2026 09:14
@RalfJung RalfJung changed the title filter away unsupported target features add option to filter away unsupported target features Sep 5, 2026
@RalfJung
RalfJung marked this pull request as ready for review September 5, 2026 09:14
@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Sep 5, 2026
@RalfJung

RalfJung commented Sep 5, 2026

Copy link
Copy Markdown
Member Author

@rust-lang/miri This is a first step in the context of #5294, without committing to any kind of transition of defaults: one can set MIRI_DISABLE_UNSUPPORTED_TARGET_FEATURES=1 to have Miri remove unsupported target features from cfg(target_feature) to steer code towards its fallback paths. Unfortunately, we cannot use a -Zmiri flag here as only the actual binary sees that flag, but all crates need to to have their cfg updated. So I made it a new environment variable instead. If you have a better idea for doing this, please let me know.

@RalfJung
RalfJung force-pushed the unsupported-target-features branch 2 times, most recently from 2282e8a to 3175f7c Compare September 5, 2026 09:38
@RalfJung
RalfJung force-pushed the unsupported-target-features branch from 3175f7c to b5f9e34 Compare September 5, 2026 09:46
@rustbot

rustbot commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

rustbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #5318) made this pull request unmergeable. Please resolve the merge conflicts.

@RalfJung

Copy link
Copy Markdown
Member Author

@oli-obk @saethlin please let me know what you think about this PR, or what you think we should be doing about #5294 if anything. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Waiting for a review to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants