Skip to content

Commit

Permalink
Revert^2 "ANDROID: Kbuild, LLVMLinux: allow overriding clang""
Browse files Browse the repository at this point in the history
This reverts commit e9bb9b1.

Change-Id: I4f49a30389988dec504db0abd47008157271831c
  • Loading branch information
erfanoabdi authored and techyminati committed Mar 29, 2023
1 parent ed2f537 commit 98b3a32
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,11 @@ endif

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_FLAGS += --target=$(notdir $(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
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 CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
make O=${OUT_DIR} $archsubarch CLANG_TRIPLE=${CLANG_TRIPLE} CROSS_COMPILE=${CROSS_COMPILE} "${TOOL_ARGS[@]}" ${MAKE_ARGS} olddefconfig)
}
3 changes: 2 additions & 1 deletion build.config.arm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARCH=arm

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

FILES="
Expand Down
4 changes: 4 additions & 0 deletions scripts/clang-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

$* -dM -E - </dev/null 2>&1 | grep -q __ANDROID__ && echo "y"

0 comments on commit 98b3a32

Please sign in to comment.