搭建君正平台的交叉编译环境
前言
君正提供了简单易用的Manhattan编译系统,可以一键式完成编译。但简单易用的同时也意味着灵活性稍微欠佳,对于需要使用其他工具链,或者是更习惯于传统开发方式的开发者来说可能会存在一些不便。本文将介绍的是按照传统方式搭建用于君正平台的交叉编译环境。
交叉编译工具链
文中所用交叉编译工具链为君正提供的交叉编译工具链r3.2.1版,基于Binutils-2.25、GCC-5.2、Glibc-2.22以及UClibc-0.9.33,支持君正MXU和MXU2指令集。
部署工具链
本文档将指导开发者部署并测试交叉编译工具链,文中默认工具链存放路径为“~/Ingenic/toolchain”。
1. 设置环境变量
执行以下命令:
export PATH=~/Ingenic/toolchain/bin:$PATH
然后即可使用mips-linux-gnu-gcc和mips-linux-gnu-g++来编译程序。
2. 测试工具链
创建helloworld.c文件,内容如下
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}
然后执行以下命令
mips-linux-gnu-gcc -O2 -o helloworld helloworld.c
如果能正常完成编译,则说明工具链可以正常使用。
———————————————以下是英文版————————————————
Preface
Ingenic provides a simple and easy-to-use Manhattan compilation system. However, the ease of use also means that the flexibility is slightly less, and there may be some inconvenience for developers who need to use other toolchains or are more accustomed to traditional development methods. This document will introduce the configuration of the cross-compilation environment for the Ingenic platform in the traditional way.
Cross-compile toolchain
Ingenic cross-compile toolchain r3.2.1 version, based on Binutils-2.25, GCC-5.2, Glibc-2.22 and UClibc-0.9.33, supports Ingenic MXU and MXU2 instruction set.
Deploy the toolchain
This document will guide developers to deploy and test the cross-compile toolchain. In this document, it is by default that the storage path of the toolchain is "~/Ingenic/toolchain".
1. Set PATH environment variable
Run the following command:
export PATH=~/Ingenic/toolchain/bin:$PATH
Now you can use the mips-linux-gnu-gcc and mips-linux-gnu-g++ to compile programs.
2. Test the toolchain
Create a helloworld.c file with the following contains:
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}
Then build it:
mips-linux-gnu-gcc -O2 -o helloworld helloworld.c
If helloworld can be built correctly, it shows that the toolchain has been deployed properly and can be used normally.
- 分享
- 举报
-
浏览量:4394次2020-08-11 10:39:44
-
浏览量:6571次2020-08-10 19:44:10
-
浏览量:12110次2020-12-15 19:07:24
-
浏览量:3326次2018-01-30 11:43:55
-
浏览量:2532次2020-07-28 10:56:05
-
浏览量:4667次2020-04-23 20:06:57
-
浏览量:620次2024-01-26 14:05:49
-
浏览量:1733次2022-01-02 09:00:13
-
浏览量:1683次2022-01-07 09:00:13
-
浏览量:2526次2017-11-20 12:34:12
-
浏览量:5340次2019-12-28 10:33:46
-
浏览量:3214次2017-11-21 13:53:36
-
浏览量:1916次2022-01-19 09:00:17
-
浏览量:2229次2022-01-08 09:00:12
-
浏览量:9413次2020-11-26 16:37:03
-
浏览量:7668次2021-03-02 19:11:24
-
浏览量:3387次2020-07-28 19:20:20
-
浏览量:510次2024-01-11 17:50:15
-
浏览量:2153次2018-06-27 17:06:49
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
Ancients
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明