kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
[GitHub/exynos8895/android_kernel_samsung_universal8895.git] / Makefile
index 31c528e7a91eb227a9cf4680a53126522732e97f..7bece7a1f0524352929dcefdbf6ef8339e72d708 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -737,7 +737,7 @@ ifeq ($(cc-name),clang)
 ifneq ($(CROSS_COMPILE),)
 CLANG_TRIPLE    ?= $(CROSS_COMPILE)
 CLANG_TARGET   := --target=$(notdir $(CLANG_TRIPLE:%-=%))
-GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
 CLANG_PREFIX   := --prefix=$(GCC_TOOLCHAIN_DIR)
 GCC_TOOLCHAIN  := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
 endif