kernel: Set correct kernel compiler prefixes for aarch64 clang

These configuration options are set based on the Google configurations
located in kernels
(ex. https://github.com/LineageOS/android_kernel_google_wahoo/blob/lineage-16.0/build.config)

This is composed of 2 parts:

Revert "kernel: Correct CROSS_COMPILE_ARM32 toolchain"

This reverts commit c77bb3a5ba.
This breaks builds when building with upstream commit
ad15006cc78459d059af56729c4d9bed7c7fd860. That commit fixes LD being
used from outside the path, however androidkernel toolchains don't
have elfedit. Google specifically doesn't use androidkernel, so we
need to follow them on this.

Set CROSS_COMPILE_PREFIX to aarch64-linux-android- for clang builds

Upstream commit ad15006cc78459d059af56729c4d9bed7c7fd860 makes the
kernel build system use GCC toolchains for elfedit, so we have to
actually use a real GCC toolchain, not the androidkernel one.

Change-Id: I79ac4ac47d3ba6c2abbc5ce40e56ed5c707295b4
gugelfrei
Rashed Abdel-Tawab 5 years ago committed by Rashed Abdel-Tawab
parent 7a85b90de1
commit 8613ea0ac1

@ -55,7 +55,11 @@ TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(strip $(TARGET_KERNEL_CROSS_COMPILE_PREF
ifneq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),)
KERNEL_TOOLCHAIN_PREFIX ?= $(TARGET_KERNEL_CROSS_COMPILE_PREFIX)
else ifeq ($(KERNEL_ARCH),arm64)
KERNEL_TOOLCHAIN_PREFIX ?= aarch64-linux-androidkernel-
ifeq ($(TARGET_KERNEL_CLANG_COMPILE),true)
KERNEL_TOOLCHAIN_PREFIX ?= aarch64-linux-android-
else
KERNEL_TOOLCHAIN_PREFIX ?= aarch64-linux-androidkernel-
endif
else ifeq ($(KERNEL_ARCH),arm)
KERNEL_TOOLCHAIN_PREFIX ?= arm-linux-androidkernel-
else ifeq ($(KERNEL_ARCH),x86)
@ -89,7 +93,7 @@ endif
# Needed for CONFIG_COMPAT_VDSO, safe to set for all arm64 builds
ifeq ($(KERNEL_ARCH),arm64)
KERNEL_CROSS_COMPILE += CROSS_COMPILE_ARM32="arm-linux-androidkernel-"
KERNEL_CROSS_COMPILE += CROSS_COMPILE_ARM32="arm-linux-androideabi-"
endif
# Clear this first to prevent accidental poisoning from env

Loading…
Cancel
Save