LoginSignup
0
0

More than 3 years have passed since last update.

Mac に RISC-V の開発環境構築

Last updated at Posted at 2020-11-18

Mac に RISC-V Toolchain をインストール

Mac に RISC-V の クロスコンパイラ等が含まれる、RISC-V Toolchain をインストールする。

インストール

homebrew をインストールする。

homebrew は大抵の人が入れていると思うのでここはスキップ。

tap する

$ brew tap riscv/riscv
  • tap について
    • 公式ではないリポジトリをHomebrewに追加するもの。
    • install, uninstall, update ができるようになる。
    • github で <user>/homebrew-hoge となっているリポジトリは brew tap <user>/hoge で tapできる。

ToolChain をインストールする

64bit だけでいい人

# brew install riscv-tools

32bit も欲しい人

# brew install riscv-gnu-toolchain --with-multilib

アップデート

  • アップデートは以下のコマンド brew reinstall --build-from-source riscv-gnu-toolchain

インストールでエラーが出ました

fatal: Needed a single revision
Unable to find current revision in submodule path 'qemu/roms/u-boot'
Failed to recurse into submodule path 'qemu'
Error: Failed to download resource "riscv-gnu-toolchain"
Failure while executing; `git submodule update --init --recursive` exited with 1. Here's the output:
fatal: Needed a single revision
Unable to find current revision in submodule path 'qemu/roms/u-boot'
Failed to recurse into submodule path 'qemu'
  • とりあえずqemuを削除してもう一回手動でやってみる
$ cd ~/Library/Caches/Homebrew/riscv-gnu-toolchain--git
$ rm -rf qemu
$ git submodule update --init --recursive
$ brew install riscv-gnu-toolchain --with-multilib

できた

Big Sur の人

エラーが出て make に失敗します!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0