Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 89ce7df8 authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

Makefile: Fix 4.19.15 resolution



Commit 1637d5d2 ("kbuild: consolidate Clang compiler flags")
conflicts with commit 4c451dba ("ANDROID: Kbuild, LLVMLinux: allow
overriding clang target triple"). As it currently stands, CLANG_FLAGS
will not have the proper target parameter when cross compiling for
aarch64-linux-android. Move the CLANG_FLAGS definition up and use it
when checking for the proper target fallback, allowing us to properly
remove CLANG_TARGET.

Change-Id: I176146ad613bd5e6187f3421f29c2ffcc9ceebc3
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
parent f5cd36ad
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -483,11 +483,10 @@ endif
ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TRIPLE	?= $(CROSS_COMPILE)
CLANG_TARGET	:= --target=$(notdir $(CLANG_TRIPLE:%-=%))
ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_TARGET)), y)
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 $(LD)))
CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)
GCC_TOOLCHAIN	:= $(realpath $(GCC_TOOLCHAIN_DIR)/..)