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

Document how TARGET_CC (and not CC) must be set for Android (and other cross) targets #897

Closed
Bejaenka opened this issue Sep 1, 2019 · 12 comments · Fixed by #999
Closed

Comments

@Bejaenka
Copy link

Bejaenka commented Sep 1, 2019

cargo build --target aarch64-linux-android --release

failed to run custom build command for ring v0.14.6

Caused by:
process didn't exit successfully: /Users/bianca/IMPP/rust/target/release/build/ring-350e23b19999907d/build-script-build (exit code: 101)
--- stdout
ANDROID_HOME: /Users/bianca/Library/Android/sdk
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.Sn7On4J2v6/Render
CARGO: /Users/bianca/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo
CARGO_CFG_DEBUG_ASSERTIONS:
CARGO_CFG_PROC_MACRO:
CARGO_CFG_TARGET_ARCH: aarch64
CARGO_CFG_TARGET_ENDIAN: little
CARGO_CFG_TARGET_ENV:
CARGO_CFG_TARGET_FAMILY: unix
CARGO_CFG_TARGET_OS: android
CARGO_CFG_TARGET_POINTER_WIDTH: 64
CARGO_CFG_TARGET_VENDOR: unknown
CARGO_CFG_UNIX:
CARGO_FEATURE_DEFAULT: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_FEATURE_USE_HEAP: 1
CARGO_HOME: /Users/bianca/.cargo
CARGO_MAKEFLAGS: --jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
CARGO_MANIFEST_DIR: /Users/bianca/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6
CARGO_MANIFEST_LINKS: ring-asm
CARGO_PKG_AUTHORS: Brian Smith [email protected]
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
CARGO_PKG_HOMEPAGE:
CARGO_PKG_NAME: ring
CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring
CARGO_PKG_VERSION: 0.14.6
CARGO_PKG_VERSION_MAJOR: 0
CARGO_PKG_VERSION_MINOR: 14
CARGO_PKG_VERSION_PATCH: 6
CARGO_PKG_VERSION_PRE:
DEBUG: false
DYLD_FALLBACK_LIBRARY_PATH: /Users/bianca/IMPP/rust/target/release/deps:/Users/bianca/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/bianca/.rustup/toolchains/stable-x86_64-apple-darwin/lib:/Users/bianca/lib:/usr/local/lib:/usr/lib
HOME: /Users/bianca
HOST: x86_64-apple-darwin
LANG: de_DE.UTF-8
LOGNAME: bianca
NDK_HOME: /Users/bianca/Library/Android/sdk/ndk/20.0.5594570
NUM_JOBS: 4
OLDPWD: /Users/bianca/impp
OPT_LEVEL: 3
OUT_DIR: /Users/bianca/IMPP/rust/target/aarch64-linux-android/release/build/ring-173d20e891ec023d/out
PATH: /Users/bianca/.cargo/bin:/Users/bianca/.cargo/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/bianca/Library/Android/sdk:/Users/bianca/Library/Android/sdk/tools:/Users/bianca/Library/Android/sdk/platform-tools
PROFILE: release
PWD: /Users/bianca/impp/rust
RUSTC: rustc
RUSTC_LINKER: /Users/bianca/.NDK/arm64/bin/aarch64-linux-android-clang
RUSTDOC: rustdoc
RUSTUP_HOME: /Users/bianca/.rustup
RUSTUP_TOOLCHAIN: stable-x86_64-apple-darwin
RUST_RECURSION_COUNT: 1
SHELL: /bin/bash
SHLVL: 1
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.gWOuAllj1C/Listeners
TARGET: aarch64-linux-android
TERM: xterm-256color
TERM_PROGRAM: Apple_Terminal
TERM_PROGRAM_VERSION: 421.2
TERM_SESSION_ID: FA2842F4-7A8C-4905-B7EC-6A4D8566A381
TMPDIR: /var/folders/mz/b2wg0jlj55b3jwt_44fshjx00000gn/T/
USER: bianca
XPC_FLAGS: 0x0
XPC_SERVICE_NAME: 0
_: /Users/bianca/.cargo/bin/cargo
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x3
OPT_LEVEL = Some("3")
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-apple-darwin")
CC_aarch64-linux-android = None
CC_aarch64_linux_android = None
TARGET_CC = None
CC = None
CFLAGS_aarch64-linux-android = None
CFLAGS_aarch64_linux_android = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
running "aarch64-linux-android-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/bianca/IMPP/rust/target/aarch64-linux-android/release/build/ring-173d20e891ec023d/out/aesv8-armx-linux64.o" "/Users/bianca/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesv8-armx-linux64.S"

--- stderr
thread 'main' panicked at 'failed to execute ["aarch64-linux-android-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-DNDEBUG" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/bianca/IMPP/rust/target/aarch64-linux-android/release/build/ring-173d20e891ec023d/out/aesv8-armx-linux64.o" "/Users/bianca/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesv8-armx-linux64.S"]: No such file or directory (os error 2)', /Users/bianca/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/build.rs:635:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

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

@briansmith
Copy link
Owner

Please provide the complete steps to reproduce.

Are you building a crate that has this in its Cargo.toml:

[dependencies]
ring = "0.16.9"

This is what I'm doing every day at work and it seems to work fine.

@andrewtj
Copy link
Contributor

andrewtj commented Sep 9, 2019

That error message suggests aarch64-linux-android-clang wasn't found. Is that the correct executable, and is it in $PATH?

I have cross compiles to Android working with a ~/cargo/config that looks something like:

[target.aarch64-linux-android]
ar = "/path-to-ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"
linker = "/path-to-ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang"

@mad-de
Copy link

mad-de commented Sep 12, 2019

Same issue on elementary OS 5.0. Other dependencies are building correctly.

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

Caused by:
process didn't exit successfully: /home/martin/Documents/Programmierung/rust/greetings/cargo/target/release/build/ring-7bbfecfc94828f13/build-script-build (exit code: 101)
--- stdout
ANDROID_HOME: /home/martin/Android/Sdk
CARGO: /home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo
CARGO_CFG_DEBUG_ASSERTIONS:
CARGO_CFG_PROC_MACRO:
CARGO_CFG_TARGET_ARCH: aarch64
CARGO_CFG_TARGET_ENDIAN: little
CARGO_CFG_TARGET_ENV:
CARGO_CFG_TARGET_FAMILY: unix
CARGO_CFG_TARGET_OS: android
CARGO_CFG_TARGET_POINTER_WIDTH: 64
CARGO_CFG_TARGET_VENDOR: unknown
CARGO_CFG_UNIX:
CARGO_FEATURE_DEFAULT: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_FEATURE_USE_HEAP: 1
CARGO_HOME: /home/martin/.cargo
CARGO_MAKEFLAGS: --jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
CARGO_MANIFEST_DIR: /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6
CARGO_MANIFEST_LINKS: ring-asm
CARGO_PKG_AUTHORS: Brian Smith [email protected]
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
CARGO_PKG_HOMEPAGE:
CARGO_PKG_NAME: ring
CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring
CARGO_PKG_VERSION: 0.14.6
CARGO_PKG_VERSION_MAJOR: 0
CARGO_PKG_VERSION_MINOR: 14
CARGO_PKG_VERSION_PATCH: 6
CARGO_PKG_VERSION_PRE:
COLORTERM: truecolor
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
DEBUG: false
DEFAULTS_PATH: /usr/share/gconf/pantheon.default.path
DESKTOP_SESSION: pantheon
DISPLAY: :0
GDMSESSION: pantheon
GDM_LANG: en_US
GIO_LAUNCHED_DESKTOP_FILE: /etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys-pantheon.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID: 1486
GNOME_DESKTOP_SESSION_ID: this-is-deprecated
GPG_AGENT_INFO: /run/user/1000/gnupg/S.gpg-agent:0:1
GTK_CSD: 1
GTK_MODULES: :pantheon-filechooser-module:gail:atk-bridge
HOME: /home/martin
HOST: x86_64-unknown-linux-gnu
LANG: en_US.UTF-8
LANGUAGE: en_US
LC_ADDRESS: de_DE.UTF-8
LC_IDENTIFICATION: de_DE.UTF-8
LC_MEASUREMENT: de_DE.UTF-8
LC_MONETARY: de_DE.UTF-8
LC_NAME: de_DE.UTF-8
LC_NUMERIC: de_DE.UTF-8
LC_PAPER: de_DE.UTF-8
LC_TELEPHONE: de_DE.UTF-8
LC_TIME: de_DE.UTF-8
LD_LIBRARY_PATH: /home/martin/Documents/Programmierung/rust/greetings/cargo/target/release/deps:/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib:/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib
LESSCLOSE: /usr/bin/lesspipe %s %s
LESSOPEN: | /usr/bin/lesspipe %s
LOGNAME: martin
LS_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:
MANDATORY_PATH: /usr/share/gconf/pantheon.mandatory.path
NDK_HOME: /home/martin/Android/Sdk/ndk-bundle
NUM_JOBS: 4
OLDPWD: /home/martin/Documents/Programmierung/rust/greetings
OPT_LEVEL: 3
OUT_DIR: /home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out
PANTHEON_TERMINAL_ID: 0
PATH: /home/martin/.cargo/bin:/home/martin/.cargo/bin:/home/martin/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PROFILE: release
PROMPT_COMMAND: __bp_precmd_invoke_cmd; dbus-send --type=method_call --session --dest=io.elementary.terminal /io/elementary/terminal io.elementary.terminal.ProcessFinished string:$PANTHEON_TERMINAL_ID string:"$(history 1 | cut -c 8-)" int32:$__bp_last_ret_value >/dev/null 2>&1; __bp_interactive_mode;
PWD: /home/martin/Documents/Programmierung/rust/greetings/cargo
QT_ACCESSIBILITY: 1
QT_IM_MODULE: ibus
QT_QPA_PLATFORMTHEME: gtk3
QT_STYLE_OVERRIDE: adwaita
RUSTC: rustc
RUSTC_LINKER: /home/martin/NDK/arm64/bin/aarch64-linux-android29-clang
RUSTDOC: rustdoc
RUSTUP_HOME: /home/martin/.rustup
RUSTUP_TOOLCHAIN: stable-x86_64-unknown-linux-gnu
RUST_RECURSION_COUNT: 1
SESSION_MANAGER: localREDACTED:@/tmp/.ICE-unix/1324,unix/REDACTED/tmp/.ICE-unix/1324
SHELL: /bin/bash
SHLVL: 1
SSH_AGENT_PID: 1420
SSH_AUTH_SOCK: /run/user/1000/keyring/ssh
SSL_CERT_DIR: /usr/lib/ssl/certs
SSL_CERT_FILE: /usr/lib/ssl/certs/ca-certificates.crt
TARGET: aarch64-linux-android
TERM: xterm-256color
USER: martin
VTE_VERSION: 5202
XAUTHORITY: /home/martin/.Xauthority
XDG_CONFIG_DIRS: /etc/xdg/xdg-pantheon:/etc/xdg
XDG_CURRENT_DESKTOP: Pantheon
XDG_DATA_DIRS: /usr/share/gnome:/usr/share/pantheon:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_GREETER_DATA_DIR: /var/lib/lightdm-data/martin
XDG_MENU_PREFIX: gnome-
XDG_RUNTIME_DIR: /run/user/1000
XDG_SEAT: seat0
XDG_SEAT_PATH: /org/freedesktop/DisplayManager/Seat0
XDG_SESSION_DESKTOP: pantheon
XDG_SESSION_ID: c2
XDG_SESSION_PATH: /org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE: x11
XDG_VTNR: 7
XMODIFIERS: @im=ibus
_: /home/martin/.cargo/bin/cargo
running "perl" "crypto/fipsmodule/aes/asm/aesv8-armx.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/aesv8-armx-linux64.S"
running "perl" "crypto/fipsmodule/modes/asm/ghashv8-armx.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/ghashv8-armx-linux64.S"
running "perl" "crypto/fipsmodule/bn/asm/armv8-mont.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/armv8-mont-linux64.S"
running "perl" "crypto/chacha/asm/chacha-armv8.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/chacha-armv8-linux64.S"
running "perl" "crypto/fipsmodule/ec/asm/ecp_nistz256-armv8.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/ecp_nistz256-armv8-linux64.S"
running "perl" "crypto/poly1305/asm/poly1305-armv8.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/poly1305-armv8-linux64.S"
running "perl" "crypto/fipsmodule/sha/asm/sha512-armv8.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/sha512-armv8-linux64.S"
running "perl" "crypto/fipsmodule/sha/asm/sha512-armv8.pl" "linux64" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/sha256-armv8-linux64.S"
OPT_LEVEL = Some("3")
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-unknown-linux-gnu")
CC_aarch64-linux-android = None
CC_aarch64_linux_android = None
TARGET_CC = None
CC = None
CFLAGS_aarch64-linux-android = None
CFLAGS_aarch64_linux_android = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
running "aarch64-linux-android-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-Werror" "-DNDEBUG" "-D_XOPEN_SOURCE=700" "-c" "-o/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/aesv8-armx-linux64.o" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/aesv8-armx-linux64.S"

--- stderr
thread 'main' panicked at 'failed to execute ["aarch64-linux-android-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=aarch64-linux-android" "-I" "include" "-Wall" "-Wextra" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-fno-strict-aliasing" "-fvisibility=hidden" "-fstack-protector" "-g3" "-Werror" "-DNDEBUG" "-D_XOPEN_SOURCE=700" "-c" "-o/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/aesv8-armx-linux64.o" "/home/martin/Documents/Programmierung/rust/greetings/cargo/target/aarch64-linux-android/release/build/ring-d6167463a8e0db2f/out/aesv8-armx-linux64.S"]: No such file or directory (os error 2)', /home/martin/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/build.rs:635: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

Followed this Setup for the Android toolchain: https://developer.holochain.org/guide/latest/building_for_android.html

~/.cargo/config:

[target.aarch64-linux-android]
ar = "/home/martin/NDK/arm64/bin/aarch64-linux-android-ar"
linker = "/home/martin/NDK/arm64/bin/aarch64-linux-android29-clang"

[target.armv7-linux-androideabi]
ar = "/home/martin/NDK/arm/bin/arm-linux-androideabi-ar"
linker = "/home/martin/NDK/arm/bin/arm-linux-androideabi-clang"

[target.i686-linux-android]
ar = "/home/martin/NDK/x86/bin/i686-linux-android-ar"
linker = "/home/martin/NDK/x86/bin/i686-linux-android28-clang"

@andrewtj
Copy link
Contributor

@mad-de I forgot the TARGET_CC environment variable needs to be set too. My build script also sets __ANDROID_API__ but I don't recall if that's necessary.

I've actually switched to using this gradle plugin which makes the whole process a bit smoother.

@mad-de
Copy link

mad-de commented Sep 12, 2019

@mad-de I forgot the TARGET_CC environment variable needs to be set too. My build script also sets __ANDROID_API__ but I don't recall if that's necessary.

I've actually switched to using this gradle plugin which makes the whole process a bit smoother.

thanks, @andrewtj for your help. Might look into gradle later. I tried setting
export CC=/home/martin/NDK/arm64/bin/aarch64-linux-android-gcc
but now building fails with:

error occurred: Failed to find tool. Is aarch64-linux-android-ar installed?

I double-checked the paths in the ~/.cargo/config they are correct.

@andrewtj
Copy link
Contributor

error occurred: Failed to find tool. Is aarch64-linux-android-ar installed?

That message is from the cc crate. The env vars that influence it are documented here. Maybe setting TARGET_AR will help, but I don't have that set, and your configuration seems to be the same as mine otherwise so I'm not sure what's awry.

@mad-de
Copy link

mad-de commented Sep 13, 2019

error occurred: Failed to find tool. Is aarch64-linux-android-ar installed?

That message is from the cc crate. The env vars that influence it are documented here. Maybe setting TARGET_AR will help, but I don't have that set, and your configuration seems to be the same as mine otherwise so I'm not sure what's awry.

I think this might be linked to this issue: rust-lang/cc-rs#82 and is the exact same error message as rust-lang/cc-rs#427
Unfortunately I'm rather unlucky with setting PATH and ENV variables so far.

@jeremyfelder
Copy link

Similar issue on macOS Mojave. I'm cross-compiling and ring is a transitive dependancy:

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

Caused by:
process didn't exit successfully: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-1915a058b96cebea/build-script-build (exit code: 101)
--- stdout
ANDROID_HOME: /Users/jeremy/Library/Android
ANDROID_NDK: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570
ANDROID_NDK_HOME: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570
ANDROID_NDK_TOOLCHAIN_DIR_PREBUILT: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin
ANDROID_PLATFORM_TOOLS: /Users/jeremy/Library/Android/sdk/platform-tools
ANDROID_SDK_HOME: /Users/jeremy/Library/Android/sdk
AR: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.HjaMde6Auh/Render
CARGO: /Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/bin/cargo
CARGO_CFG_DEBUG_ASSERTIONS:
CARGO_CFG_PROC_MACRO:
CARGO_CFG_TARGET_ARCH: x86_64
CARGO_CFG_TARGET_ENDIAN: little
CARGO_CFG_TARGET_ENV:
CARGO_CFG_TARGET_FAMILY: unix
CARGO_CFG_TARGET_FEATURE: cmpxchg16b,fxsr,mmx,sse,sse2,sse3,ssse3
CARGO_CFG_TARGET_HAS_ATOMIC: 128,16,32,64,8,cas,ptr
CARGO_CFG_TARGET_OS: macos
CARGO_CFG_TARGET_POINTER_WIDTH: 64
CARGO_CFG_TARGET_THREAD_LOCAL:
CARGO_CFG_TARGET_VENDOR: apple
CARGO_CFG_UNIX:
CARGO_FEATURE_DEFAULT: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_FEATURE_USE_HEAP: 1
CARGO_HOME: /Users/jeremy/.cargo
CARGO_MAKEFLAGS: --jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
CARGO_MANIFEST_DIR: /Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6
CARGO_MANIFEST_LINKS: ring-asm
CARGO_PKG_AUTHORS: Brian Smith [email protected]
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
CARGO_PKG_HOMEPAGE:
CARGO_PKG_NAME: ring
CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring
CARGO_PKG_VERSION: 0.14.6
CARGO_PKG_VERSION_MAJOR: 0
CARGO_PKG_VERSION_MINOR: 14
CARGO_PKG_VERSION_PATCH: 6
CARGO_PKG_VERSION_PRE:
CC: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang
CFLAGS:
CPPFLAGS: /usr/local/opt/[email protected]/include
CXX: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang++
DEBUG: false
DYLD_FALLBACK_LIBRARY_PATH: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/deps:/Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/lib:/Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/lib:/Users/jeremy/lib:/usr/local/lib:/usr/lib
HOME: /Users/jeremy
HOST: x86_64-apple-darwin
LC_CTYPE: UTF-8
LDFLAGS:
LESS: -R
LOGNAME: jeremy
LSCOLORS: Gxfxcxdxbxegedabagacad
NUM_JOBS: 8
OLDPWD: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android
OPT_LEVEL: 3
OUT_DIR: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out
PAGER: less
PATH: /Users/jeremy/.cargo/bin:/usr/local/opt/[email protected]/bin:/Users/jeremy/.cargo/bin:/Users/jeremy/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jeremy/Library/Android/sdk/platform-tools:/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin:/Users/jeremy/Library/Android/sdk/platform-tools:/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin
PKG_CONFIG_ALLOW_CROSS: 1
PROFILE: release
PWD: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust
RUSTC: rustc
RUSTC_LINKER: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang
RUSTDOC: rustdoc
RUSTUP_HOME: /Users/jeremy/.rustup
RUSTUP_TOOLCHAIN: nightly-2019-05-22-x86_64-apple-darwin
RUST_RECURSION_COUNT: 1
SECURITYSESSIONID: 186a9
SHELL: /bin/zsh
SHLVL: 2
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.xvKKZVDAU4/Listeners
SYSROOT: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin//../sysroot
TARGET: x86_64-apple-darwin
TERM: xterm-256color
TERM_PROGRAM: Apple_Terminal
TERM_PROGRAM_VERSION: 421.2
TERM_SESSION_ID: 334DC91F-41BA-4497-A11F-AFB7EC528FBE
TMPDIR: /var/folders/32/whl0d9wd0m70xr2r38g2yxlw0000gn/T/
USER: jeremy
XPC_FLAGS: 0x0
XPC_SERVICE_NAME: 0
ZSH: /Users/jeremy/.oh-my-zsh
_: /Users/jeremy/.cargo/bin/cargo
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aes-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aes-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aesni-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesni-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/vpaes-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/vpaes-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/x86_64-mont-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/x86_64-mont-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/x86_64-mont5-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/x86_64-mont5-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/chacha-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/chacha-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/p256-x86_64-asm-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/p256-x86_64-asm-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aesni-gcm-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesni-gcm-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/ghash-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/ghash-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/poly1305-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/poly1305-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/sha512-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/sha512-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/sha256-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/sha256-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-std=c1x" "-Wbad-function-cast" "-Wmissing-prototypes" "-Wnested-externs" "-Wstrict-prototypes" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/block.o" "crypto/block.c"

--- stderr
In file included from crypto/block.c:15:
In file included from crypto/internal.h:112:
include/GFp/base.h:65:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
^~~~~~~~~~~~~
1 error generated.
thread 'main' panicked at 'execution failed', /Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/build.rs:638: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`

Cargo config:

`[target.aarch64-linux-android]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang"

[target.armv7-linux-androideabi]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang"

[target.i686-linux-android]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android23-clang"`

Any help is much appreciated.

@mad-de
Copy link

mad-de commented Sep 13, 2019

Similar issue on macOS Mojave. I'm cross-compiling and ring is a transitive dependancy:

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

Caused by:
process didn't exit successfully: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-1915a058b96cebea/build-script-build (exit code: 101)
--- stdout
ANDROID_HOME: /Users/jeremy/Library/Android
ANDROID_NDK: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570
ANDROID_NDK_HOME: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570
ANDROID_NDK_TOOLCHAIN_DIR_PREBUILT: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin
ANDROID_PLATFORM_TOOLS: /Users/jeremy/Library/Android/sdk/platform-tools
ANDROID_SDK_HOME: /Users/jeremy/Library/Android/sdk
AR: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.HjaMde6Auh/Render
CARGO: /Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/bin/cargo
CARGO_CFG_DEBUG_ASSERTIONS:
CARGO_CFG_PROC_MACRO:
CARGO_CFG_TARGET_ARCH: x86_64
CARGO_CFG_TARGET_ENDIAN: little
CARGO_CFG_TARGET_ENV:
CARGO_CFG_TARGET_FAMILY: unix
CARGO_CFG_TARGET_FEATURE: cmpxchg16b,fxsr,mmx,sse,sse2,sse3,ssse3
CARGO_CFG_TARGET_HAS_ATOMIC: 128,16,32,64,8,cas,ptr
CARGO_CFG_TARGET_OS: macos
CARGO_CFG_TARGET_POINTER_WIDTH: 64
CARGO_CFG_TARGET_THREAD_LOCAL:
CARGO_CFG_TARGET_VENDOR: apple
CARGO_CFG_UNIX:
CARGO_FEATURE_DEFAULT: 1
CARGO_FEATURE_DEV_URANDOM_FALLBACK: 1
CARGO_FEATURE_USE_HEAP: 1
CARGO_HOME: /Users/jeremy/.cargo
CARGO_MAKEFLAGS: --jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
CARGO_MANIFEST_DIR: /Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6
CARGO_MANIFEST_LINKS: ring-asm
CARGO_PKG_AUTHORS: Brian Smith [email protected]
CARGO_PKG_DESCRIPTION: Safe, fast, small crypto using Rust.
CARGO_PKG_HOMEPAGE:
CARGO_PKG_NAME: ring
CARGO_PKG_REPOSITORY: https://github.com/briansmith/ring
CARGO_PKG_VERSION: 0.14.6
CARGO_PKG_VERSION_MAJOR: 0
CARGO_PKG_VERSION_MINOR: 14
CARGO_PKG_VERSION_PATCH: 6
CARGO_PKG_VERSION_PRE:
CC: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang
CFLAGS:
CPPFLAGS: /usr/local/opt/[email protected]/include
CXX: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang++
DEBUG: false
DYLD_FALLBACK_LIBRARY_PATH: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/deps:/Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/lib:/Users/jeremy/.rustup/toolchains/nightly-2019-05-22-x86_64-apple-darwin/lib:/Users/jeremy/lib:/usr/local/lib:/usr/lib
HOME: /Users/jeremy
HOST: x86_64-apple-darwin
LC_CTYPE: UTF-8
LDFLAGS:
LESS: -R
LOGNAME: jeremy
LSCOLORS: Gxfxcxdxbxegedabagacad
NUM_JOBS: 8
OLDPWD: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android
OPT_LEVEL: 3
OUT_DIR: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out
PAGER: less
PATH: /Users/jeremy/.cargo/bin:/usr/local/opt/[email protected]/bin:/Users/jeremy/.cargo/bin:/Users/jeremy/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jeremy/Library/Android/sdk/platform-tools:/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin:/Users/jeremy/Library/Android/sdk/platform-tools:/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin
PKG_CONFIG_ALLOW_CROSS: 1
PROFILE: release
PWD: /Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust
RUSTC: rustc
RUSTC_LINKER: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang
RUSTDOC: rustdoc
RUSTUP_HOME: /Users/jeremy/.rustup
RUSTUP_TOOLCHAIN: nightly-2019-05-22-x86_64-apple-darwin
RUST_RECURSION_COUNT: 1
SECURITYSESSIONID: 186a9
SHELL: /bin/zsh
SHLVL: 2
SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.xvKKZVDAU4/Listeners
SYSROOT: /Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin//../sysroot
TARGET: x86_64-apple-darwin
TERM: xterm-256color
TERM_PROGRAM: Apple_Terminal
TERM_PROGRAM_VERSION: 421.2
TERM_SESSION_ID: 334DC91F-41BA-4497-A11F-AFB7EC528FBE
TMPDIR: /var/folders/32/whl0d9wd0m70xr2r38g2yxlw0000gn/T/
USER: jeremy
XPC_FLAGS: 0x0
XPC_SERVICE_NAME: 0
ZSH: /Users/jeremy/.oh-my-zsh
_: /Users/jeremy/.cargo/bin/cargo
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aes-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aes-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aesni-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesni-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/vpaes-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/vpaes-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/x86_64-mont-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/x86_64-mont-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/x86_64-mont5-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/x86_64-mont5-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/chacha-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/chacha-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/p256-x86_64-asm-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/p256-x86_64-asm-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/aesni-gcm-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/aesni-gcm-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/ghash-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/ghash-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/poly1305-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/poly1305-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/sha512-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/sha512-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/sha256-x86_64-macosx.o" "/Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/pregenerated/sha256-x86_64-macosx.S"
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = Some("/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = Some("")
DEBUG = Some("false")
running "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=x86_64-apple-darwin" "-I" "include" "-std=c1x" "-Wbad-function-cast" "-Wmissing-prototypes" "-Wnested-externs" "-Wstrict-prototypes" "-pedantic" "-pedantic-errors" "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-declarations" "-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" "-D_XOPEN_SOURCE=700" "-c" "-o/Users/jeremy/kzen/pingpong-wallet/pingpong-react/android/rust/target/release/build/ring-c7757965f2b77b28/out/block.o" "crypto/block.c"

--- stderr
In file included from crypto/block.c:15:
In file included from crypto/internal.h:112:
include/GFp/base.h:65:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
^~~~~~~~~~~~~
1 error generated.
thread 'main' panicked at 'execution failed', /Users/jeremy/.cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.14.6/build.rs:638: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`

Cargo config:

`[target.aarch64-linux-android]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android23-clang"

[target.armv7-linux-androideabi]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi23-clang"

[target.i686-linux-android]
ar = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar"
linker = "/Users/jeremy/Library/Android/sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android23-clang"`

Any help is much appreciated.

I switched to a different crate (webpage instead of ureq) which doesn't has ring as a dependency, maybe that's an option for you as well.

@pietro
Copy link
Contributor

pietro commented Sep 17, 2019

Can you try setting TARGET_CC to the cross compiler instead of CC and seeing if that fixes the issue?

@mad-de
Copy link

mad-de commented Sep 18, 2019

Can you try setting TARGET_CC to the cross compiler instead of CC and seeing if that fixes the issue?

That actually solved my issue. A quick run with these commands built succesfully:

 export AR=/home/martin/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar
 export TARGET_CC=/home/martin/Android/Sdk/ndk/20.0.5594570/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang
 cargo build --target aarch64-linux-android --release

@briansmith briansmith changed the title Build fails with Android toolchain Document how TARGET_CC (and not CC) must be set for Android (and other cross) targets Sep 22, 2019
@briansmith
Copy link
Owner

As noted above, currently this applies to TARGET_AR too. This is especially true for the experimental WebAssembly support.

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

Successfully merging a pull request may close this issue.

6 participants