linux - 在 Qemu 上运行的 RISC-V Linux

标签 linux gcc qemu riscv gnu-toolchain

我正在尝试在 Qemu 上运行 RISC-V linux,按照指令:Running 64- and 32-bit RISC-V Linux on QEMU
我已经下载并安装了 RISC-V GNU 编译器工具链

./configure --prefix=/opt/riscv
make linux

当我执行命令时:

make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig

我收到以下错误:

:~/Documents/riscv64-linux/linux$ make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
scripts/Kconfig.include:39: compiler 'riscv64-unknown-linux-gnu-gcc' not found
make[1]: *** [scripts/kconfig/Makefile:73: defconfig] Error 1
make: *** [Makefile:602: defconfig] Error 2

请告诉我如何解决这个问题。

最佳答案

这是标准问题,尝试输入 whereis riscv64-unknown-linux-gnu-gcc 如果没有得到任何结果,请尝试输入 riscv64- 并按 选项卡,您应该会在 CROSS_COMPILE= 后看到需要粘贴的必要前缀。另外,也许您还需要在 ~/.bashrc 或/和 ~/.profile 中添加 PATH 变量以及 riscv-toolchain 的 bin 路径。

构建自己的 Linux 是一项艰巨的任务,也许你应该学习一些有关工具链和构建 Linux 的手册。

riscv toolchain link

关于linux - 在 Qemu 上运行的 RISC-V Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66805107/

相关文章:

mysql - 增加MySQL的缓存能力

MySQL 在两个端口上使用 IPTables - 自访问

c++ - 为什么在不返回值的情况下流出非 void 函数的末尾不会产生编译器错误?

c - 使用 gcc -O2 优化如何解决问题 : pointer pointing nothing and having integer value as -23 in it, 消失了?

c - 内核用户 I/O 应用程序开发

python - 从控制台调用函数作为参数

linux - 构建自定义 Linux Live CD

c++ - OS X Yosemite 中的 gcc 4.9.1 - gcc : warning: couldn’t understand kern. osversion ‘14.0.0'

linux - 让两个 Linux(虚拟)盒子通过串口通话

arm - libvirt qemu-system-arm,错误: XML error: No PCI buses available