制作交叉工具链(龙芯)

2024-04-21 13:58
文章标签 工具 制作 龙芯 交叉

本文主要是介绍制作交叉工具链(龙芯),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

系统环境:ubuntu10.04 + gcc-4.3.3

所需软件:
Binutils 2.20: http://ftp.gnu.org/gnu/binutils/binutils-2.20.tar.bz2
GCC Core 4.4.2: http://ftp.gnu.org/gnu/gcc/gcc-4.4.2/gcc-core-4.4.2.tar.bz2 

Binutils 2.20 Loongson2f 补丁 binutils-2.20-loongson2f.zip   

设置环境变量和新建目录

$ mkdir -p /opt/loongson-cross-tools/usr/{bin, lib, share}

$ echo "PATH=$PATH:/opt/loongson-cross-tools/usr/bin" >> ~/.bashrc

编译 Binutils: 

$ tar xjf binutils-2.20.tar.bz2

$ cd binutils-2.20

$ patch -Np1 -i ../binutils-2.20-loongson2f.patch   //这步没做,没有找到patch

$ cd .. && mkdir binutils-build && cd binutils-build

$ ../binutils-2.20/configure --prefix=/opt/loongson-cross-tools/usr --target=mipsel-pc-linux-gnu --with-sysroot=/opt/loongson-cross-tools --enable-64-bit-bfd --disable-nls --enable-shared

$ make configure-host

$ make

$ make install

出错信息:

        rm -rf $backupdir; exit $rc

WARNING: `makeinfo' is missing on your system.  You should only need it if

         you modified a `.texi' or `.texinfo' file, or any other file

         indirectly affecting the aspect of the manual.  The spurious

         call might also be the consequence of using a buggy `make' (AIX,

         DU, IRIX).  You might want to install the `Texinfo' package or

         the `GNU make' package.  Grab either from any GNU archive site.

make[4]: *** [as.info] Error 1

make[4]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas/doc'

make[3]: *** [install-am] Error 2

make[3]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas/doc'

Making install in po

make[3]: Entering directory `/home/loongson/loongson-cross-tool/binutils-build/gas/po'

make[3]: Nothing to be done for `install'.

make[3]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas/po'

make[3]: Entering directory `/home/loongson/loongson-cross-tool/binutils-build/gas'

make[4]: Entering directory `/home/loongson/loongson-cross-tool/binutils-build/gas'

/bin/bash ../../binutils-2.20/gas/../mkinstalldirs /opt/loongson-cross-tools/usr/bin

 /bin/bash ./libtool  --mode=install /usr/bin/install -c as-new /opt/loongson-cross-tools/usr/bin/mipsel-pc-linux-gnu-as

libtool: install: /usr/bin/install -c .libs/as-new /opt/loongson-cross-tools/usr/bin/mipsel-pc-linux-gnu-as

/bin/bash ../../binutils-2.20/gas/../mkinstalldirs /opt/loongson-cross-tools/usr/mipsel-pc-linux-gnu/bin

n=`echo as | sed 's&^&mipsel-pc-linux-gnu-&'`; \

        if [ "/opt/loongson-cross-tools/usr/bin/$n" != "/opt/loongson-cross-tools/usr/mipsel-pc-linux-gnu/bin/as" ]; then \

          rm -f /opt/loongson-cross-tools/usr/mipsel-pc-linux-gnu/bin/as; \

          ln /opt/loongson-cross-tools/usr/bin/$n /opt/loongson-cross-tools/usr/mipsel-pc-linux-gnu/bin/as >/dev/null 2>/dev/null \

            || /bin/bash ./libtool --mode=install /usr/bin/install -c as-new /opt/loongson-cross-tools/usr/mipsel-pc-linux-gnu/bin/as; \

        else \

          true ; \

        fi

make[4]: Nothing to be done for `install-data-am'.

make[4]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas'

make[3]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas'

make[2]: *** [install-recursive] Error 1

make[2]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build/gas'

make[1]: *** [install-gas] Error 2

make[1]: Leaving directory `/home/loongson/loongson-cross-tool/binutils-build'

make: *** [install] Error 2

参考解决办法:

原因是本机没有安装texinfo,安装之后版本也不够高,顾修改configure文件

$ sudo apt-get install texinfo

$ makeinfo --version

makeinfo (GNU texinfo) 4.13

$ vim ../binuitl-2.20/configure

改成:

$ make install

编译 GCC: 

$ tar xjf gcc-core-4.4.2.tar.bz2

$ mkdir gcc-build  && cd gcc-build

$ ../gcc-4.4.2/configure --prefix=/opt/loongson-cross-tools/usr --target=mipsel-pc-linux-gnu --with-sysroot=/opt/loongson-cross-tools --disable-multilib --with-newlib --disable-nls --disable-shared --disable-threads --enable-languages=c --with-abi=64

出错信息:

configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.

Try the --with-gmp and/or --with-mpfr options to specify their locations.

Copies of these libraries' source code can be found at their respective

hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.

See also http://gcc.gnu.org/install/prerequisites.html for additional info.

If you obtained GMP and/or MPFR from a vendor distribution package, make

sure that you have installed both the libraries and the header files.

They may be located in separate packages.

参考解决办法:

http://ftp.gnu.org/gnu/gmp/   #gmp下载

http://ftp.gnu.org/gnu/mpfr/  #mpfr下载

$ tar xf tar xf gmp-5.0.1.tar.bz2

$ tar xf mpfr-3.0.0.tar.bz2

$ mv gmp-5.0.1/ gmp 

$ mv mpfr-3.0.0/ mpfr 

$ mv gmp/ mpfr/ gcc-4.4.2/

$ cd gcc-build

$ ../gcc-4.4.2/configure --prefix=/opt/loongson-cross-tools/usr --target=mipsel-pc-linux-gnu --with-sysroot=/opt/loongson-cross-tools --disable-multilib --with-newlib --disable-nls --disable-shared --disable-threads --enable-languages=c --with-abi=64

$ make all-gcc

出错信息:

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... no

checking whether to build static libraries... yes

checking whether gcc __attribute__ ((mode (XX))) works... yes

checking for recent GMP... yes

checking for gmp internal files... configure: error: header files gmp-impl.h and longlong.h not found

make: *** [configure-mpfr] Error 1

参考解决办法:

mpfr3.0mpfr2.4.2

因为mpfr3.0改了默认路径(网上如此说)

$ tar xf mpfr-2.4.2.tar.bz2

$ mv mpfr-2.4.2/ mpfr 

$ rm gcc-4.4.2/mpfr

$ mv mpfr gcc-4.4.2

$ make all-gcc

$ make all-target-libgcc

$ make install-gcc

$ make install-target-libgcc

参考资料:

https://heiher.info/916.html

http://www.linuxsir.org/bbs/showthread.php?t=338748

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44455

http://blog.sina.com.cn/s/blog_4e9da0010100dhvk.html

<script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/buttonLite.js#style=-1&uuid=&pophcol=3&lang=zh"></script> <script type=text/javascript charset=utf-8 src="http://static.bshare.cn/b/bshareC0.js"></script>
阅读(356) | 评论(0) | 转发(0) |
0

上一篇:RGB24和YUV420旋转90度的源代码

下一篇:VC调试心得

相关热门文章
  • SecureCRT破解注意
  • PHP Extension开发基础
  • 安全全面可靠
  •   研究推进政府向社会力量购...
  • 【读者报料】
  • 承接自动化测试培训、外包、实...
  • Solaris PowerTOP 1.0 发布
  • For STKMonitor
  • busybox的httpd使用CGI脚本(Bu...
  • 项目小体会
  • 修改默认端口为222,centos自...
  • 用PHP做一个ftp登录页面...
  • Toad for Oracle工具,为什么在...
  • 本地win7安装vmw9系统winserv...
  • powermt config是所什么用的...
给主人留下些什么吧!~~
评论热议

这篇关于制作交叉工具链(龙芯)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/923257

相关文章

MySQL慢查询工具的使用小结

《MySQL慢查询工具的使用小结》使用MySQL的慢查询工具可以帮助开发者识别和优化性能不佳的SQL查询,本文就来介绍一下MySQL的慢查询工具,具有一定的参考价值,感兴趣的可以了解一下... 目录一、启用慢查询日志1.1 编辑mysql配置文件1.2 重启MySQL服务二、配置动态参数(可选)三、分析慢查

基于Python实现进阶版PDF合并/拆分工具

《基于Python实现进阶版PDF合并/拆分工具》在数字化时代,PDF文件已成为日常工作和学习中不可或缺的一部分,本文将详细介绍一款简单易用的PDF工具,帮助用户轻松完成PDF文件的合并与拆分操作... 目录工具概述环境准备界面说明合并PDF文件拆分PDF文件高级技巧常见问题完整源代码总结在数字化时代,PD

Python按照24个实用大方向精选的上千种工具库汇总整理

《Python按照24个实用大方向精选的上千种工具库汇总整理》本文整理了Python生态中近千个库,涵盖数据处理、图像处理、网络开发、Web框架、人工智能、科学计算、GUI工具、测试框架、环境管理等多... 目录1、数据处理文本处理特殊文本处理html/XML 解析文件处理配置文件处理文档相关日志管理日期和

使用Python开发一个Ditto剪贴板数据导出工具

《使用Python开发一个Ditto剪贴板数据导出工具》在日常工作中,我们经常需要处理大量的剪贴板数据,下面将介绍如何使用Python的wxPython库开发一个图形化工具,实现从Ditto数据库中读... 目录前言运行结果项目需求分析技术选型核心功能实现1. Ditto数据库结构分析2. 数据库自动定位3

基于Python实现简易视频剪辑工具

《基于Python实现简易视频剪辑工具》这篇文章主要为大家详细介绍了如何用Python打造一个功能完备的简易视频剪辑工具,包括视频文件导入与格式转换,基础剪辑操作,音频处理等功能,感兴趣的小伙伴可以了... 目录一、技术选型与环境搭建二、核心功能模块实现1. 视频基础操作2. 音频处理3. 特效与转场三、高

基于Python开发一个图像水印批量添加工具

《基于Python开发一个图像水印批量添加工具》在当今数字化内容爆炸式增长的时代,图像版权保护已成为创作者和企业的核心需求,本方案将详细介绍一个基于PythonPIL库的工业级图像水印解决方案,有需要... 目录一、系统架构设计1.1 整体处理流程1.2 类结构设计(扩展版本)二、核心算法深入解析2.1 自

Python办公自动化实战之打造智能邮件发送工具

《Python办公自动化实战之打造智能邮件发送工具》在数字化办公场景中,邮件自动化是提升工作效率的关键技能,本文将演示如何使用Python的smtplib和email库构建一个支持图文混排,多附件,多... 目录前言一、基础配置:搭建邮件发送框架1.1 邮箱服务准备1.2 核心库导入1.3 基础发送函数二、

基于Python实现一个图片拆分工具

《基于Python实现一个图片拆分工具》这篇文章主要为大家详细介绍了如何基于Python实现一个图片拆分工具,可以根据需要的行数和列数进行拆分,感兴趣的小伙伴可以跟随小编一起学习一下... 简单介绍先自己选择输入的图片,默认是输出到项目文件夹中,可以自己选择其他的文件夹,选择需要拆分的行数和列数,可以通过

Python使用pip工具实现包自动更新的多种方法

《Python使用pip工具实现包自动更新的多种方法》本文深入探讨了使用Python的pip工具实现包自动更新的各种方法和技术,我们将从基础概念开始,逐步介绍手动更新方法、自动化脚本编写、结合CI/C... 目录1. 背景介绍1.1 目的和范围1.2 预期读者1.3 文档结构概述1.4 术语表1.4.1 核

Python使用OpenCV实现获取视频时长的小工具

《Python使用OpenCV实现获取视频时长的小工具》在处理视频数据时,获取视频的时长是一项常见且基础的需求,本文将详细介绍如何使用Python和OpenCV获取视频时长,并对每一行代码进行深入解析... 目录一、代码实现二、代码解析1. 导入 OpenCV 库2. 定义获取视频时长的函数3. 打开视频文