Auto merge of #27173 - mark-buer:split-android-ndks, r=alexcrichton
Allows a multi-Android-target Rust compiler to be built. Without these (or similar) changes, only a single-Android-target Rust compiler is possible. Please see https://internals.rust-lang.org/t/dual-target-android-rust-compiler/2382/3 for additional context.
This commit is contained in:
commit
aa6efd959e
|
@ -601,7 +601,9 @@ valopt llvm-root "" "set LLVM root"
|
||||||
valopt python "" "set path to python"
|
valopt python "" "set path to python"
|
||||||
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
|
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
|
||||||
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
|
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
|
||||||
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
|
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path (deprecated)"
|
||||||
|
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
|
||||||
|
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
|
||||||
valopt release-channel "dev" "the name of the release channel to build"
|
valopt release-channel "dev" "the name of the release channel to build"
|
||||||
valopt musl-root "/usr/local" "MUSL root installation directory"
|
valopt musl-root "/usr/local" "MUSL root installation directory"
|
||||||
|
|
||||||
|
@ -1112,20 +1114,24 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $i in
|
case $i in
|
||||||
arm-linux-androideabi)
|
*android*)
|
||||||
|
upper_snake_target=$(echo "$i" | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
|
||||||
|
eval ndk=\$"CFG_${upper_snake_target}_NDK"
|
||||||
|
if [ -z "$ndk" ]
|
||||||
|
then
|
||||||
|
ndk=$CFG_ANDROID_CROSS_PATH
|
||||||
|
eval "CFG_${upper_snake_target}_NDK"=$CFG_ANDROID_CROSS_PATH
|
||||||
|
warn "generic/default Android NDK option is deprecated (use --$i-ndk option instead)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-gcc ]
|
# Perform a basic sanity check of the NDK
|
||||||
then
|
for android_ndk_tool in "$ndk/bin/$i-gcc" "$ndk/bin/$i-g++" "$ndk/bin/$i-ar"
|
||||||
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-gcc not found"
|
do
|
||||||
fi
|
if [ ! -f $android_ndk_tool ]
|
||||||
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-g++ ]
|
then
|
||||||
then
|
err "NDK tool $android_ndk_tool not found (bad or missing --$i-ndk option?)"
|
||||||
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-g++ not found"
|
fi
|
||||||
fi
|
done
|
||||||
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-ar ]
|
|
||||||
then
|
|
||||||
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-ar not found"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
arm-apple-darwin)
|
arm-apple-darwin)
|
||||||
|
@ -1682,7 +1688,8 @@ putvar CFG_HOST
|
||||||
putvar CFG_TARGET
|
putvar CFG_TARGET
|
||||||
putvar CFG_LIBDIR_RELATIVE
|
putvar CFG_LIBDIR_RELATIVE
|
||||||
putvar CFG_DISABLE_MANAGE_SUBMODULES
|
putvar CFG_DISABLE_MANAGE_SUBMODULES
|
||||||
putvar CFG_ANDROID_CROSS_PATH
|
putvar CFG_AARCH64_LINUX_ANDROID_NDK
|
||||||
|
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
|
||||||
putvar CFG_MANDIR
|
putvar CFG_MANDIR
|
||||||
|
|
||||||
# Avoid spurious warnings from clang by feeding it original source on
|
# Avoid spurious warnings from clang by feeding it original source on
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# aarch64-linux-android configuration
|
# aarch64-linux-android configuration
|
||||||
# CROSS_PREFIX_aarch64-linux-android-
|
# CROSS_PREFIX_aarch64-linux-android-
|
||||||
CC_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-gcc
|
CC_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-gcc
|
||||||
CXX_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-g++
|
CXX_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-g++
|
||||||
CPP_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-gcc -E
|
CPP_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-gcc -E
|
||||||
AR_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-ar
|
AR_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-ar
|
||||||
CFG_LIB_NAME_aarch64-linux-android=lib$(1).so
|
CFG_LIB_NAME_aarch64-linux-android=lib$(1).so
|
||||||
CFG_STATIC_LIB_NAME_aarch64-linux-android=lib$(1).a
|
CFG_STATIC_LIB_NAME_aarch64-linux-android=lib$(1).a
|
||||||
CFG_LIB_GLOB_aarch64-linux-android=lib$(1)-*.so
|
CFG_LIB_GLOB_aarch64-linux-android=lib$(1)-*.so
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# arm-linux-androideabi configuration
|
# arm-linux-androideabi configuration
|
||||||
CC_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
|
CC_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-gcc
|
||||||
CXX_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++
|
CXX_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-g++
|
||||||
CPP_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc -E
|
CPP_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-gcc -E
|
||||||
AR_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
|
AR_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-ar
|
||||||
CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
|
CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
|
||||||
CFG_STATIC_LIB_NAME_arm-linux-androideabi=lib$(1).a
|
CFG_STATIC_LIB_NAME_arm-linux-androideabi=lib$(1).a
|
||||||
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so
|
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so
|
||||||
|
|
Loading…
Reference in New Issue