joseluisq / joseluisq/rust-linux-darwin-builder

Compile error on Mac M1

Open
#22 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
153
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I am trying to build https://github.com/starship/starship on my Mac Air M1 with:
```
docker run --rm --volume "${PWD}":/root/src --workdir /root/src joseluisq/rust-linux-darwin-builder:1.67.1 sh -c "cargo build --release --target aarch64-apple-darwin"
```

but it fails with below
```
warning: cc: error: arm64: No such file or directory
warning: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
error: failed to run custom build command for `sha1-asm v0.5.1`

Caused by:
process didn't exit successfully: `/root/src/target/release/build/sha1-asm-2010612ad33992cd/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("aarch64-apple-darwin")
OPT_LEVEL = Some("3")
HOST = Some("aarch64-unknown-linux-gnu")
CC_aarch64-apple-darwin = None
CC_aarch64_apple_darwin = None
TARGET_CC = None
CC = None
CROSS_COMPILE = None
CFLAGS_aarch64-apple-darwin = None
CFLAGS_aarch64_apple_darwin = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-Wall" "-Wextra" "-march=armv8-a+crypto" "-c" "-o" "/root/src/target/aarch64-apple-darwin/release/build/sha1-asm-9f091d7d0969abf5/out/src/aarch64_apple.o" "-c" "src/aarch64_apple.S"
cargo:warning=cc: error: arm64: No such file or directory
cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
exit status: 1
--- stderr
error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-Wall" "-Wextra" "-march=armv8-a+crypto" "-c" "-o" "/root/src/target/aarch64-apple-darwin/release/build/sha1-asm-9f091d7d0969abf5/out/src/aarch64_apple.o" "-c" "src/aarch64_apple.S" with args "cc" did not execute successfully (status code exit status: 1)
```

On my Linux machine I don't have that problem, I can build the cmd tool and run it fine on my Mac.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.