如何构建RISC-V的交叉编译工具链?

时间:2020-01-06 18:52:41   收藏:0   阅读:300
  1. 创建risc-v目录
    $ mkdir risc-v
    $ cd risc-v
  2. 获取源码
    $ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git
  3. 安装依赖包
    $ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev
    libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev (on ubuntu 18.04)
  4. 编译并安装
    $ cd riscv-gnu-toolchain
    $ ./configure --prefix=/opt/riscv
    $ make (newlib cross-compiler, a generic ELF toolchain, select generic ELF toolchain)
    $ sudo make install
  5. 配置环境变量
    $ export RISCV=/opt/riscv
    $ export PATH=/opt/riscv/bin:$PATH

原文:https://www.cnblogs.com/dakewei/p/12157381.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!