diff --git a/Makefile b/Makefile index 0ef9bbd9cf72..4882c2b687bb 100644 --- a/Makefile +++ b/Makefile @@ -516,7 +516,7 @@ CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%)) ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_TARGET)), y) $(error "Clang with Android --target detected. Did you specify CLANG_TRIPLE?") endif -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