linux/arch/riscv
Aurelien Jarno 6df2a016c0
riscv: fix build with binutils 2.38
From version 2.38, binutils default to ISA spec version 20191213. This
means that the csr read/write (csrr*/csrw*) instructions and fence.i
instruction has separated from the `I` extension, become two standalone
extensions: Zicsr and Zifencei. As the kernel uses those instruction,
this causes the following build failure:

  CC      arch/riscv/kernel/vdso/vgettimeofday.o
  <<BUILDDIR>>/arch/riscv/include/asm/vdso/gettimeofday.h: Assembler messages:
  <<BUILDDIR>>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01'
  <<BUILDDIR>>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01'
  <<BUILDDIR>>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01'
  <<BUILDDIR>>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01'

The fix is to specify those extensions explicitely in -march. However as
older binutils version do not support this, we first need to detect
that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2022-02-10 09:17:01 -08:00
..
boot riscv: dts: sifive unmatched: Add gpio poweroff 2022-01-20 09:37:23 -08:00
configs RISC-V: nommu_virt: Drop unused SLAB_MERGE_DEFAULT 2022-01-20 12:48:14 -08:00
errata riscv: errata: alternative: mark vendor_patch_func __initdata 2022-01-09 11:02:46 -08:00
include bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
kernel riscv: cpu-hotplug: clear cpu from numa map when teardown 2022-02-10 09:16:50 -08:00
kvm RISC-V: Do not use cpumask data structure for hartid bitmap 2022-01-20 09:27:22 -08:00
lib riscv: extable: consolidate definitions 2022-01-05 17:52:47 -08:00
mm riscv: extable: fix err reg writing in dedicated uaccess handler 2022-02-08 17:02:47 -08:00
net riscv: bpf: Fix eBPF's exception tables 2022-01-19 10:50:02 -08:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig RISC-V Patches for the 5.17 Merge Window, Part 2 2022-01-22 09:34:49 +02:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.erratas riscv: enable SiFive errata CIP-453 and CIP-1200 Kconfig only if CONFIG_64BIT=y 2021-05-06 09:40:13 -07:00
Kconfig.socs RISC-V: Add StarFive SoC Kconfig option 2021-11-28 20:03:34 +01:00
Makefile riscv: fix build with binutils 2.38 2022-02-10 09:17:01 -08:00