stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: palmer@dabbelt.com
Cc: conor@kernel.org, Conor Dooley <conor.dooley@microchip.com>,
	nathan@kernel.org, naresh.kamboju@linaro.org,
	linux-riscv@lists.infradead.org, llvm@lists.linux.dev,
	stable@vger.kernel.org
Subject: [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only
Date: Thu, 23 Feb 2023 22:05:46 +0000	[thread overview]
Message-ID: <20230223220546.52879-3-conor@kernel.org> (raw)
In-Reply-To: <20230223220546.52879-1-conor@kernel.org>

From: Conor Dooley <conor.dooley@microchip.com>

Quoting the llvm docs:
> Between versions 2.0 and 2.1 of the base I specification, a backwards
> incompatible change was made to remove selected instructions and CSRs
> from the base ISA. These instructions were grouped into a set of new
> extensions, but were no longer required by the base ISA. (snip) LLVM
> currently implements version 2.0 of the base specification. Thus,
> instructions from these extensions are accepted as part of the base
> ISA.

There is therefore no need (at present!) to carry out a $cc-option
check, and instead just gate presence of zicsr and zifencei in march
on the version of binutils that commit 6df2a016c0c8 ("riscv: fix build
with binutils 2.38") highlights as the introduction of the requirement.

In fact, the status quo creates some issues with mixed llvm/binutils
builds, specifically building with llvm-17 and ld from binutils-2.35.
Odd combo you may think, but this is what tuxsuite's debian stable uses
while testing 5.10 stable kernels as doesn't support LLD.

CC: stable@vger.kernel.org # needs RISC-V: move zicsr/zifencei spec version check to Kconfi
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://lore.kernel.org/all/CA+G9fYt9T=ELCLaB9byxaLW2Qf4pZcDO=huCA0D8ug2V2+irJQ@mail.gmail.com/
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 arch/riscv/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 4eb0ef8314b3..c6902f4c5650 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -291,8 +291,7 @@ endchoice
 config TOOLCHAIN_NEEDS_SPEC_20191213
 	bool
 	default y
-	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zicsr_zifencei)
-	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zicsr_zifencei)
+	depends on AS_IS_GNU && AS_VERSION >= 23800
 	help
 	  Newer binutils versions default to ISA spec version 20191213 which
 	  moves some instructions from the I extension to the Zicsr and Zifencei
-- 
2.39.1


       reply	other threads:[~2023-02-23 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230223220546.52879-1-conor@kernel.org>
2023-02-23 22:05 ` Conor Dooley [this message]
2023-02-24 16:32   ` [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only 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=20230223220546.52879-3-conor@kernel.org \
    --to=conor@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=llvm@lists.linux.dev \
    --cc=naresh.kamboju@linaro.org \
    --cc=nathan@kernel.org \
    --cc=palmer@dabbelt.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).