Skip to content

evaluation of constant value failed on macOS M1 #1522

Closed
@mominul

Description

@mominul

While compiling briansmith/ring@7c0024a on macOS M1 using

CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly build -Zcodegen-backend

the compiler errors out by issuing evaluation of constant value failed:

    Updating crates.io index
     Locking 73 packages to latest compatible versions
      Adding anes v0.1.6 (latest: v0.2.0)
      Adding hermit-abi v0.3.9 (latest: v0.4.0)
      Adding itertools v0.10.5 (latest: v0.13.0)
      Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.1+wasi-0.2.0)
  Downloaded cc v1.1.6
  Downloaded 1 crate (81.6 KB) in 0.36s
   Compiling libc v0.2.155
   Compiling cc v1.1.6
   Compiling cfg-if v1.0.0
   Compiling untrusted v0.9.0
   Compiling spin v0.9.8
   Compiling ring v0.17.8 (/Users/mominul/src/ring)
   Compiling getrandom v0.2.15
error[E0080]: evaluation of constant value failed
  --> src/cpu/arm/darwin.rs:44:5
   |
44 |     assert!((ARMCAP_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: (ARMCAP_STATIC & MIN_STATIC_FEATURES) == MIN_STATIC_FEATURES', src/cpu/arm/darwin.rs:44:5
   |
   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation of constant value failed
  --> src/cpu/arm/darwin.rs:51:5
   |
51 |     assert!(ARMCAP_STATIC == MIN_STATIC_FEATURES);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: ARMCAP_STATIC == MIN_STATIC_FEATURES', src/cpu/arm/darwin.rs:51:5
   |
   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unnecessary `unsafe` block
   --> src/cpu/arm.rs:184:21
    |
184 |             let p = unsafe { ptr::addr_of_mut!(OPENSSL_armcap_P) };
    |                     ^^^^^^ unnecessary `unsafe` block
    |
    = note: `#[warn(unused_unsafe)]` on by default

warning: unnecessary `unsafe` block
   --> src/cpu/arm.rs:202:17
    |
202 |         let p = unsafe { ptr::addr_of!(OPENSSL_armcap_P) };
    |                 ^^^^^^ unnecessary `unsafe` block

For more information about this error, try `rustc --explain E0080`.
warning: `ring` (lib) generated 2 warnings
error: could not compile `ring` (lib) due to 2 previous errors; 2 warnings emitted

Nightly rust version:

rustc 1.82.0-nightly (7120fdac7 2024-07-25)

Thanks for the enormous work! ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-core-archArea: Necessary for full core::arch supportC-enhancementCategory: An issue proposing an enhancement or a PR with one.O-armTarget: ARM processors (arm, thumb and AArch64 targets)O-macosOperating system: MacOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions