All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: gregkh@linuxfoundation.org, sashal@kernel.org
Cc: conor@kernel.org, stable@vger.kernel.org, llvm@lists.linux.dev,
	 Masahiro Yamada <masahiroy@kernel.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	 Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH 5.10 3/4] kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS
Date: Tue, 28 Mar 2023 17:08:31 -0700	[thread overview]
Message-ID: <20230328-riscv-zifencei-zicsr-5-10-v1-3-bccb3e16dc46@kernel.org> (raw)
In-Reply-To: <20230328-riscv-zifencei-zicsr-5-10-v1-0-bccb3e16dc46@kernel.org>

From: Masahiro Yamada <masahiroy@kernel.org>

commit 52cc02b910284d6bddba46cce402044ab775f314 upstream.

LLVM_IAS is the user interface to set the -(no-)integrated-as flag,
and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type,
but it is not precise.

For example,

 $ make CC=gcc LLVM_IAS=1

... will use the GNU assembler (i.e. binutils) since LLVM_IAS=1 is
effective only when $(CC) is clang.

Of course, 'CC=gcc LLVM_IAS=1' is an odd combination, but the build
system can be more robust against such insane input.

Commit ba64beb17493a ("kbuild: check the minimum assembler version in
Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise
because Kconfig checks the version string from the assembler in use.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
[nathan: Backport to 5.10]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 Makefile            | 2 +-
 arch/riscv/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1272e482abbe..3dfacb6fa973 100644
--- a/Makefile
+++ b/Makefile
@@ -851,7 +851,7 @@ else
 DEBUG_CFLAGS	+= -g
 endif
 
-ifeq ($(LLVM_IAS),1)
+ifdef CONFIG_AS_IS_LLVM
 KBUILD_AFLAGS	+= -g
 else
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 9446282b52ba..14cdeaa2bb32 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -40,7 +40,7 @@ ifeq ($(CONFIG_LD_IS_LLD),y)
 ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0)
 	KBUILD_CFLAGS += -mno-relax
 	KBUILD_AFLAGS += -mno-relax
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
 	KBUILD_CFLAGS += -Wa,-mno-relax
 	KBUILD_AFLAGS += -Wa,-mno-relax
 endif

-- 
2.40.0


  parent reply	other threads:[~2023-03-29  0:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  0:08 [PATCH 5.10 0/4] Backport of e89c2e815e76 to linux-5.10.y Nathan Chancellor
2023-03-29  0:08 ` [PATCH 5.10 1/4] kbuild: check the minimum assembler version in Kconfig Nathan Chancellor
2023-04-18 10:16   ` Patch "kbuild: check the minimum assembler version in Kconfig" has been added to the 5.10-stable tree gregkh
2023-03-29  0:08 ` [PATCH 5.10 2/4] kbuild: Switch to 'f' variants of integrated assembler flag Nathan Chancellor
2023-04-18 10:16   ` Patch "kbuild: Switch to 'f' variants of integrated assembler flag" has been added to the 5.10-stable tree gregkh
2023-03-29  0:08 ` Nathan Chancellor [this message]
2023-04-18 10:16   ` Patch "kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS" " gregkh
2023-03-29  0:08 ` [PATCH 5.10 4/4] riscv: Handle zicsr/zifencei issues between clang and binutils Nathan Chancellor
2023-04-18 10:16   ` Patch "riscv: Handle zicsr/zifencei issues between clang and binutils" has been added to the 5.10-stable tree gregkh
2023-04-11 16:20 ` [PATCH 5.10 0/4] Backport of e89c2e815e76 to linux-5.10.y Nathan Chancellor
2023-04-12  6:17   ` Greg KH
2023-04-18  9:46     ` Greg KH
2023-04-18 16:19       ` 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=20230328-riscv-zifencei-zicsr-5-10-v1-3-bccb3e16dc46@kernel.org \
    --to=nathan@kernel.org \
    --cc=conor@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /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 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.