Skip to content

Can't build for certain targets #2873

Description

@mycodedoesnotcompile2

Hello @briansmith,

Thanks for your great project.
I try to build the adhammer tool that now embeds ring but i have build failures for these targets:

aarch64-pc-windows-msvc
mips64el-unknown-linux-gnuabi64
mips64el-unknown-linux-muslabi64
riscv64gc-unknown-linux-musl
riscv64gc-unknown-linux-gnu
i586-unknown-linux-gnu
i586-unknown-linux-musl
powerpc64le-unknown-linux-gnu

There are some different errors according to the targets but here are the main types:
For aarch64:

C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): error C2065: 'BN_ULLONG': undeclared identifier
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): error C2146: syntax error: missing ';' before identifier 'result'
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): warning C4555: result of expression not used
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): error C2065: 'result': undeclared identifier
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): error C2065: 'BN_ULLONG': undeclared identifier
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): error C2146: syntax error: missing ';' before identifier 'a'
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(191): warning C4552: '*': result of expression not used
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(192): error C2065: 'result': undeclared identifier
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(193): error C2065: 'result': undeclared identifier
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\internal.h(193): warning C4293: '>>': shift count negative or too big, undefined behavior
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(38): warning C4163: '_addcarry_u64': not available as an intrinsic function
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(38): warning C4163: '_subborrow_u64': not available as an intrinsic function
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(62): warning C4013: '_addcarry_u64' undefined; assuming extern returning int
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(62): warning C4242: '=': conversion from 'int' to 'Carry', possible loss of data
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(76): warning C4242: '=': conversion from 'int' to 'Carry', possible loss of data
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(92): warning C4013: '_subborrow_u64' undefined; assuming extern returning int
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(92): warning C4242: '=': conversion from 'int' to 'Carry', possible loss of data
  C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\crypto\fipsmodule\bn\../../limbs/limbs.inl(106): warning C4242: '=': conversion from 'int' to 'Carry', possible loss of data

  --- stderr
  running "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostARM64\\arm64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "include" "-W4" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Ox" "-DNDEBUG" "-c" "/FoC:\\Users\\runneradmin\\AppData\\Local\\Temp\\adhammer\\target\\aarch64-pc-windows-msvc\\release\\build\\ring-5198e3fc713b2483\\out\\aes_nohw.obj" "crypto/fipsmodule/aes/aes_nohw.c"
  running "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostARM64\\arm64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-I" "include" "-W4" "/GS" "/Gy" "/EHsc" "/GR-" "/Zc:wchar_t" "/Zc:forScope" "/Zc:inline" "/Zc:rvalueCast" "/sdl" "/Wall" "/wd4127" "/wd4464" "/wd4514" "/wd4710" "/wd4711" "/wd4820" "/wd5045" "/Ox" "-DNDEBUG" "-c" "/FoC:\\Users\\runneradmin\\AppData\\Local\\Temp\\adhammer\\target\\aarch64-pc-windows-msvc\\release\\build\\ring-5198e3fc713b2483\\out\\montgomery.obj" "crypto/fipsmodule/bn/montgomery.c"

  thread 'main' (1364) panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\ring-0.16.20\build.rs:656:9:
  execution failed
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

For MIPS and PowerPC:

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

Caused by:
  process didn't exit successfully: `/target/release/build/ring/f1df99d91357feb2/out/build_script_build` (exit status: 101)
  --- stderr

  thread 'main' (1037) panicked at /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.16.20/build.rs:358:10:
  called `Option::unwrap()` on a `None` value

For i586:

error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
  --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/src/cpu/intel.rs:26:9
   |
26 |         assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `cpu::intel::abi_assumptions::_ASSUMES_SSE2` failed here

error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse")
   --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/src/cpu/intel.rs:159:31
    |
159 |     const _SSE_REQUIRED: () = assert!(cfg!(target_feature = "sse"));
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `cpu::intel::cpuid_to_caps_and_set_c_flags::_SSE_REQUIRED` failed here

error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse2")
   --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/src/cpu/intel.rs:160:32
    |
160 |     const _SSE2_REQUIRED: () = assert!(cfg!(target_feature = "sse2"));
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `cpu::intel::cpuid_to_caps_and_set_c_flags::_SSE2_REQUIRED` failed here

For more information about this error, try `rustc --explain E0080`.
error: could not compile `ring` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...e

You can see the full build log here: https://github.com/mycodedoesnotcompile2/adhammer_prebuilt_binaries/actions/runs/30986300501

And for reference you can see the successful build logs using openssl instead of ring here: https://github.com/mycodedoesnotcompile2/adhammer_prebuilt_binaries/actions/runs/30743072831/job/91483844590

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions