From 86e47c6486ae98a55e4c6f9220e29b01276983df Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Tue, 10 Nov 2020 11:37:31 -0800 Subject: [PATCH] Revert "ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple" This reverts commit e145f7b10374662f03889c2dea0fdc14df7f1371. 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 Signed-off-by: Sukrut4778 Signed-off-by: Cyber Knight --- Makefile | 6 +----- build.config.aarch64 | 4 ++-- build.config.x86_64 | 3 +-- scripts/clang-android.sh | 4 ---- 4 files changed, 4 insertions(+), 13 deletions(-) delete mode 100755 scripts/clang-android.sh diff --git a/Makefile b/Makefile index 3ef6da1406db..29d9106fdb31 100644 --- a/Makefile +++ b/Makefile @@ -521,11 +521,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 357db0220511..e95058111323 100644 --- a/build.config.aarch64 +++ b/build.config.aarch64 @@ -1,7 +1,7 @@ ARCH=arm64 -CLANG_TRIPLE=aarch64-linux-gnu- -CROSS_COMPILE=aarch64-linux-androidkernel- +CROSS_COMPILE=aarch64-linux-gnu- +CROSS_COMPILE_COMPAT=arm-linux-gnueabi- LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin FILES=" diff --git a/build.config.x86_64 b/build.config.x86_64 index df73a47e7220..0cc8a422a4ab 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/gcc/linux-x86/x86/x86_64-linux-android-4.9/bin 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"