0

I was trying to build the kernel from the linux repo v5.12 to set up an image for the qemu emulator and I keep getting this error

./arch/riscv/include/asm/irqflags.h: Assembler messages:
./arch/riscv/include/asm/irqflags.h:28: Error: unrecognized opcode `csrc 0x100,2', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:16: Error: unrecognized opcode `csrr a5,0x100', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:28: Error: unrecognized opcode `csrc 0x100,2', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:16: Error: unrecognized opcode `csrr a5,0x100', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:22: Error: unrecognized opcode `csrs 0x100,2', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:16: Error: unrecognized opcode `csrr a5,0x100', extension `zicsr' required
./arch/riscv/include/asm/irqflags.h:22: Error: unrecognized opcode `csrs 0x100,2', extension `zicsr' required

Any help on how to fix this?

I ran make ARCH=riscv CROSS_COMPILE=riscv32-unknown-linux-gnu- to compile the kernel using the cross compiler

Jonas
  • 121,568
  • 97
  • 310
  • 388
  • 1
    what configuration did you use? I tried the same after using a default configuration with `make rv32_defconfig ARCH=riscv CROSS_COMPILE=riscv32-unknown-linux-gnu-` and it worked – EmilioPeJu Apr 22 '23 at 22:40
  • I did deconfig too. I ran the command ```make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig``` – kidusworkneh Apr 23 '23 at 15:25
  • Your last comment shows a tool-chain for riscv 64 bit, while your post shows riscv 32 bit, did you mix both by accident? – EmilioPeJu Apr 23 '23 at 18:27
  • I am sorry. I used the riscv32 bit toolchain when I was getting the above error. I did ```make ARCH=riscv CROSS_COMPILE=riscv32-unknown-linux-gnu- defconfig```. The last comment was incorrect. – kidusworkneh Apr 24 '23 at 17:39
  • HI, I am facing the same issue with riscv64, did this get resolved ? Thanks – Bhawandeep Singh May 10 '23 at 17:59
  • I don't remember facing this issue when building riscv64. But I couldn't resolve the issue for riscv32 – kidusworkneh May 22 '23 at 17:32

0 Answers0