1

I use the 11.1.0 version of the riscv64-unknown-elf-gcc tool to compile the c code, and now there is a need to turn off RVC, how do I do this?

gccrv64e -march=rv64imafd arch-fib.c -o arch-fib

I tried to block RVC using the following command, but failed. The disassembly result still has RVC instructions.

Is there any way I can remove RVC during the compilation process?

  • Does this answer your question? [How to forbid the riscv compressed codes?](https://stackoverflow.com/questions/43704690/how-to-forbid-the-riscv-compressed-codes) – Erik Eidt Nov 01 '21 at 21:15

1 Answers1

0

There is two reasons of that:

  1. You compiled toolchain with compressed enabled, and when you look in dissassembly, you see compressed instructions of crt0 file, and you think that C extension won't disable. Look int main function and you will see it have no Compressed instructions.

  2. You incorrectly compiled toolchain (idk how, but this possible, i ran into this once), and toolchain still add RVC even if you use flag rv64g or any other without RVC. Try to type riscv64-unknown-elf-gcc -v and watch your configured build.

Alexy Khilaev
  • 415
  • 3
  • 13