当前位置:网站首页>riscv-gnu-toolchain下载安装
riscv-gnu-toolchain下载安装
2022-08-08 19:25:00 【王万林 Ben】
一、克隆riscv-gnu-toolchain源码
riscv-gnu-toolchain项目在github上,在国内的主机上clone会出现很慢的问题。幸好gitee帮我们想到了这一点,可以从gitee clone下来。
[[email protected] tmp]$ git clone https://gitee.com/mirrors/riscv-gnu-toolchain.git
然后,也需要将submodules也clone下来。但由于这个仓库是从github直接mirror过来的,submodule的配置文件也指向了github地址,直接clone的话也会遇到慢的问题。我们将它修改指向gitee mirror对应的地址。
[[email protected] tmp]$ cd riscv-gnu-toolchain/
[[email protected] riscv-gnu-toolchain]$ sed -i 's#https://github.com/riscv-collab/#https://gitee.com/mirrors/#g' .gitmodules
[[email protected] riscv-gnu-toolchain]$
二、在海外云主机下载
[[email protected] riscv-gnu-toolchain]$ git submodule update --init --recursive #下载submodule
[[email protected] riscv-gnu-toolchain]$ cd riscv-gcc
[[email protected] riscv-gnu-toolchain]$ ./contrib/download_prerequisites #下载编译gcc需要的几个包,如mpfr, gmp, mpc等
三、准备好依赖
来到生产环境,准备好依赖。
先将依赖弄好。
# 查看所有依赖是否有:
echo 'autoconf automake python gawk bison flex texinfo patchutils gcc mpc gmp mpfr zlib expat' | sed -r 's#\s+#\n#g' | xargs -ti csh -c 'module ava {}'
找到对应的modulefile名字,分别执行module load加载上。
四、编译安装
将步骤二的包传到生产环境,执行编译 riscv64-unknow-elf-gcc 的命令。
[[email protected] riscv-gnu-toolchain]$ ./configure --prefix=/tools/oss/riscv64-unknown-elf/2022.06.10
[[email protected] riscv-gnu-toolchain]$ make -j 96 #编译安装
后记
还有几个submodule是外网的,需要手动mirror一下,再指向mirror地址。
参考文档
https://github.com/riscv-collab/riscv-gnu-toolchain/blob/master/README.md#installation-newlib
边栏推荐
猜你喜欢
随机推荐
Codeforces Round #725 (Div. 3)
01. Preface
nyoj714 Card Trick(第六届河南省程序设计大赛)
wps表格怎么复制粘贴后与原来格式一样?
laravel run scheduler command on weekdays (except holidays)
腾讯云原生成本优化平台FinOps Crane荣获国家级大奖!
传统和加密域名概述
5次折戟IPO,互联网家装这条路,没土巴兔想的那么简单
Why do programmers only close monitor from none computer after work?Look at the answer ~ each big web site
USB CY68013设备描述符识别失败
分布式文件系统fastDFS
室外光纤资源管理——可视化管理平台
SSM项目整合——综合案例
期货开户安全吗?期货怎么开户安全?
odoo login layout adjustment
Qt界面优化:Qt窗体控件设置
[极客大挑战 2019]BuyFlag&&[HCTF 2018]admin
计算机网络面试常问知识
shell的各种三角形
卡通渲染的历史