当前位置:网站首页>自己动手写RISC-V的C编译器-00环境配置
自己动手写RISC-V的C编译器-00环境配置
2022-08-11 05:29:00 【YOUNIKOJIAO】
自己动手写RISC-V的C编译器-00环境配置
一直都想写一个编译器,苦于
懒没有时间。正好看到PLCT实验室的大佬开了一个编译器课程。这个假期,将跟着这个课程实现一个完整的RISC-V的编译器
开发环境
操作系统:Ubantu 20.04,这里为了简单起见不涉及编译直接使用老师在群里发的可执行文件包。注意这个可执行文件必须运行在Ubantu 20.04中。不然在使用qemu的时候会因为libc.so.6的版本问题导致运行失败。
实验环境: 以下连接打包了RISC-V实验环境用到的各种可执行文件,包括riscv-gnu-toolchain、spike、pk、qemu、llvm等程序。可执行文件下载地址
配置环境变量
打开~/.bashrc
vim ~/.bashrc
在末尾添加行
export PATH=$HOME/ws/rvcc-sysroot/usr/bin:$PATH
其中ws是我自定的工作文件,你也可以自己定义;rvcc-sysroot这个文件是从压缩包解压出来的文件改的名字,因为原来的名字太长了。
最后使环境生效
source .bashrc
如果输入命令的时候发现找不到,重启一下就好了。
交叉编译的概念
由于开发环境使X86架构的,但是测试程序需要运行RISC-V架构的汇编程序,所以就需要用到交叉编译器。在X86的电脑上编译出可运行在RISC-V计算机上的可执行文件。由于没有开发板,需用使用qemu来模拟RISC-V环境。
边栏推荐
- Jetpack使用异常问题集锦
- js常用方法对象及属性
- mongoose连接mongodb不错,显示encoding没有定义
- mount命令--挂载出现只读,解决方案
- SearchGuard配置
- Use the adb command to manage applications
- Scene-driven feature calculation method OpenMLDB, efficient implementation of "calculate first use"
- Real-time Feature Computing Platform Architecture Methodology and Practice Based on OpenMLDB
- Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain
- 2021-09-11 C language variables and memory allocation
猜你喜欢

Event Preview | On April 23, a number of wonderful sharing sessions of OpenMLDB will come, which will live up to the good time of the weekend

OpenMLDB Pulsar Connector:高效打通实时数据到特征工程

开源机器学习数据库OpenMLDB贡献者计划全面启动

Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain

贡献者任务第三期精彩来袭

He Kaiming's new work ViTDET: target detection field, subverting the concept of layered backbone

JS advanced web page special effects (pink teacher notes)

实时特征计算平台架构方法论和基于 OpenMLDB 的实践

JS进阶网页特效(pink老师笔记)

127.0.0.1 已拒绝连接
随机推荐
厂商推送平台-华为接入
端口的作用
mk file introduction
Day 78
typescript学习日记,从基础到进阶(第二章)
Day 81
栈stack
Day 84
js learning advanced (event senior pink teacher teaching notes)
js常用方法对象及属性
gerrit configure SSH Key and account, email information
Byte (byte) and bit (bit)
Regular expression replacement for batch quick modification code
论文解读:GAN与检测网络多任务/SOD-MTGAN: Small Object Detection via Multi-Task Generative Adversarial Network
The official website of OpenMLDB is upgraded, and the mysterious contributor map will take you to advance quickly
umi约定式路由规则修改
Goldbach's conjecture and the ring of integers
2021-09-11 C语言 变量与内存分配
品优购项目实战笔记
Node 踩坑之80端口被占用