summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Pasanen <invisiblek@cyanogenmod.org>2016-08-29 08:37:10 -0500
committerZhao Wei Liew <zhaoweiliew@gmail.com>2016-11-10 20:01:02 +0800
commit00e9db581fa3eece6784a8fd1dfcbd1bfc280c71 (patch)
tree098a805b8424b7f09ef7e41b70a5a77db28650f2
parent62366951c46777315d8e711e7c292278113a832d (diff)
downloadbuild-00e9db581fa3eece6784a8fd1dfcbd1bfc280c71.zip
build-00e9db581fa3eece6784a8fd1dfcbd1bfc280c71.tar.gz
build-00e9db581fa3eece6784a8fd1dfcbd1bfc280c71.tar.bz2
kernel: Auto-set prefix based on KERNEL_ARCH
Change-Id: I5c83e7de97b75ece9a1306cb20b058d9fd30e288
-rw-r--r--core/tasks/kernel.mk14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/tasks/kernel.mk b/core/tasks/kernel.mk
index eedf6ca..f5a27c0 100644
--- a/core/tasks/kernel.mk
+++ b/core/tasks/kernel.mk
@@ -32,7 +32,9 @@
# TARGET_USES_UNCOMPRESSED_KERNEL = 'true' if Kernel is uncompressed,
# optional, defaults to false
# TARGET_KERNEL_CROSS_COMPILE_PREFIX = Compiler prefix (e.g. aarch64-linux-android-)
-# defaults to arm-eabi-
+# defaults to arm-eabi- for arm
+# aarch64-linux-android- for arm64
+# x86_64-linux-android- for x86
#
# BOARD_KERNEL_IMAGE_NAME = Built image name, optional,
# defaults to Image.gz on arm64
@@ -210,10 +212,14 @@ KERNEL_MODULES_OUT := $(TARGET_OUT)/lib/modules
endif
TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(strip $(TARGET_KERNEL_CROSS_COMPILE_PREFIX))
-ifeq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),)
-KERNEL_TOOLCHAIN_PREFIX ?= arm-eabi-
-else
+ifneq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),)
KERNEL_TOOLCHAIN_PREFIX ?= $(TARGET_KERNEL_CROSS_COMPILE_PREFIX)
+else ifeq ($(KERNEL_ARCH),arm64)
+KERNEL_TOOLCHAIN_PREFIX ?= aarch64-linux-android-
+else ifeq ($(KERNEL_ARCH),arm)
+KERNEL_TOOLCHAIN_PREFIX ?= arm-eabi-
+else ifeq ($(KERNEL_ARCH),x86)
+KERNEL_TOOLCHAIN_PREFIX ?= x86_64-linux-android-
endif
ifeq ($(KERNEL_TOOLCHAIN),)