diff --git a/Makefile b/Makefile index 265175fe2402..d83917d3ad0f 100644 --- a/Makefile +++ b/Makefile @@ -695,7 +695,7 @@ KBUILD_CFLAGS += $(stackp-flag) ifeq ($(cc-name),clang) ifneq ($(CROSS_COMPILE),) CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%)) -GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..) +GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(CROSS_COMPILE)elfedit))/..) endif ifneq ($(GCC_TOOLCHAIN),) CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN)