riscv-gcc for Windows

daupos2t  于 5个月前  发布在  Windows
关注(0)|答案(2)|浏览(54)

我想在Windows 7/8/10 32位或64位下使用riscv-gcc。我从https://github.com/riscv/riscv-gcc下载了源文件,我多次尝试使用MinGW构建riscv-gcc,每次我都得到一个错误,然后我试图删除该错误,但在下一次构建尝试中,我得到了另一个错误(以下是一个小列表:
第一章

c:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/hashtab.c: In function 'hash_pointer': 
c:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/hashtab.c:202:24: error: 'intptr_t' undeclared (first use in this function)
   return (hashval_t) ((intptr_t)p >> 3);

字符串
(二)

c:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/hashtab.c:418:64: error: 'free' undeclared (first use in this function)
   return htab_create_alloc (size, hash_f, eq_f, del_f, calloc, free);


第三章

:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/fibheap.c:38:24: error: 'LONG_MIN' undeclared (first use in this function)
 #define FIBHEAPKEY_MIN LONG_MIN


四、

c:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/unlink-if-ordinary.c: In function 'unlink_if_ordinary':
c:/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/unlink-if-ordinary.c:65:15: error: storage size of 'st' isn't known
   struct stat st;


第五章)

up.c:gcc -c -DHAVE_CONFIG_H -g -O2 -D__USE_MINGW_ACCESS  -I. -I/c/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-co pat -Wstrict-prototypes -pedantic  /c/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/sort.c -o sort.o3
:3: warningcc -c -DHAVE_CONFIG_H -g -O2 -D__USE_MINGW_ACCESS  -I. -I/c/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc +-compat -Wstrict-prototypes -pedantic  /c/mingw/build/riscv-gcc/binutils-2.21.1/libiberty/xstrerror.c -o xstrerror.og
 implicit declaration of function 'strlen' [-Wimplicimake[3]: t*** [unlink-if-ordinary.o] Error 1


我不是一个“Linux的家伙”,我只是想有一个Windows兼容的工具链,在我的FPGA项目中使用RISC-V软核。有没有人已经有了Windows的riscv-gcc?非常感谢!
我已经完成了一些实验,我的结论是:-如果你的唯一目标是在FPGA中使用RISC-V(或MIPS),而你不想与Linux有任何交易,最好的解决方案是FPGA Arduino http://www.nxlab.fer.hr/fpgarduino/我用Xilinx Spartan-3AN Starter Kit测试了它,并成功地将其移植到定制的Spartan-6板上。

3j86kqsm

3j86kqsm1#

我建议,如果你使用的是Windows 10,那么你可以注册预览版,然后你可以获得Linux的Windows子系统。我已经能够使用它来下载和构建riscv工具链,使用riscv.org网站上提供的说明。

7gcisfzg

7gcisfzg2#

xpack-dev-tools有一个riscvgcc的包,用于几个不同的操作系统。
参见https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/
我目前正在考虑在Windows PC上使用此软件包与VS Code来开发在VisionFive 2 RISC-V SBC上运行的C/C++程序。我很好奇我是否可以在SBC上使用WINE并编译Windows程序,然后在WINE下在SBC上运行。
我找到了这个VS代码页,https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools,它有一些编译器的链接。
参见https://stackoverflow.com/a/56622710/1466970
我一直在做的是在一台安装了riscv gcc工具链的Windows 11 PC上运行Windows Subsystem for Linux(WSL),然后交叉编译可以在VisionFive 2上运行的应用程序。
我使用了VisionFive 2的制造商StarFive的GitHub源代码,在WSL的Ubuntu会话上构建了两个不同版本的Linux内核,然后在Windows下使用Raspberry Pi Imager应用程序创建了一个可引导的SD卡。我还使用它为USB WiFi适配器编译了一个设备驱动程序,然后在VisionFive 2上使用。

相关问题