briansmith / ring

Safe, fast, small crypto using Rust
Other
3.75k stars 704 forks source link

the evaluated program panicked at 'assertion failed: ((ARMCAP_STATIC & NEON.mask) == NEON.mask) #1873

Closed Moatasem-Elsayed closed 5 months ago

Moatasem-Elsayed commented 10 months ago

I am using --target aarch64-poky-linux and in the Cargo.toml using jsonwebtoken = "9.1.0" which has dependencies with ring but it fails with me
image image so how can we fix that the toolchain is back to Yocto

Machine : Linux 38daeed87f77 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$CC aarch64-poky-linux-gcc -march=armv8-a+crc+crypto -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security

$CXX aarch64-poky-linux-g++ -march=armv8-a+crc+crypto -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security

briansmith commented 10 months ago

aarch64-poky-linux

It seems like the target specification for this target doesn't enable NEON as a statically-guaranteed feature for aarch64. Who maintains this target? Can you ask them why the target specification doesn't include NEON as a baseline feature?

briansmith commented 9 months ago

@Moatasem-Elsayed Did you find out what was causing this? Did the target spec change?

tronical commented 9 months ago

I'm seeing the same problem. Yoco, aarch64-poky-linux. The target spec oddly explicitly excludes neon:

(aarch64-poky-linux.json)

{
    "llvm-target": "aarch64-unknown-linux-gnu",
    "data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
    "max-atomic-width": 128,
    "target-pointer-width": "64",
    "target-c-int-width": "32",
    "target-endian": "little",
    "arch": "aarch64",
    "os": "linux",
    "env": "gnu",
    "vendor": "unknown",
    "target-family": "unix",
    "linker": "aarch64-poky-linux-gcc",
    "cpu": "generic",
    "features": "-neon",
    "dynamic-linking": true,
    "executables": true,
    "linker-is-gnu": true,
    "linker-flavor": "gcc",
    "has-rpath": true,
    "has-elf-tls": true,
    "position-independent-executables": true,
    "panic-strategy": "abort"
}
tronical commented 9 months ago

I wonder if this is a bug in meta-rust for generating the wrong target (TUNE_FEATURES does not contain neon, so it adds -neon).

tronical commented 9 months ago

I think that this might be a bug in meta-rust. @Moatasem-Elsayed are you using meta-rust?

I think commit https://github.com/meta-rust/meta-rust/commit/20d0e6f5e23516bcda097dfb96349798f44b5cc7 gets it wrong by removing neon even on aarch64. It looks better in openembedded-core: https://github.com/openembedded/openembedded-core/blob/97b5d0c85af0b667854eea90ace0a8c2f51ecefe/meta/classes-recipe/rust-target-config.bbclass#L32

tronical commented 9 months ago

This should be fixed in meta-rust now :)

briansmith commented 5 months ago

This should be fixed in meta-rust now :)

Thanks!