From be047631defd955980ea239e1f690e1f733692fd Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Tue, 10 Nov 2020 11:45:35 -0800 Subject: [PATCH] Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple" This reverts commit 4c451dba25d2829a6a0c532196cce83e2e65b47e. 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 Change-Id: Iecaa3264a440f795f2f3a44bdf74fe28ad4ed1cc --- Makefile | 6 +----- build.config.aarch64 | 5 ++--- build.config.allmodconfig | 2 +- build.config.arm | 3 +-- build.config.x86_64 | 3 +-- scripts/clang-android.sh | 4 ---- 6 files changed, 6 insertions(+), 17 deletions(-) delete mode 100755 scripts/clang-android.sh diff --git a/Makefile b/Makefile index 766b40b81746..f72ed4f02bfe 100644 --- a/Makefile +++ b/Makefile @@ -501,11 +501,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)/..) diff --git a/build.config.aarch64 b/build.config.aarch64 index adc881d0cc30..569b9747661d 100644 --- a/build.config.aarch64 +++ b/build.config.aarch64 @@ -1,8 +1,7 @@ ARCH=arm64 -CLANG_TRIPLE=aarch64-linux-gnu- -CROSS_COMPILE=aarch64-linux-androidkernel- -CROSS_COMPILE_COMPAT=arm-linux-androidkernel- +CROSS_COMPILE=aarch64-linux-gnu- +CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gas/linux-x86 LINUX_GCC_CROSS_COMPILE_COMPAT_PREBUILTS_BIN=prebuilts/gas/linux-x86 diff --git a/build.config.allmodconfig b/build.config.allmodconfig index 4ce14e5a7c5a..103d1cdf4edc 100644 --- a/build.config.allmodconfig +++ b/build.config.allmodconfig @@ -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) } diff --git a/build.config.arm b/build.config.arm index 35defb811b98..a9e9a6c2a418 100644 --- a/build.config.arm +++ b/build.config.arm @@ -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=" diff --git a/build.config.x86_64 b/build.config.x86_64 index 73405452fe83..b16ac8a68b25 100644 --- a/build.config.x86_64 +++ b/build.config.x86_64 @@ -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=" diff --git a/scripts/clang-android.sh b/scripts/clang-android.sh deleted file mode 100755 index 9186c4f48576..000000000000 --- a/scripts/clang-android.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 - -$* -dM -E - &1 | grep -q __ANDROID__ && echo "y"