Merge "kernel: allow devices to use newer GCC" into r
diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk
index 83c7114..2b81c05 100644
--- a/config/BoardConfigKernel.mk
+++ b/config/BoardConfigKernel.mk
@@ -28,6 +28,7 @@
# x86_64-linux-android- for x86
#
# TARGET_KERNEL_CLANG_COMPILE = Compile kernel with clang, defaults to false
+# TARGET_KERNEL_NEW_GCC_COMPILE = Compile kernel with newer version GCC, defaults to false
#
# KERNEL_TOOLCHAIN_PREFIX = Overrides TARGET_KERNEL_CROSS_COMPILE_PREFIX,
# Set this var in shell to override
@@ -54,16 +55,27 @@
CLANG_PREBUILTS := $(BUILD_TOP)/prebuilts/clang/host/$(HOST_OS)-x86/clang-r383902b
GCC_PREBUILTS := $(BUILD_TOP)/prebuilts/gcc/$(HOST_OS)-x86
-# arm64 toolchain
-KERNEL_TOOLCHAIN_arm64 := $(GCC_PREBUILTS)/aarch64/aarch64-linux-android-4.9/bin
-KERNEL_TOOLCHAIN_PREFIX_arm64 := aarch64-linux-android-
-# arm toolchain
-KERNEL_TOOLCHAIN_arm := $(GCC_PREBUILTS)/arm/arm-linux-androideabi-4.9/bin
-KERNEL_TOOLCHAIN_PREFIX_arm := arm-linux-androidkernel-
-# x86 toolchain
-KERNEL_TOOLCHAIN_x86 := $(GCC_PREBUILTS)/x86/x86_64-linux-android-4.9/bin
-KERNEL_TOOLCHAIN_PREFIX_x86 := x86_64-linux-android-
-
+ifeq ($(TARGET_KERNEL_NEW_GCC_COMPILE),true)
+ ifeq ($(TARGET_KERNEL_CLANG_COMPILE),true)
+ $(error TARGET_KERNEL_NEW_GCC_COMPILE cannot be used with TARGET_KERNEL_CLANG_COMPILE!)
+ endif
+ # arm64 toolchain
+ KERNEL_TOOLCHAIN_arm64 := $(GCC_PREBUILTS)/aarch64/aarch64-elf/bin
+ KERNEL_TOOLCHAIN_PREFIX_arm64 := aarch64-elf-
+ # arm toolchain
+ KERNEL_TOOLCHAIN_arm := $(GCC_PREBUILTS)/arm/arm-eabi/bin
+ KERNEL_TOOLCHAIN_PREFIX_arm := arm-eabi-
+else
+ # arm64 toolchain
+ KERNEL_TOOLCHAIN_arm64 := $(GCC_PREBUILTS)/aarch64/aarch64-linux-android-4.9/bin
+ KERNEL_TOOLCHAIN_PREFIX_arm64 := aarch64-linux-android-
+ # arm toolchain
+ KERNEL_TOOLCHAIN_arm := $(GCC_PREBUILTS)/arm/arm-linux-androideabi-4.9/bin
+ KERNEL_TOOLCHAIN_PREFIX_arm := arm-linux-androidkernel-
+ # x86 toolchain
+ KERNEL_TOOLCHAIN_x86 := $(GCC_PREBUILTS)/x86/x86_64-linux-android-4.9/bin
+ KERNEL_TOOLCHAIN_PREFIX_x86 := x86_64-linux-android-
+endif
TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(strip $(TARGET_KERNEL_CROSS_COMPILE_PREFIX))
ifneq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),)
KERNEL_TOOLCHAIN_PREFIX ?= $(TARGET_KERNEL_CROSS_COMPILE_PREFIX)