Skip to content

Commit

Permalink
[ALPS05556626] Revert "ANDROID: Kbuild, LLVMLinux: allow overriding c…
Browse files Browse the repository at this point in the history
…lang"

This reverts commit 4c451db.

AOSPs distribution of GNU binutils always had a curious target triple
prefix on the binaries.  Now that GNU binutils is deprecated for Android
Common Kernels, we can now remove this out of tree workaround. Now
building Android kernels with LLVM matches upstream (see
Documentation/kbuild/llvm.rst).

MTK-Commit-Id: b5440b16b7023e31f590b8e213e766d4c9b0a716

Bug: 118439987
Bug: 120440614
Bug: 141693040
Signed-off-by: Nick Desaulniers <[email protected]>
Change-Id: Iecaa3264a440f795f2f3a44bdf74fe28ad4ed1cc
CR-Id: ALPS05556626
Feature: [Module]Kernel Maintenance
Signed-off-by: Miles Chen <[email protected]>
  • Loading branch information
nickdesaulniers authored and milesdotchen committed Mar 5, 2021
1 parent 5a49cab commit e9bb9b1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,7 @@ endif

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TRIPLE ?= $(CROSS_COMPILE)
CLANG_FLAGS += --target=$(notdir $(CLANG_TRIPLE:%-=%))
ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_FLAGS)), y)
$(error "Clang with Android --target detected. Did you specify CLANG_TRIPLE?")
endif
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
Expand Down
2 changes: 1 addition & 1 deletion build.config.allmodconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ function update_config() {
-e UNWINDER_FRAME_POINTER \

(cd ${OUT_DIR} && \
make O=${OUT_DIR} $archsubarch CLANG_TRIPLE=${CLANG_TRIPLE} CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
}
3 changes: 1 addition & 2 deletions build.config.arm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARCH=arm

CLANG_TRIPLE=arm-linux-gnueabi-
CROSS_COMPILE=arm-linux-androidkernel-
CROSS_COMPILE=arm-linux-gnueabi-
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86

FILES="
Expand Down
3 changes: 1 addition & 2 deletions build.config.x86_64
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARCH=x86_64

CLANG_TRIPLE=x86_64-linux-gnu-
CROSS_COMPILE=x86_64-linux-androidkernel-
CROSS_COMPILE=x86_64-linux-gnu-
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86

FILES="
Expand Down
4 changes: 0 additions & 4 deletions scripts/clang-android.sh

This file was deleted.

0 comments on commit e9bb9b1

Please sign in to comment.