Android.rules: fix computation of gcc toolchain directory on arm

The toolchain directory for arm android targets was computed
incorrectly. The architecture part should be arm, and the environment
part androideabi. This fixes that.

llvm-svn: 297279
This commit is contained in:
Pavel Labath 2017-03-08 14:57:15 +00:00
parent bdd2e3e36c
commit 9ef5778038
1 changed files with 11 additions and 11 deletions

View File

@ -14,34 +14,36 @@ endif
ifeq "$(ARCH)" "arm"
SYSROOT_ARCH := arm
STL_ARCH := armeabi-v7a
TRIPLE_ARCH := armv7
TRIPLE := armv7-none-linux-androideabi
ARCH_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm
else ifeq "$(ARCH)" "aarch64"
SYSROOT_ARCH := arm64
TRIPLE_ARCH := aarch64
TRIPLE := aarch64-none-linux-android
STL_ARCH := arm64-v8a
else ifeq "$(ARCH)" "i386"
SYSROOT_ARCH := x86
STL_ARCH := x86
TRIPLE_ARCH := i686
TRIPLE := i686-none-linux-android
else ifeq "$(ARCH)" "mips64r6"
SYSROOT_ARCH := mips64
STL_ARCH := mips64
TRIPLE_ARCH := mips64el
TRIPLE := mips64el-none-linux-android
else ifeq "$(ARCH)" "mips32"
SYSROOT_ARCH := mips
STL_ARCH := mips
TRIPLE_ARCH := mipsel
TRIPLE := mipsel-none-linux-android
else
SYSROOT_ARCH := $(ARCH)
STL_ARCH := $(ARCH)
TRIPLE_ARCH := $(ARCH)
TRIPLE := $(ARCH)-none-linux-android
endif
ifeq "$(findstring 86,$(ARCH))" "86"
TOOLCHAIN_DIR := $(STL_ARCH)-4.9
else ifeq "$(ARCH)" "arm"
TOOLCHAIN_DIR := arm-linux-androideabi-4.9
else
TOOLCHAIN_DIR := $(TRIPLE_ARCH)-linux-android-4.9
TOOLCHAIN_DIR := $(subst -none,,$(TRIPLE))-4.9
endif
ifeq "$(HOST_OS)" "Linux"
@ -53,11 +55,9 @@ else
endif
ifeq "$(findstring clang,$(CC))" "clang"
ARCH_CFLAGS += \
-target $(TRIPLE_ARCH)-none-linux-android \
ARCH_CFLAGS += -target $(TRIPLE) \
-gcc-toolchain $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
ARCH_LDFLAGS += \
-target $(TRIPLE_ARCH)-none-linux-android \
ARCH_LDFLAGS += -target $(TRIPLE) \
-gcc-toolchain $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
endif