skordal / potato

A simple RISC-V processor for use in FPGA designs.
BSD 3-Clause "New" or "Revised" License
256 stars 41 forks source link

hello exmaple make failed #13

Closed bg2d closed 6 years ago

bg2d commented 6 years ago

Hello,

I installed riscv-gnu-toolchain in the following way: git clone --recursive https://github.com/riscv/riscv-gnu-toolchain ./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32d make

After that I tried to build the hello example. I received the following error: cc1: error: requested ABI requires -march to subsume the 'D' extension

How can I fix it?

Thanks, Bogdan D.

skordal commented 6 years ago

Try compiling with -march=rv32i (see TARGET_CFLAGS in common.mk to see which flags are used to compile Potato applications). The Potato processor does not support any extensions, so you have to use the -march flag to prevent the compiler from using instructions the processor does not understand.

If you are running make to compile the example, the -march should already be added to the command line. In that case, you might need to reconfigure the toolchain. Try to build it with ./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32, to prevent the standard libraries from containing code which requires extensions.

bg2d commented 6 years ago

Problem solved. Thank you!