diff options
Diffstat (limited to 'build/tools')
-rwxr-xr-x | build/tools/build-gnu-libstdc++.sh | 4 | ||||
-rw-r--r-- | build/tools/dev-defaults.sh | 21 | ||||
-rwxr-xr-x | build/tools/gen-platforms.sh | 4 |
3 files changed, 22 insertions, 7 deletions
diff --git a/build/tools/build-gnu-libstdc++.sh b/build/tools/build-gnu-libstdc++.sh index 48a313d64..aa23fae08 100755 --- a/build/tools/build-gnu-libstdc++.sh +++ b/build/tools/build-gnu-libstdc++.sh @@ -390,10 +390,10 @@ copy_gnustl_libs () GCC_VERSION_LIST=$(commas_to_spaces $GCC_VERSION_LIST) for ABI in $ABIS; do ARCH=$(convert_abi_to_arch $ABI) - DEFAULT_GCC_VERSION=$(get_default_gcc_version_for_arch $ARCH) + FIRST_GCC_VERSION=$(get_first_gcc_version_for_arch $ARCH) for VERSION in $GCC_VERSION_LIST; do # Only build for this GCC version if it on or after DEFAULT_GCC_VERSION - if [ -z "$EXPLICIT_COMPILER_VERSION" ] && ! version_is_greater_than "${VERSION%%l}" "$DEFAULT_GCC_VERSION"; then + if [ -z "$EXPLICIT_COMPILER_VERSION" ] && version_is_greater_than "${VERSION%%l}" "$FIRST_GCC_VERSION"; then continue fi diff --git a/build/tools/dev-defaults.sh b/build/tools/dev-defaults.sh index 025b4c697..8078e3f84 100644 --- a/build/tools/dev-defaults.sh +++ b/build/tools/dev-defaults.sh @@ -49,8 +49,10 @@ TOOLCHAIN_GIT_DATE=now # The space-separated list of all GCC versions we support in this NDK DEFAULT_GCC_VERSION_LIST="4.6 4.8 4.9" -DEFAULT_GCC32_VERSION=4.6 +DEFAULT_GCC32_VERSION=4.8 DEFAULT_GCC64_VERSION=4.9 +FIRST_GCC32_VERSION=4.6 +FIRST_GCC64_VERSION=4.9 DEFAULT_LLVM_GCC32_VERSION=4.8 DEFAULT_LLVM_GCC64_VERSION=4.9 @@ -121,6 +123,17 @@ get_default_gcc_version_for_arch () esac } +# Return the first gcc version for a given architecture +# $1: Architecture name (e.g. 'arm') +# Out: default arch-specific gcc version +get_first_gcc_version_for_arch () +{ + case $1 in + *64) echo $FIRST_GCC64_VERSION ;; + *) echo $FIRST_GCC32_VERSION ;; + esac +} + # Return default NDK ABI for a given architecture name # $1: Architecture name # Out: ABI name @@ -210,13 +223,13 @@ get_default_toolchain_prefix_for_arch () # Return empty for unknown arch get_toolchain_name_list_for_arch () { - local PREFIX VERSION RET ADD DEFAULT_GCC_VERSION VERSIONS + local PREFIX VERSION RET ADD FIRST_GCC_VERSION VERSIONS PREFIX=$(eval echo \"\$DEFAULT_ARCH_TOOLCHAIN_NAME_$1\") if [ -z "$PREFIX" ]; then return 0 fi RET="" - DEFAULT_GCC_VERSION=$(get_default_gcc_version_for_arch $1) + FIRST_GCC_VERSION=$(get_first_gcc_version_for_arch $1) ADD="" VERSIONS=$(commas_to_spaces $2) if [ -z "$VERSIONS" ]; then @@ -225,7 +238,7 @@ get_toolchain_name_list_for_arch () ADD="yes" # include everything we passed explicitly fi for VERSION in $VERSIONS; do - if [ -z "$ADD" -a "$VERSION" = "$DEFAULT_GCC_VERSION" ]; then + if [ -z "$ADD" -a "$VERSION" = "$FIRST_GCC_VERSION" ]; then ADD="yes" fi if [ -z "$ADD" ]; then diff --git a/build/tools/gen-platforms.sh b/build/tools/gen-platforms.sh index 2f7982c43..49d4fd8ba 100755 --- a/build/tools/gen-platforms.sh +++ b/build/tools/gen-platforms.sh @@ -388,7 +388,9 @@ get_default_compiler_for_arch() elif [ -n "$OPTION_GCC_VERSION" -a "$OPTION_GCC_VERSION" != "default" ]; then GCC_VERSION=$OPTION_GCC_VERSION else - GCC_VERSION=$(get_default_gcc_version_for_arch $ARCH) + # By default we want to use the first gcc (currently 4.6) instead of the default (gcc4.8) + # for best compatibility, at least before gcc4.6 (now deprecated) is removed from NDK package + GCC_VERSION=$(get_first_gcc_version_for_arch $ARCH) # $(get_default_gcc_version_for_arch $ARCH) fi for TAG in $HOST_TAG $HOST_TAG32; do TOOLCHAIN_PREFIX="$NDK_DIR/$(get_toolchain_binprefix_for_arch $ARCH $GCC_VERSION $TAG)" |