Skip to content

Commit be04763

Browse files
Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple"
This reverts commit 4c451db. AOSP's 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). Bug: 118439987 Bug: 120440614 Bug: 141693040 Signed-off-by: Nick Desaulniers <[email protected]> Change-Id: Iecaa3264a440f795f2f3a44bdf74fe28ad4ed1cc
1 parent bc09bee commit be04763

File tree

6 files changed

+6
-17
lines changed

6 files changed

+6
-17
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,7 @@ endif
501501

502502
ifeq ($(cc-name),clang)
503503
ifneq ($(CROSS_COMPILE),)
504-
CLANG_TRIPLE ?= $(CROSS_COMPILE)
505-
CLANG_FLAGS += --target=$(notdir $(CLANG_TRIPLE:%-=%))
506-
ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_FLAGS)), y)
507-
$(error "Clang with Android --target detected. Did you specify CLANG_TRIPLE?")
508-
endif
504+
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
509505
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
510506
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
511507
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)

build.config.aarch64

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
ARCH=arm64
22

3-
CLANG_TRIPLE=aarch64-linux-gnu-
4-
CROSS_COMPILE=aarch64-linux-androidkernel-
5-
CROSS_COMPILE_COMPAT=arm-linux-androidkernel-
3+
CROSS_COMPILE=aarch64-linux-gnu-
4+
CROSS_COMPILE_COMPAT=arm-linux-gnueabi-
65
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86
76
LINUX_GCC_CROSS_COMPILE_COMPAT_PREBUILTS_BIN=prebuilts/gas/linux-x86
87

build.config.allmodconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ function update_config() {
1010
-e UNWINDER_FRAME_POINTER \
1111

1212
(cd ${OUT_DIR} && \
13-
make O=${OUT_DIR} $archsubarch CLANG_TRIPLE=${CLANG_TRIPLE} CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
13+
make O=${OUT_DIR} $archsubarch CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
1414
}

build.config.arm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ARCH=arm
22

3-
CLANG_TRIPLE=arm-linux-gnueabi-
4-
CROSS_COMPILE=arm-linux-androidkernel-
3+
CROSS_COMPILE=arm-linux-gnueabi-
54
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86
65

76
FILES="

build.config.x86_64

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ARCH=x86_64
22

3-
CLANG_TRIPLE=x86_64-linux-gnu-
4-
CROSS_COMPILE=x86_64-linux-androidkernel-
3+
CROSS_COMPILE=x86_64-linux-gnu-
54
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86
65

76
FILES="

scripts/clang-android.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)