BLAKE3-team / BLAKE3

the official Rust and C implementations of the BLAKE3 cryptographic hash function
Apache License 2.0
5.06k stars 346 forks source link

cross compile for aarch64_unknown_linux_gnu fails with `fatal error: arm_neon.h: No such file or directory` #395

Open eitsupi opened 4 months ago

eitsupi commented 4 months ago

I have tried to build a package with this crate as a dependency, but it seems to fail due to the following error.

https://github.com/eitsupi/r-glaredb/actions/runs/9234696974/job/25408692991?pr=17#step:10:1107

 error: failed to run custom build command for `blake3 v1.5.1`

Caused by:
  process didn't exit successfully: `/home/runner/work/r-glaredb/r-glaredb/src/rust/target/release/build/blake3-916b2415e9df773b/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
  cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
  cargo:rustc-cfg=blake3_neon
  TARGET = Some("aarch64-unknown-linux-gnu")
  OPT_LEVEL = Some("3")
  HOST = Some("x86_64-unknown-linux-gnu")
  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 = Some("gcc")
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  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=c/blake3_neon.c:3:10: fatal error: arm_neon.h: No such file or directory
  cargo:warning=    3 | #include <arm_neon.h>
  cargo:warning=      |          ^~~~~~~~~~~~
  cargo:warning=compilation terminated.

  --- stderr

  error occurred: Command "gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-std=c11" "-o" "/home/runner/work/r-glaredb/r-glaredb/src/rust/target/aarch64-unknown-linux-gnu/release/build/blake3-806824724e43ffed/out/db3b6bfb95261072-blake3_neon.o" "-c" "c/blake3_neon.c" with args gcc did not execute successfully (status code exit status: 1).

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

Perhaps I have a wrong setup, but I could not find a solution. I would appreciate any advice.