Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail on Apple Silicon #1163

Closed
johalun opened this issue Dec 23, 2020 · 3 comments
Closed

Build fail on Apple Silicon #1163

johalun opened this issue Dec 23, 2020 · 3 comments

Comments

@johalun
Copy link

johalun commented Dec 23, 2020

Is M1 supported? I'm having trouble building Veloren which has ring as a dependency (directly or indirectly I don't know). It seems to think it's on Linux when building natively on M1.

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

Caused by:
  process didn't exit successfully: `/Users/johalun/dev/veloren/target/release/build/ring-cde03f10d659a111/build-script-build` (exit code: 101)
  --- stdout
  OPT_LEVEL = Some("3")
  TARGET = Some("aarch64-apple-darwin")
  HOST = Some("aarch64-apple-darwin")
  CC_aarch64-apple-darwin = None
  CC_aarch64_apple_darwin = None
  HOST_CC = None
  CC = None
  CFLAGS_aarch64-apple-darwin = None
  CFLAGS_aarch64_apple_darwin = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("crc,crypto,fp,fp16,lse,neon,ras,rcpc,rdm,v8.1a,v8.2a,v8.3a")

  --- stderr
  ENV CARGO=/Users/johalun/.rustup/toolchains/nightly-2020-12-09-aarch64-apple-darwin/bin/cargo
  ENV CARGO_CFG_PANIC=unwind
  ENV CARGO_CFG_TARGET_ARCH=aarch64
  ENV CARGO_CFG_TARGET_ENDIAN=little
  ENV CARGO_CFG_TARGET_ENV=
  ENV CARGO_CFG_TARGET_FAMILY=unix
  ENV CARGO_CFG_TARGET_FEATURE=crc,crypto,fp,fp16,lse,neon,ras,rcpc,rdm,v8.1a,v8.2a,v8.3a
  ENV CARGO_CFG_TARGET_HAS_ATOMIC=128,16,32,64,8,ptr
  ENV CARGO_CFG_TARGET_HAS_ATOMIC_EQUAL_ALIGNMENT=128,16,32,64,8,ptr
  ENV CARGO_CFG_TARGET_HAS_ATOMIC_LOAD_STORE=128,16,32,64,8,ptr
  ENV CARGO_CFG_TARGET_OS=macos
  ENV CARGO_CFG_TARGET_POINTER_WIDTH=64
  ENV CARGO_CFG_TARGET_THREAD_LOCAL=
  ENV CARGO_CFG_TARGET_VENDOR=apple
  ENV CARGO_CFG_UNIX=
  ENV CARGO_FEATURE_ALLOC=1
  ENV CARGO_FEATURE_DEFAULT=1
  ENV CARGO_FEATURE_DEV_URANDOM_FALLBACK=1
  ENV CARGO_FEATURE_ONCE_CELL=1
  ENV CARGO_HOME=/Users/johalun/.cargo
  ENV CARGO_MAKEFLAGS=--jobserver-fds=3,13 -j --jobserver-auth=3,13 -j
  ENV CARGO_MANIFEST_DIR=/Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15
  ENV CARGO_MANIFEST_LINKS=ring-asm
  ENV CARGO_PKG_AUTHORS=Brian Smith <[email protected]>
  ENV CARGO_PKG_DESCRIPTION=Safe, fast, small crypto using Rust.
  ENV CARGO_PKG_HOMEPAGE=
  ENV CARGO_PKG_LICENSE=
  ENV CARGO_PKG_LICENSE_FILE=LICENSE
  ENV CARGO_PKG_NAME=ring
  ENV CARGO_PKG_REPOSITORY=https://github.com/briansmith/ring
  ENV CARGO_PKG_VERSION=0.16.15
  ENV CARGO_PKG_VERSION_MAJOR=0
  ENV CARGO_PKG_VERSION_MINOR=16
  ENV CARGO_PKG_VERSION_PATCH=15
  ENV CARGO_PKG_VERSION_PRE=
  ENV DEBUG=false
  ENV DYLD_FALLBACK_LIBRARY_PATH=/Users/johalun/dev/veloren/target/release/deps:/Users/johalun/dev/veloren/target/release:/Users/johalun/.rustup/toolchains/nightly-2020-12-09-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib:/Users/johalun/.rustup/toolchains/nightly-2020-12-09-aarch64-apple-darwin/lib:/Users/johalun/lib:/usr/local/lib:/usr/lib
  ENV HOME=/Users/johalun
  ENV HOST=aarch64-apple-darwin
  ENV LANG=en_US.UTF-8
  ENV LOGNAME=johalun
  ENV NUM_JOBS=8
  ENV OLDPWD=/Users/johalun/dev
  ENV OPT_LEVEL=3
  ENV OUT_DIR=/Users/johalun/dev/veloren/target/release/build/ring-5bb4b67356e9fae5/out
  ENV PATH=/Users/johalun/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin:/opt/homebrew/opt:/Users/johalun/.cargo/bin
  ENV PROFILE=release
  ENV PWD=/Users/johalun/dev/veloren
  ENV RUSTC=rustc
  ENV RUSTDOC=rustdoc
  ENV RUSTUP_HOME=/Users/johalun/.rustup
  ENV RUSTUP_TOOLCHAIN=nightly-2020-12-09-aarch64-apple-darwin
  ENV RUST_RECURSION_COUNT=1
  ENV SHELL=/bin/zsh
  ENV SHLVL=1
  ENV SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.aZs5A7M2Je/Listeners
  ENV TARGET=aarch64-apple-darwin
  ENV TERM=xterm-16color
  ENV TERM_PROGRAM=Apple_Terminal
  ENV TERM_PROGRAM_VERSION=440
  ENV TERM_SESSION_ID=7CE4FE15-D7CD-452C-9A40-5BD90D339744
  ENV TMPDIR=/var/folders/mp/h6cy5c316m561h44v1p3tfkc0000gn/T/
  ENV USER=johalun
  ENV XPC_FLAGS=0x0
  ENV XPC_SERVICE_NAME=0
  ENV _=/Users/johalun/.cargo/bin/cargo
  ENV __CFBundleIdentifier=com.apple.Terminal
  ENV __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
  running "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-gfull" "-DNDEBUG" "-c" "-o/Users/johalun/dev/veloren/target/release/build/ring-5bb4b67356e9fae5/out/aesv8-armx-linux64.o" "/Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S"
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:18:17: error: unexpected token in '.section' directive
  .section .rodata
                  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:28:1: error: unknown directive
  .hidden GFp_aes_hw_set_encrypt_key
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:29:1: error: unknown directive
  .type GFp_aes_hw_set_encrypt_key,%function
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:161:1: error: unknown directive
  .size GFp_aes_hw_set_encrypt_key,.-GFp_aes_hw_set_encrypt_key
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:163:1: error: unknown directive
  .hidden GFp_aes_hw_encrypt
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:164:1: error: unknown directive
  .type GFp_aes_hw_encrypt,%function
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:191:1: error: unknown directive
  .size GFp_aes_hw_encrypt,.-GFp_aes_hw_encrypt
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:193:1: error: unknown directive
  .hidden GFp_aes_hw_decrypt
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:194:1: error: unknown directive
  .type GFp_aes_hw_decrypt,%function
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:221:1: error: unknown directive
  .size GFp_aes_hw_decrypt,.-GFp_aes_hw_decrypt
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:223:1: error: unknown directive
  .hidden GFp_aes_hw_ctr32_encrypt_blocks
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:224:1: error: unknown directive
  .type GFp_aes_hw_ctr32_encrypt_blocks,%function
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:403:1: error: unknown directive
  .size GFp_aes_hw_ctr32_encrypt_blocks,.-GFp_aes_hw_ctr32_encrypt_blocks
  ^
  /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/pregenerated/aesv8-armx-linux64.S:407:19: error: unexpected token in '.section' directive
  .section .note.GNU-stack,"",%progbits
                    ^
  thread 'main' panicked at 'execution failed', /Users/johalun/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.15/build.rs:664:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

@briansmith
Copy link
Owner

Is M1 supported? I'm having trouble building Veloren which has ring as a dependency (directly or indirectly I don't know). It seems to think it's on Linux when building natively on M1.

Add:

ring = "0.16.19"

to your Cargo.toml dependencies and it will work.

Please send a PR to the Veloren project to bump their ring dependency to 0.16.19.

@briansmith
Copy link
Owner

More details are in #1063.

@johalun
Copy link
Author

johalun commented Dec 23, 2020

Thanks :)

hyche added a commit to hyche/nats.rs that referenced this issue Mar 3, 2022
This allows building `nats` on Apple M1 devices, because `rustlts` v0.19 depends on `ring` v0.16.12, which build failed on M1.
Issue: briansmith/ring#1163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants