@@ -426,8 +426,8 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
ifneq ($(LLVM),)
ifneq ($(filter %/,$(LLVM)),)
LLVM_PREFIX := $(LLVM)
-else ifneq ($(filter -%,$(LLVM)),)
-LLVM_SUFFIX := $(LLVM)
+else ifneq (,$(findstring -, $(LLVM)))
+LLVM_SUFFIX := $(filter -%, $(LLVM))
endif
HOSTCC = $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
@@ -54,8 +54,8 @@ endef
ifneq ($(LLVM),)
ifneq ($(filter %/,$(LLVM)),)
LLVM_PREFIX := $(LLVM)
-else ifneq ($(filter -%,$(LLVM)),)
-LLVM_SUFFIX := $(LLVM)
+else ifneq (,$(findstring -, $(LLVM)))
+LLVM_SUFFIX := $(filter -%, $(LLVM))
endif
$(call allow-override,CC,$(LLVM_PREFIX)clang$(LLVM_SUFFIX))
@@ -3,8 +3,8 @@
ifneq ($(LLVM),)
ifneq ($(filter %/,$(LLVM)),)
LLVM_PREFIX := $(LLVM)
-else ifneq ($(filter -%,$(LLVM)),)
-LLVM_SUFFIX := $(LLVM)
+else ifneq (,$(findstring -, $(LLVM)))
+LLVM_SUFFIX := $(filter -%, $(LLVM))
endif
CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
The wrong logic is using 1 as a suffix instead of -1. So the build script tries to find clang1 file instead of clang. GEN Makefile HOSTCC scripts/basic/fixdep /bin/sh: line 1: clang1: command not found make[2]: *** [/build/linux/scripts/Makefile.host:95: scripts/basic/fixdep] Error 127 make[1]: *** [/build/linux/Makefile:564: scripts_basic] Error 2 make: *** [Makefile:219: __sub-make] Error 2 Fixes: b8321ed4a40c("Merge tag 'kbuild-v5.18-v2'") Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com> Reported-by: Grigory Vasilyev <h0tc0d3@gmail.com> --- Makefile | 4 ++-- tools/scripts/Makefile.include | 4 ++-- tools/testing/selftests/lib.mk | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)