* [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils
@ 2023-07-31 9:59 Mingzheng Xing
2023-07-31 10:06 ` kernel test robot
2023-07-31 14:01 ` Conor Dooley
0 siblings, 2 replies; 5+ messages in thread
From: Mingzheng Xing @ 2023-07-31 9:59 UTC (permalink / raw)
To: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Nathan Chancellor, Nick Desaulniers, Tom Rix
Cc: Bin Meng, linux-riscv, linux-kernel, llvm, stable, Guo Ren,
Mingzheng Xing
Binutils-2.38 and GCC-12.1.0 bumped[0][1] the default ISA spec to the newer
20191213 version which moves some instructions from the I extension to the
Zicsr and Zifencei extensions. So if one of the binutils and GCC exceeds
that version, we should explicitly specifying Zicsr and Zifencei via -march
to cope with the new changes. but this only occurs when binutils >= 2.36
and GCC >= 11.1.0. It's a different story when binutils < 2.36.
binutils-2.36 supports the Zifencei extension[2] and splits Zifencei and
Zicsr from I[3]. GCC-11.1.0 is particular[4] because it add support Zicsr
and Zifencei extension for -march. binutils-2.35 does not support the
Zifencei extension, and does not need to specify Zicsr and Zifencei when
working with GCC >= 12.1.0.
To make our lives easier, let's relax the check to binutils >= 2.36 in
CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. For the other two cases,
where clang < 17 or GCC < 11.1.0, we will deal with them in
CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
For more information, please refer to:
commit 6df2a016c0c8 ("riscv: fix build with binutils 2.38")
commit e89c2e815e76 ("riscv: Handle zicsr/zifencei issues between clang and binutils")
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc [0]
Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd [1]
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a1b31e1e1cee6e9f1c92abff59cdcfff0dddf30 [2]
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=729a53530e86972d1143553a415db34e6e01d5d2 [3]
Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 [4]
Link: https://lore.kernel.org/all/20230308220842.1231003-1-conor@kernel.org
Link: https://lore.kernel.org/all/20230223220546.52879-1-conor@kernel.org
Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn>
---
v3:
- Relax the check to binutils >= 2.36.
- Update the Kconfig help text and commit message.
v2:
- Update the Kconfig help text and commit message.
- Add considerations for low version gcc case.
arch/riscv/Kconfig | 33 ++++++++++++++++----------
arch/riscv/kernel/compat_vdso/Makefile | 8 ++++++-
2 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 4c07b9189c86..2704bd91dfb5 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -570,24 +570,31 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE
config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
def_bool y
# https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc
- 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
- extensions.
+ # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd
+ depends on AS_IS_GNU && AS_VERSION >= 23600
+ help
+ Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer
+ 20191213 version, which moves some instructions from the I extension to
+ the Zicsr and Zifencei extensions. This requires explicitly specifying
+ zicsr and zifencei when binutils >= 2.38 or GCC >= 12.1.0, but this only
+ occurs when binutils >= 2.36 and GCC >= 11.1.0. It's a different story
+ when binutils < 2.36. Also, we have to consider the case of clang paired
+ with binutils.
+ To make our lives easier, we relax the check to binutils >= 2.36. For
+ the other two cases, where clang < 17 or GCC < 11.1.0, we will deal with
+ them in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
def_bool y
depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
# https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
- depends on CC_IS_CLANG && CLANG_VERSION < 170000
- help
- Certain versions of clang do not support zicsr and zifencei via -march
- but newer versions of binutils require it for the reasons noted in the
- help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This
- option causes an older ISA spec compatible with these older versions
- of clang to be passed to GAS, which has the same result as passing zicsr
- and zifencei to -march.
+ # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49
+ depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110100)
+ help
+ Certain versions of clang and GCC do not support zicsr and zifencei via
+ -march. This option causes an older ISA spec compatible with these older
+ versions of clang and GCC to be passed to GAS, which has the same result
+ as passing zicsr and zifencei to -march.
config FPU
bool "FPU support"
diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile
index 189345773e7e..b86e5e2c3aea 100644
--- a/arch/riscv/kernel/compat_vdso/Makefile
+++ b/arch/riscv/kernel/compat_vdso/Makefile
@@ -11,7 +11,13 @@ compat_vdso-syms += flush_icache
COMPAT_CC := $(CC)
COMPAT_LD := $(LD)
-COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32
+# binutils 2.35 does not support the zifencei extension, but in the ISA
+# spec 20191213, G stands for IMAFD_ZICSR_ZIFENCEI.
+ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
+ COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32
+else
+ COMPAT_CC_FLAGS := -march=rv32imafd -mabi=ilp32
+endif
COMPAT_LD_FLAGS := -melf32lriscv
# Disable attributes, as they're useless and break the build.
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils 2023-07-31 9:59 [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils Mingzheng Xing @ 2023-07-31 10:06 ` kernel test robot 2023-07-31 14:01 ` Conor Dooley 1 sibling, 0 replies; 5+ messages in thread From: kernel test robot @ 2023-07-31 10:06 UTC (permalink / raw) To: Mingzheng Xing; +Cc: stable, oe-kbuild-all Hi, Thanks for your patch. FYI: kernel test robot notices the stable kernel rule is not satisfied. Rule: 'Cc: stable@vger.kernel.org' or 'commit <sha1> upstream.' Subject: [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils Link: https://lore.kernel.org/stable/20230731095936.23397-1-xingmingzheng%40iscas.ac.cn The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils 2023-07-31 9:59 [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils Mingzheng Xing 2023-07-31 10:06 ` kernel test robot @ 2023-07-31 14:01 ` Conor Dooley 2023-07-31 15:16 ` Mingzheng Xing 1 sibling, 1 reply; 5+ messages in thread From: Conor Dooley @ 2023-07-31 14:01 UTC (permalink / raw) To: Mingzheng Xing Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers, Tom Rix, Bin Meng, linux-riscv, linux-kernel, llvm, stable, Guo Ren [-- Attachment #1: Type: text/plain, Size: 6685 bytes --] Hey, On Mon, Jul 31, 2023 at 05:59:36PM +0800, Mingzheng Xing wrote: > Binutils-2.38 and GCC-12.1.0 bumped[0][1] the default ISA spec to the newer > 20191213 version which moves some instructions from the I extension to the > Zicsr and Zifencei extensions. So if one of the binutils and GCC exceeds > that version, we should explicitly specifying Zicsr and Zifencei via -march > to cope with the new changes. but this only occurs when binutils >= 2.36 > and GCC >= 11.1.0. It's a different story when binutils < 2.36. > > binutils-2.36 supports the Zifencei extension[2] and splits Zifencei and > Zicsr from I[3]. GCC-11.1.0 is particular[4] because it add support Zicsr > and Zifencei extension for -march. binutils-2.35 does not support the > Zifencei extension, and does not need to specify Zicsr and Zifencei when > working with GCC >= 12.1.0. > > To make our lives easier, let's relax the check to binutils >= 2.36 in > CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. For the other two cases, > where clang < 17 or GCC < 11.1.0, we will deal with them in > CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC. > > For more information, please refer to: > commit 6df2a016c0c8 ("riscv: fix build with binutils 2.38") > commit e89c2e815e76 ("riscv: Handle zicsr/zifencei issues between clang and binutils") > Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc [0] > Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd [1] > Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a1b31e1e1cee6e9f1c92abff59cdcfff0dddf30 [2] > Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=729a53530e86972d1143553a415db34e6e01d5d2 [3] > Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 [4] > Link: https://lore.kernel.org/all/20230308220842.1231003-1-conor@kernel.org > Link: https://lore.kernel.org/all/20230223220546.52879-1-conor@kernel.org > Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn> You need to actually put the CC: stable@vger.kernel.org into the commit message for the stable folks to pick things up. > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 4c07b9189c86..2704bd91dfb5 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -570,24 +570,31 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE > config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI > def_bool y > # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc > - 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 > - extensions. > + # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd > + depends on AS_IS_GNU && AS_VERSION >= 23600 > + help > + Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer > + 20191213 version, which moves some instructions from the I extension to > + the Zicsr and Zifencei extensions. This requires explicitly specifying > + zicsr and zifencei when binutils >= 2.38 or GCC >= 12.1.0, > but this only > + occurs when binutils >= 2.36 and GCC >= 11.1.0. > + It's a different story when binutils < 2.36. I would replace this with something like: Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer 20191213 version, which moves some instructions from the I extension to the Zicsr and Zifencei extensions. This requires explicitly specifying zicsr and zifencei when binutils >= 2.38 or GCC >= 12.1.0. Zicsr and Zifencei are supported in binutils from version 2.36 onwards. To make life easier, and avoid forcing toolchains that default to a newer ISA spec to version 2.2, relax the check to binutils >= 2.36. For clang < 17 or GCC < 11.1.0, for which this is not possible, this is dealt with in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC. I tried to take the personification out of it & hopefully made it a little clearer what dropping the check to 2.36 does for us. > Also, we have to consider the case of clang paired with binutils. I think this sentence can go, its covered in the other config text. I'm sorry for being a bit of a pedant about this, but this has been such a can of worms that I would like things to remain explained well enough that the text is sufficient next time a revisit is required. Thanks, Conor. > + To make our lives easier, we relax the check to binutils >= 2.36. > > config TOOLCHAIN_NEEDS_OLD_ISA_SPEC > def_bool y > depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI > # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16 > - depends on CC_IS_CLANG && CLANG_VERSION < 170000 > - help > - Certain versions of clang do not support zicsr and zifencei via -march > - but newer versions of binutils require it for the reasons noted in the > - help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This > - option causes an older ISA spec compatible with these older versions > - of clang to be passed to GAS, which has the same result as passing zicsr > - and zifencei to -march. > + # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 > + depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110100) > + help > + Certain versions of clang and GCC do not support zicsr and zifencei via > + -march. This option causes an older ISA spec compatible with these older > + versions of clang and GCC to be passed to GAS, which has the same result > + as passing zicsr and zifencei to -march. > > config FPU > bool "FPU support" > diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile > index 189345773e7e..b86e5e2c3aea 100644 > --- a/arch/riscv/kernel/compat_vdso/Makefile > +++ b/arch/riscv/kernel/compat_vdso/Makefile > @@ -11,7 +11,13 @@ compat_vdso-syms += flush_icache > COMPAT_CC := $(CC) > COMPAT_LD := $(LD) > > -COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32 > +# binutils 2.35 does not support the zifencei extension, but in the ISA > +# spec 20191213, G stands for IMAFD_ZICSR_ZIFENCEI. > +ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI > + COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32 > +else > + COMPAT_CC_FLAGS := -march=rv32imafd -mabi=ilp32 > +endif > COMPAT_LD_FLAGS := -melf32lriscv > > # Disable attributes, as they're useless and break the build. > -- > 2.34.1 > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils 2023-07-31 14:01 ` Conor Dooley @ 2023-07-31 15:16 ` Mingzheng Xing 2023-07-31 15:18 ` Conor Dooley 0 siblings, 1 reply; 5+ messages in thread From: Mingzheng Xing @ 2023-07-31 15:16 UTC (permalink / raw) To: Conor Dooley Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers, Tom Rix, Bin Meng, linux-riscv, linux-kernel, llvm, stable, Guo Ren On 7/31/23 22:01, Conor Dooley wrote: > Hey, > > On Mon, Jul 31, 2023 at 05:59:36PM +0800, Mingzheng Xing wrote: >> Binutils-2.38 and GCC-12.1.0 bumped[0][1] the default ISA spec to the newer >> 20191213 version which moves some instructions from the I extension to the >> Zicsr and Zifencei extensions. So if one of the binutils and GCC exceeds >> that version, we should explicitly specifying Zicsr and Zifencei via -march >> to cope with the new changes. but this only occurs when binutils >= 2.36 >> and GCC >= 11.1.0. It's a different story when binutils < 2.36. >> >> binutils-2.36 supports the Zifencei extension[2] and splits Zifencei and >> Zicsr from I[3]. GCC-11.1.0 is particular[4] because it add support Zicsr >> and Zifencei extension for -march. binutils-2.35 does not support the >> Zifencei extension, and does not need to specify Zicsr and Zifencei when >> working with GCC >= 12.1.0. >> >> To make our lives easier, let's relax the check to binutils >= 2.36 in >> CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. For the other two cases, >> where clang < 17 or GCC < 11.1.0, we will deal with them in >> CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC. >> >> For more information, please refer to: >> commit 6df2a016c0c8 ("riscv: fix build with binutils 2.38") >> commit e89c2e815e76 ("riscv: Handle zicsr/zifencei issues between clang and binutils") >> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc [0] >> Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd [1] >> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a1b31e1e1cee6e9f1c92abff59cdcfff0dddf30 [2] >> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=729a53530e86972d1143553a415db34e6e01d5d2 [3] >> Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 [4] >> Link: https://lore.kernel.org/all/20230308220842.1231003-1-conor@kernel.org >> Link: https://lore.kernel.org/all/20230223220546.52879-1-conor@kernel.org >> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn> > You need to actually put the CC: stable@vger.kernel.org into the commit > message for the stable folks to pick things up. Thanks. Fixed in next version. >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index 4c07b9189c86..2704bd91dfb5 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -570,24 +570,31 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE >> config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI >> def_bool y >> # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc >> - 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 >> - extensions. >> + # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd >> + depends on AS_IS_GNU && AS_VERSION >= 23600 >> + help >> + Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer >> + 20191213 version, which moves some instructions from the I extension to >> + the Zicsr and Zifencei extensions. This requires explicitly specifying >> + zicsr and zifencei when binutils >= 2.38 or GCC >= 12.1.0, >> but this only >> + occurs when binutils >= 2.36 and GCC >= 11.1.0. >> + It's a different story when binutils < 2.36. > I would replace this with something like: > Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer > 20191213 version, which moves some instructions from the I extension to > the Zicsr and Zifencei extensions. This requires explicitly specifying > zicsr and zifencei when binutils >= 2.38 or GCC >= 12.1.0. Zicsr > and Zifencei are supported in binutils from version 2.36 onwards. > To make life easier, and avoid forcing toolchains that default to a > newer ISA spec to version 2.2, relax the check to binutils >= 2.36. > For clang < 17 or GCC < 11.1.0, for which this is not possible, this is > dealt with in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC. > > I tried to take the personification out of it & hopefully made it a > little clearer what dropping the check to 2.36 does for us. > >> Also, we have to consider the case of clang paired with binutils. > I think this sentence can go, its covered in the other config text. > > I'm sorry for being a bit of a pedant about this, but this has been such > a can of worms that I would like things to remain explained well enough > that the text is sufficient next time a revisit is required. Thanks for your review, I've made the changes and submitted a new PATCH but there seems to be an email thread issue, hopefully it won't have an effect, sorry about that. :) Thanks, Mingzheng. > > Thanks, > Conor. > >> + To make our lives easier, we relax the check to binutils >= 2.36. > >> config TOOLCHAIN_NEEDS_OLD_ISA_SPEC >> def_bool y >> depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI >> # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16 >> - depends on CC_IS_CLANG && CLANG_VERSION < 170000 >> - help >> - Certain versions of clang do not support zicsr and zifencei via -march >> - but newer versions of binutils require it for the reasons noted in the >> - help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This >> - option causes an older ISA spec compatible with these older versions >> - of clang to be passed to GAS, which has the same result as passing zicsr >> - and zifencei to -march. >> + # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49 >> + depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110100) >> + help >> + Certain versions of clang and GCC do not support zicsr and zifencei via >> + -march. This option causes an older ISA spec compatible with these older >> + versions of clang and GCC to be passed to GAS, which has the same result >> + as passing zicsr and zifencei to -march. >> >> config FPU >> bool "FPU support" >> diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile >> index 189345773e7e..b86e5e2c3aea 100644 >> --- a/arch/riscv/kernel/compat_vdso/Makefile >> +++ b/arch/riscv/kernel/compat_vdso/Makefile >> @@ -11,7 +11,13 @@ compat_vdso-syms += flush_icache >> COMPAT_CC := $(CC) >> COMPAT_LD := $(LD) >> >> -COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32 >> +# binutils 2.35 does not support the zifencei extension, but in the ISA >> +# spec 20191213, G stands for IMAFD_ZICSR_ZIFENCEI. >> +ifdef CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI >> + COMPAT_CC_FLAGS := -march=rv32g -mabi=ilp32 >> +else >> + COMPAT_CC_FLAGS := -march=rv32imafd -mabi=ilp32 >> +endif >> COMPAT_LD_FLAGS := -melf32lriscv >> >> # Disable attributes, as they're useless and break the build. >> -- >> 2.34.1 >> >> >> _______________________________________________ >> linux-riscv mailing list >> linux-riscv@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils 2023-07-31 15:16 ` Mingzheng Xing @ 2023-07-31 15:18 ` Conor Dooley 0 siblings, 0 replies; 5+ messages in thread From: Conor Dooley @ 2023-07-31 15:18 UTC (permalink / raw) To: Mingzheng Xing Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou, Nathan Chancellor, Nick Desaulniers, Tom Rix, Bin Meng, linux-riscv, linux-kernel, llvm, stable, Guo Ren [-- Attachment #1: Type: text/plain, Size: 337 bytes --] On Mon, Jul 31, 2023 at 11:16:14PM +0800, Mingzheng Xing wrote: > > Thanks for your review, I've made the changes and submitted a > new PATCH but there seems to be an email thread issue, > hopefully it won't have an effect, sorry about that. Is there? It seemed fine to me, apart from the missing v4, was about to take a look. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-31 15:18 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-31 9:59 [PATCH v3] riscv: Handle zicsr/zifencei issue between gcc and binutils Mingzheng Xing 2023-07-31 10:06 ` kernel test robot 2023-07-31 14:01 ` Conor Dooley 2023-07-31 15:16 ` Mingzheng Xing 2023-07-31 15:18 ` Conor Dooley
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox