diff mbox series

[04/13] kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD

Message ID 20250531084449.4125187-4-ilias.apalodimas@linaro.org
State New
Headers show
Series [01/13] kbuild: add -fno-PIE flag unconditionally | expand

Commit Message

Ilias Apalodimas May 31, 2025, 8:44 a.m. UTC
Backported from kernel
commit ad15006cc784 ("kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 9098e732b4a8..82bcc097e493 100644
--- a/Makefile
+++ b/Makefile
@@ -446,7 +446,7 @@  ifeq ($(cc-name),clang)
 ifneq ($(CROSS_COMPILE),)
 CLANG_TARGET	:= --target=$(notdir $(CROSS_COMPILE:%-=%))
 LDPPFLAGS	+= $(CLANG_TARGET)
-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