1、gcc下载地址
我下载为windows下的压缩包,解压即用。
2、推荐相关教程
3、小坑二个
在编译hello world过程中发现如下报错:
exit.c:(.text.exit+0x1e):undefined reference to '_exit'
参考此篇文章后,添加编译参数即可:
--specs=nosys.specs
如
.\riscv-none-embed-gcc.exe -o bin .\test.c -march=rv32i -mabi=ilp32 --specs=nosys.specs
在编译无main的汇编代码时,如出现如下报错
(.text+0x32): undefined reference to `main'
则加入如下参数即可
-nostartfiles