public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Grigory Vasilyev <h0tc0d3@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Grigory Vasilyev <h0tc0d3@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Shuah Khan <shuah@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Yury Norov <yury.norov@gmail.com>, Yonghong Song <yhs@fb.com>,
	Adrian Ratiu <adrian.ratiu@collabora.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, llvm@lists.linux.dev
Subject: [PATCH] Fix kernel build with LLVM=1
Date: Fri,  1 Apr 2022 00:56:58 +0300	[thread overview]
Message-ID: <20220331215659.3800-1-h0tc0d3@gmail.com> (raw)

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


             reply	other threads:[~2022-03-31 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31 21:56 Grigory Vasilyev [this message]
2022-03-31 22:08 ` [PATCH] Fix kernel build with LLVM=1 Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331215659.3800-1-h0tc0d3@gmail.com \
    --to=h0tc0d3@gmail.com \
    --cc=adrian.ratiu@collabora.com \
    --cc=daniel@iogearbox.net \
    --cc=jean-philippe@linaro.org \
    --cc=keescook@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=shuah@kernel.org \
    --cc=yhs@fb.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox