-
Notifications
You must be signed in to change notification settings - Fork 720
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
Comments
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. |
That error message suggests I have cross compiles to Android working with a
|
Same issue on elementary OS 5.0. Other dependencies are building correctly. error: failed to run custom build command for Caused by: --- stderr warning: build failed, waiting for other jobs to finish... Followed this Setup for the Android toolchain: https://developer.holochain.org/guide/latest/building_for_android.html ~/.cargo/config:
|
@mad-de I forgot the 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
I double-checked the paths in the ~/.cargo/config they are correct. |
That message is from the |
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 |
Similar issue on macOS Mojave. I'm cross-compiling and ring is a transitive dependancy:
Caused by: --- stderr warning: build failed, waiting for other jobs to finish... Cargo config: `[target.aarch64-linux-android] [target.armv7-linux-androideabi] [target.i686-linux-android] 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. |
Can you try setting |
That actually solved my issue. A quick run with these commands built succesfully:
|
TARGET_CC
(and not CC
) must be set for Android (and other cross) targets
As noted above, currently this applies to |
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...
The text was updated successfully, but these errors were encountered: