在 mac M1 上安装 risc-v 工具

问题描述 投票:0回答:0

在学习 MITS6.081 讲座并完成其实验室时,我想在我的 macbook air13' 上安装 risc-v 工具和 apple m1 silicon。 我遵循这个教程:https://github.com/riscv-software-src/homebrew-riscv。 当我使用命令

brew 安装 riscv-tools

有一个错误似乎是由于无法识别'zifencei'而触发的。错误日志部分如下。它在使用命令“make install”时出现。

> make install
> Last 15 lines from /Users/rain/Library/Logs/Homebrew/riscv-pk/02.make:
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/uart16550.c
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/uart_litex.c
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/finisher.c
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/misaligned_ldst.c
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/flush_icache.c
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/mentry.S
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../machine/fp_asm.S
> riscv64-unknown-elf-gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE    -DBBL_LOGO_FILE=\"bbl_logo_file\" -DMEM_START=0x80000000 -fno-stack-protector -U_FORTIFY_SOURCE -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../util/snprintf.c
> ../machine/flush_icache.c: Assembler messages:
> ../machine/flush_icache.c:4: Error: unrecognized opcode `fence.i', extension `zifencei' required
> make: *** [flush_icache.o] Error 1
> make: *** Waiting for unfinished jobs....
> ../machine/mentry.S: Assembler messages:
> ../machine/mentry.S:93: Error: unrecognized opcode `fence.i', extension `zifencei' required
> make: *** [mentry.o] Error 1
> 
> If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
> https://github.com/riscv-software-src/homebrew-riscv/issues
> 
> These open issues may also help:
> Fix for riscv-pk.rb https://github.com/riscv-software-src/homebrew-riscv/pull/101

我在 github 上发现了一个未解决的问题:https://github.com/riscv-software-src/homebrew-riscv/issues/99。 好像是最近的问题。我不知道“zifencei”是什么意思,因为我对此完全陌生。 顺便说一句,我尝试通过命令安装 riscv 工具

酿造水龙头 riscv/riscv
brew 安装 riscv-tools

当然失败了。我把它改成了命令

brew tap riscv-software-src/riscv
brew 安装 riscv-tools

然后我遇到了我上面提到的问题。

apple-m1 riscv
© www.soinside.com 2019 - 2024. All rights reserved.