Skip to content

Commit

Permalink
kernel: Set correct kernel compiler prefixes for aarch64 clang
Browse files Browse the repository at this point in the history
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 c77bb3a.
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
  • Loading branch information
Rashed97 committed Jun 16, 2019
1 parent 7a85b90 commit 8613ea0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config/BoardConfigKernel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8613ea0

Please sign in to comment.