搭建君正平台的交叉编译环境

Ancients 2020-08-14 14:05:35 7104

前言

君正提供了简单易用的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.

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
Ancients
红包 3 3 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
Ancients
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区