All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix kernel build with LLVM=1
@ 2022-03-31 21:56 ` Grigory Vasilyev
  0 siblings, 0 replies; 3+ messages in thread
From: Grigory Vasilyev @ 2022-03-31 21:56 UTC (permalink / raw)
  Cc: Grigory Vasilyev, Masahiro Yamada, Michal Marek,
	Nick Desaulniers, Shuah Khan, Nathan Chancellor, Kees Cook,
	Jean-Philippe Brucker, Daniel Borkmann, Yury Norov,
	Yonghong Song, Adrian Ratiu, linux-kbuild, linux-kernel,
	linux-kselftest, llvm

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(-)

diff --git a/Makefile b/Makefile
index 18ecb49f1af6..efca890d4ea3 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 0efb8f2b33ce..c7a56d7f0bad 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -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))
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 2a2d240cdc1b..42af066cf39e 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-31 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 21:56 [PATCH] Fix kernel build with LLVM=1 Grigory Vasilyev
2022-03-31 21:56 ` Grigory Vasilyev
2022-03-31 22:08 ` Nathan Chancellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.