briansmith / ring

Safe, fast, small crypto using Rust
Other
3.77k stars 708 forks source link

Cranelift struggling with SSE & SSE2 check #1972

Closed jollygreenlaser closed 8 months ago

jollygreenlaser commented 8 months ago
error[E0080]: evaluation of constant value failed
  --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/src/cpu/intel.rs:28:9
   |
28 |         assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")', /home/rurl/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.17.8/src/cpu/intel.rs:28:9
   |
   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

I've tried adding both

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-cpu=native"]

or

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+sse,+sse2"]

to no avail

I'm at a loss to get past this - help?

jollygreenlaser commented 8 months ago

Was able to narrow the issue down to dev builds, in which I use cranelift. Removing that made dev builds work again.

I'm going to call this more of a cranelift issue than a ring issue for now, I think.

jollygreenlaser commented 8 months ago

And it turns out my nightly was just barely enough out of date to cause this with cranelift.