RISC-V GNU Toolchain 源码获取
$git clone https://github.com/riscv/riscv-gnu-toolchain.git
$cd riscv-gnu-toolchain
$git submodule update --init –recursive
相关依赖获取
由于使用 Ubuntu 开发 risc-v 较多,这里以 Ubuntu 为例:
$sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
编译安装
$./configure --prefix=/opt/riscv --enable-multilib
$sudo make linux
$sudo make install
$riscv64-unknown-linux-gnu-gcc -
|