Skip to content

aes: disable aarch64_aes backend on Miri - #586

Merged
newpavlov merged 5 commits into
masterfrom
aes/miri_aarch64
Aug 28, 2026
Merged

aes: disable aarch64_aes backend on Miri#586
newpavlov merged 5 commits into
masterfrom
aes/miri_aarch64

Conversation

@newpavlov

Copy link
Copy Markdown
Member

See this comment.

Closes#585

@newpavlov

newpavlov commented Aug 28, 2026

Copy link
Copy Markdown
MemberAuthor

@RalfJung
I get a weird error while running RUSTFLAGS="-C target-feature=+aes" cargo miri test on this code:

running 2 tests
test aes/src/lib.rs - hardware_accelerated (line 197) ... ok
test aes/src/lib.rs - (line 58) ... FAILED
failures:
---- aes/src/lib.rs - (line 58) stdout ----
Test executable failed (exit status: 1).
stderr:
error: Undefined Behavior: calling a function that requires unavailable target features: aes
--> aes/src/lib.rs:236:47
|
= note: Undefined Behavior occurred here
::: aes/src/lib.rs:539:1
|
= note: in this macro invocation
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: stack backtrace:
0: <aes::Aes128 as aes::cipher::KeyInit>::new
at aes/src/lib.rs:236:48: 236:82
1: main::_doctest_main_aes_src_lib_rs_58_0
at aes/src/lib.rs:12:14: 12:31
2: main
at aes/src/lib.rs:42:3: 42:38
= note: this error originates in the macro `impl_key_init` which comes from the expansion of the macro `define_aes_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

Is it expected?

UPD: It gets "fixed" by passing RUSTDOCFLAGS="-C target-feature=+aes", but I think it's a weird interaction nevertheless.

@newpavlov
newpavlov merged commit 6226693 into masterAug 28, 2026
172 checks passed
@newpavlov
newpavlov deleted the aes/miri_aarch64 branch August 28, 2026 13:56
@RalfJung

RalfJung commented Aug 28, 2026

Copy link
Copy Markdown

UPD: It gets "fixed" by passing RUSTDOCFLAGS="-C target-feature=+aes", but I think it's a weird interaction nevertheless.

This is cargo behavior, Miri isn't involved here. I agree it is confusing, I don't know why they decided to split RUSTFLAGS and RUSTDOCFLAGS.

newpavlov added a commit that referenced this pull request Aug 28, 2026
### Changed
- MSRV bumped to 1.89 ([#580])
- VAES-256 and VAES-512 backends on x86 targets are now supported by
default ([#580])
- Disable `aarch64_aes` backend on Miri ([#586])
### Removed
- `aes_backend = "avx256"` and `aes_backend = "avx512"` configuration
flags ([#580])
[#580]: #580
[#586]: #586
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable AES intrinsics on aarch64 Miri

2 participants

@newpavlov@RalfJung