failed to run custom build command for `backtrace-sys v0.1.10`
Opened this issue · 8 comments
rustc --version
rustc 1.16.0 (30cf806ef 2017-03-10)Android-NDK from homebrew:
brew cask install android-ndkin .cargo/config:
[target.aarch64-linux-android]
ar = "/usr/local/opt/android-ndk/android-ndk-r14b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar"
linker = "/usr/local/opt/android-ndk/android-ndk-r14b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-gcc"Error message:
cargo build --target aarch64-linux-android --release
Compiling backtrace-sys v0.1.10
error: failed to run custom build command for `backtrace-sys v0.1.10`
process didn't exit successfully: `/$HOME/$PROJECT/target/release/build/backtrace-sys-a2edac7cf1ad7e33/build-script-build` (exit code: 101)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("aarch64-linux-android")
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
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-apple-darwin")
1 [target.aarch64-linux-android]
CFLAGS_aarch64-linux-android = None
CFLAGS_aarch64_linux_android = None
TARGET_CFLAGS = None
CFLAGS = Some("-Qunused-arguments")
PROFILE = Some("release")
running: "/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--target=aarch64-linux-android" "--host=x86_64-apple-darwin"
checking build system type... x86_64-apple-darwin16.5.0
checking host system type... x86_64-apple-darwin
checking target system type... aarch64-unknown-linux-android
checking for x86_64-apple-darwin-gcc... aarch64-linux-android-gcc
checking for C compiler default output file name...
--- stderr
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
configure: error: in `/$HOME/$PROJECT/target/aarch64-linux-android/release/build/backtrace-sys-e4956d294e94bde6/out':
configure: error: C compiler cannot create executables
See `config.log' for more details.
thread 'main' panicked at 'failed with: exit code: 77', /$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/build.rs:134
note: Run with `RUST_BACKTRACE=1` for a backtrace.
config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by package-unused configure version-unused, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ /$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure --with-pic --disable-multilib --disable-shared --disable-host-shared --target=aarch64-linux-android --host=x86_64-apple-darwin
## --------- ##
## Platform. ##
## --------- ##
hostname = $LAPTOP
uname -m = x86_64
uname -r = 16.5.0
uname -s = Darwin
uname -v = Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = Mach kernel version:
Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3
Primary memory available: 8.00 gigabytes
Default processor set: 315 tasks, 1216 threads, 4 processors
Load average: 1.82, Mach factor: 2.17
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /$HOME/.cargo/bin
PATH: /$HOME/bin
PATH: /$HOME/.cargo/bin
PATH: /usr/local/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /Library/TeX/texbin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2524: checking build system type
configure:2538: result: x86_64-apple-darwin16.5.0
configure:2558: checking host system type
configure:2571: result: x86_64-apple-darwin
configure:2591: checking target system type
configure:2604: result: aarch64-unknown-linux-android
configure:2641: checking for x86_64-apple-darwin-gcc
configure:2668: result: aarch64-linux-android-gcc
configure:2937: checking for C compiler version
configure:2946: aarch64-linux-android-gcc --version >&5
/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure: line 2948: aarch64-linux-android-gcc: command not found
configure:2957: $? = 127
configure:2946: aarch64-linux-android-gcc -v >&5
/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure: line 2948: aarch64-linux-android-gcc: command not found
configure:2957: $? = 127
configure:2946: aarch64-linux-android-gcc -V >&5
/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure: line 2948: aarch64-linux-android-gcc: command not found
configure:2957: $? = 127
configure:2946: aarch64-linux-android-gcc -qversion >&5
/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure: line 2948: aarch64-linux-android-gcc: command not found
configure:2957: $? = 127
configure:2977: checking for C compiler default output file name
configure:2999: aarch64-linux-android-gcc -O3 -ffunction-sections -fdata-sections -fPIC -Qunused-arguments -Qunused-arguments conftest.c >&5
/$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure: line 3001: aarch64-linux-android-gcc: command not found
configure:3003: $? = 127
configure:3040: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "package-unused"
| #define PACKAGE_TARNAME "libbacktrace"
| #define PACKAGE_VERSION "version-unused"
| #define PACKAGE_STRING "package-unused version-unused"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3046: error: in `/$HOME/$PROJECT/target/aarch64-linux-android/release/build/backtrace-sys-e4956d294e94bde6/out':
configure:3050: error: C compiler cannot create executables
See `config.log' for more details.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-apple-darwin16.5.0
ac_cv_env_CC_set=set
ac_cv_env_CC_value=aarch64-linux-android-gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O3 -ffunction-sections -fdata-sections -fPIC -Qunused-arguments'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-Qunused-arguments
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-apple-darwin
ac_cv_env_target_alias_set=set
ac_cv_env_target_alias_value=aarch64-linux-android
ac_cv_host=x86_64-apple-darwin
ac_cv_prog_CC=aarch64-linux-android-gcc
ac_cv_target=aarch64-unknown-linux-android
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL=''
ALLOC_FILE=''
AMTAR=''
AR=''
AUTOCONF=''
AUTOHEADER=''
AUTOMAKE=''
AWK=''
BACKTRACE_FILE=''
BACKTRACE_SUPPORTED=''
BACKTRACE_SUPPORTS_DATA=''
BACKTRACE_SUPPORTS_THREADS=''
BACKTRACE_USES_MALLOC=''
CC='aarch64-linux-android-gcc'
CFLAGS='-O3 -ffunction-sections -fdata-sections -fPIC -Qunused-arguments'
CPP=''
CPPFLAGS='-Qunused-arguments'
CYGPATH_W=''
DEFS=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
EXTRA_FLAGS=''
FGREP=''
FORMAT_FILE=''
GREP=''
INSTALL_DATA=''
INSTALL_PROGRAM=''
INSTALL_SCRIPT=''
INSTALL_STRIP_PROGRAM=''
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
MKDIR_P=''
NATIVE_FALSE=''
NATIVE_TRUE=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME='package-unused'
PACKAGE_STRING='package-unused version-unused'
PACKAGE_TARNAME='libbacktrace'
PACKAGE_URL=''
PACKAGE_VERSION='version-unused'
PATH_SEPARATOR=':'
PIC_FLAG=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION=''
VIEW_FILE=''
WARN_FLAGS=''
ac_ct_CC=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__isrc=''
am__leading_dot=''
am__tar=''
am__untar=''
bindir='${exec_prefix}/bin'
build='x86_64-apple-darwin16.5.0'
build_alias=''
build_cpu='x86_64'
build_os='darwin16.5.0'
build_vendor='apple'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-apple-darwin'
host_alias='x86_64-apple-darwin'
host_cpu='x86_64'
host_os='darwin'
host_vendor='apple'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
libtool_VERSION=''
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p=''
multi_basedir=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='aarch64-unknown-linux-android'
target_alias='aarch64-linux-android'
target_cpu='aarch64'
target_os='linux-android'
target_vendor='unknown'
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "package-unused"
#define PACKAGE_TARNAME "libbacktrace"
#define PACKAGE_VERSION "version-unused"
#define PACKAGE_STRING "package-unused version-unused"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 77
Probably due to the issue fixed by jni-rs/jni-rs#6.
I have updated the jni dependency to 0.4 in the latest master, please try if this fixes the issue. If not, try to use a standalone NDK.
@kennytm Still fails with jni version 0.4 and standalone NDK……
@realwangyibo Are you using the create-ndk-standalone.sh script? Don't forget to modify .cargo/config to match the one generated by the script also.
@kennytm Using $ANDROID_NDK_HOME/build/tools/make-standalone-toolchain.py manually, with config modified to match standalone NDK. test -x returns true.
@realwangyibo Could you post how make-standalone-toolchain.py is invoked? (the command line arguments)
Build the latest master:
$ ./make_standalone_toolchain.py --arch arm64 --install-dir ~/Downloads/rust-ios-android-master/sample/cargo/NDK/arm64
WARNING:__main__:Defaulting to target API 21 (minimum supported target for arm64)[target.aarch64-linux-android]
ar = "/Users/Patrick/Downloads/rust-ios-android-master/sample/cargo/NDK/arm64/bin/aarch64-linux-android-ar"
linker = "/Users/Patrick/Downloads/rust-ios-android-master/sample/cargo/NDK/arm64/bin/aarch64-linux-android-gcc"$ cargo build --target aarch64-linux-android --release
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling backtrace v0.3.0
Compiling log v0.3.7
Compiling jni-sys v0.2.2
Compiling void v1.0.2
Compiling gcc v0.3.45
Compiling cfg-if v0.1.0
Compiling rustc-demangle v0.1.4
Compiling cesu8 v1.1.0
Compiling regex-syntax v0.4.0
Compiling utf8-ranges v1.0.0
Compiling winapi-build v0.1.1
Compiling unreachable v0.1.1
Compiling ascii v0.7.1
Compiling kernel32-sys v0.2.2
Compiling dbghelp-sys v0.2.0
Compiling combine v2.3.2
Compiling winapi v0.2.8
Compiling libc v0.2.22
Compiling backtrace-sys v0.1.10
Compiling memchr v1.0.1
Compiling thread-id v3.0.0
Compiling aho-corasick v0.6.3
Compiling thread_local v0.3.3
error: failed to run custom build command for `backtrace-sys v0.1.10`
process didn't exit successfully: `/Users/Patrick/Downloads/rust-ios-android-master/sample/cargo/target/release/build/backtrace-sys-3989d5c503a9238f/build-script-build` (exit code: 101)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("aarch64-linux-android")
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
TARGET = Some("aarch64-linux-android")
HOST = Some("x86_64-apple-darwin")
CFLAGS_aarch64-linux-android = None
CFLAGS_aarch64_linux_android = None
TARGET_CFLAGS = None
CFLAGS = Some("-Qunused-arguments")
PROFILE = Some("release")
running: "/Users/Patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/src/libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--target=aarch64-linux-android" "--host=x86_64-apple-darwin"
checking build system type... x86_64-apple-darwin16.5.0
checking host system type... x86_64-apple-darwin
checking target system type... aarch64-unknown-linux-android
checking for x86_64-apple-darwin-gcc... aarch64-linux-android-gcc
checking for C compiler default output file name...
--- stderr
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
configure: error: in `/Users/Patrick/Downloads/rust-ios-android-master/sample/cargo/target/aarch64-linux-android/release/build/backtrace-sys-c41044212322c9f2/out':
configure: error: C compiler cannot create executables
See `config.log' for more details.
thread 'main' panicked at 'failed with: exit code: 77', /Users/Patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.10/build.rs:134
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Build failed, waiting for other jobs to finish...
error: build failed@realwangyibo I have disabled the backtrace feature of jni 0.4 on master now.
[target.'cfg(target_os="android")'.dependencies]
jni = { version = "0.4", default-features = false }Looks like something's wrong with backtrace-sys 0.1.6.
It works! Thank you for resolving this!