briansmith / ring

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

Support for powerpc-unknown-linux-gnu #1424

Closed crazycusti closed 2 years ago

crazycusti commented 2 years ago

hey!

ive tried to compile ring on my ppc box and it failed:

Compiling ring v0.16.20 error: failed to run custom build command forring v0.16.20`

Caused by: process didn't exit successfully: /home/wynton/feather/target/release/build/ring-cfb5c139eeb28eb3/build-script-build (exit status: 101) --- stderr thread 'main' panicked at 'called Option::unwrap() on a None value', /home/wynton/.cargo/registry/src/github.com-b420f105fcaca6de/ring-0.16.20/build.rs:358:10 `

its seems similiar to #562

greets.

hgy59 commented 2 years ago

I have the same issue when building vaultwarden for PPC (RUST_TARGET=powerpc-unknown-linux-gnu):

full stack:

  Installing vaultwarden v1.0.0 (/spksrc/spk/vaultwarden/work-qoriq-6.1/vaultwarden-1.25.0)
    Updating git repository `https://github.com/BlackDex/job_scheduler`
    Updating crates.io index
   Compiling ring v0.16.20
   Compiling openssl-sys v0.9.73
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/spksrc/spk/vaultwarden/work-qoriq-6.1/vaultwarden-1.25.0/target/release/build/ring-26f0372bc8b7a7ca/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /spksrc/distrib/cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.20/build.rs:358:10
  stack backtrace:
     0:     0x561a3831e5cd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c2a9d2774d81873
     1:     0x561a3833e4cc - core::fmt::write::hba4337c43d992f49
     2:     0x561a3831a9f1 - std::io::Write::write_fmt::heb73de6e02cfabed
     3:     0x561a38320175 - std::panicking::default_hook::{{closure}}::hc9a76eed0b18f82b
     4:     0x561a3831fe29 - std::panicking::default_hook::h2e88d02087fae196
     5:     0x561a383206c2 - std::panicking::rust_panic_with_hook::habfdcc2e90f9fd4c
     6:     0x561a38320569 - std::panicking::begin_panic_handler::{{closure}}::he054b2a83a51d2cd
     7:     0x561a3831ea84 - std::sys_common::backtrace::__rust_end_short_backtrace::ha48b94ab49b30915
     8:     0x561a383202d9 - rust_begin_unwind
     9:     0x561a3828d4c3 - core::panicking::panic_fmt::h366d3a309ae17c94
    10:     0x561a3828d38d - core::panicking::panic::h8705e81f284be8a5
    11:     0x561a38298b3e - core::option::Option<T>::unwrap::he05b482757e0c9e5
    12:     0x561a38291c58 - build_script_build::build_c_code::hbf2583065bb9d7fb
    13:     0x561a38291175 - build_script_build::ring_build_rs_main::hd786c3c06c0a5a99
    14:     0x561a382909cd - build_script_build::main::hcb973cac4a9ca55c
    15:     0x561a382a0f83 - core::ops::function::FnOnce::call_once::h5290386c02341b4d
    16:     0x561a38296f49 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdafca70dd065fcd3
    17:     0x561a382992a9 - std::rt::lang_start::{{closure}}::hc9df75b74966eba2
    18:     0x561a3831672e - std::rt::lang_start_internal::h9c06694362b5b80c
    19:     0x561a38299291 - std::rt::lang_start::h88020c361b856ea0
    20:     0x561a38296f33 - main
    21:     0x7f266209009b - __libc_start_main
    22:     0x561a3828d70a - _start
    23:                0x0 - <unknown>
warning: build failed, waiting for other jobs to finish...
error: failed to compile `vaultwarden v1.0.0 (/spksrc/spk/vaultwarden/work-qoriq-6.1/vaultwarden-1.25.0)`, intermediate artifacts can be found at `/spksrc/spk/vaultwarden/work-qoriq-6.1/vaultwarden-1.25.0/target`
make[3]: *** [../../mk/spksrc.cross-rust.mk:124: rust_build_and_install_target] Error 101
make[3]: Leaving directory '/spksrc/cross/vaultwarden'
make[2]: *** [../../mk/spksrc.depend.mk:54: depend_target] Error 2
make[2]: Leaving directory '/spksrc/spk/vaultwarden'
make[1]: *** [../../mk/spksrc.spk.mk:564: build-arch-qoriq-6.1] Error 1
make[1]: Leaving directory '/spksrc/spk/vaultwarden'
make: *** [../../mk/spksrc.spk.mk:558: arch-qoriq-6.1] Error 2
hgy59 commented 2 years ago

@amjoseph-nixpkgs powerpc-unknown-linux-gnu is 32 bit ppc (different to ppc64le)

briansmith commented 2 years ago

I'm going to close this as either a duplicate of #1555 (for any big-endian PowerPC targets) or #1455 (for little-endian PowerPC targets). I understand BoringSSL did incorporate some PowerPC assembly code, but we should first finish the work of ring providing a general fallback for all targets; then we can discuss whether we should bother with the assembly optimizations and then investigate how we can become confident that they are correct.