briansmith / ring

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

unable to build ring for aarch64-unknown-linux-gnu #2131

Closed andrewdavidmackenzie closed 1 month ago

andrewdavidmackenzie commented 3 months ago

When I try and build my project for my RPi using

cargo build --target=aarch64-unknown-linux-gnu

it fails on the build of ring (a dependency of a dependency) thus:

The following warnings were emitted during compilation:

warning: ring@0.17.8: Compiler family detection failed due to error: ToolExecError: Command "arm-linux-gnueabihf-gcc" "-E" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out/516341469748360433detect_compiler_family.c" with args arm-linux-gnueabihf-gcc did not execute successfully (status code exit status: 1).
warning: ring@0.17.8: Compiler family detection failed due to error: ToolExecError: Command "arm-linux-gnueabihf-gcc" "-E" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out/7005336917275502437detect_compiler_family.c" with args arm-linux-gnueabihf-gcc did not execute successfully (status code exit status: 1).
warning: ring@0.17.8: arm-linux-gnueabihf-gcc: error trying to exec 'cc1': execvp: No such file or directory

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

Caused by:
  process didn't exit successfully: `/Users/andrew/workspace/pigg/target/debug/build/ring-db76c668a0ccaef7/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
  cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_8_
  OPT_LEVEL = Some(0)
  TARGET = Some(aarch64-unknown-linux-gnu)
  OUT_DIR = Some(/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out)
  HOST = Some(aarch64-apple-darwin)
  cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-gnu
  CC_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_aarch64_unknown_linux_gnu
  CC_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  RUSTC_LINKER = Some(arm-linux-gnueabihf-gcc)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "arm-linux-gnueabihf-gcc" "-E" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out/516341469748360433detect_compiler_family.c" with args arm-linux-gnueabihf-gcc did not execute successfully (status code exit status: 1).
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(neon)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-gnu
  CFLAGS_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_gnu
  CFLAGS_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "arm-linux-gnueabihf-gcc" "-E" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out/7005336917275502437detect_compiler_family.c" with args arm-linux-gnueabihf-gcc did not execute successfully (status code exit status: 1).
  cargo:warning=arm-linux-gnueabihf-gcc: error trying to exec 'cc1': execvp: No such file or directory

  --- stderr

  error occurred: Command "arm-linux-gnueabihf-gcc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-I" "include" "-I" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-o" "/Users/andrew/workspace/pigg/target/aarch64-unknown-linux-gnu/debug/build/ring-9a31514cbb27c17e/out/fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args arm-linux-gnueabihf-gcc did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish...

Is there any workaround for this, or is there the prospect of this working at some time in the future?

Thanks for your help.

CertifiedGlowie commented 3 months ago

I think you need aarch64 linker and maybe LD and AR