1、开发平台

虚拟机:VMware 12

操作系统:Ubuntu 14.04 64bit

2、准备ARM交叉编译工具包

编译uboot和linux kernel都需要ARM交叉工具链支持,这里使用Linaro提供的交叉编译工具。下载地址为:http://releases.linaro.org/

注意:如果主机是64bit,请选择64位的交叉编译器工具链,32bit的主机选择32位的交叉工具链。

The Linaro Toolchain Working Group is pleased to announce this quarter’s release of the Linaro Toolchain Binaries, a pre-built version of Linaro GCC and Linaro GDB that runs on generic Linux or Windows and targets the glibc Linaro Engineering Build.

Beginning 2014.11, Linaro is changing the layout and structure of its prebuilt toolchain binary releases. 2014.11 is the first release built with ABE, adding more maintainable code base and automatic testing. For further details on ABE, please visit https://wiki.linaro.org/ABE.

The folder names above describe the target triplets, i.e. the system on which you want your programs/applications to run. For more details on triplets, please click here.

Inside each folder is also a manifest.txt file further describing the target and host systems meant for the toolchain, plus source component versions.

Essentially, the main folder contents are as follows:

aarch64-linux-gnu

·        gcc-linaro-*x86_64_aarch64-linux-gnu.tar.xz

o   Linux 64-bit binaries for the Aarch64 Linux cross-toolchain

·        gcc-linaro-*i686-mingw32_aarch64-linux-gnu.tar.xz

o   Windows 32-bit binaries for the Aarch64 Linux cross-toolchain

aarch64-none-elf

·        gcc-linaro-*x86_64_aarch64-elf.tar.xz

o   Linux 64-bit binaries for the Aarch64 bare-metal cross-toolchain

·        gcc-linaro-*i686-mingw32_aarch64-elf.tar.xz

o   Windows 32-bit binaries for the Aarch64 bare-metal cross-toolchain

aarch64_be-linux-gnu

·        gcc-linaro-*x86_64_aarch64_be-linux-gnu.tar.xz

o   Linux 64-bit binaries for the Aarch64 Linux Big Endian cross-toolchain

·        gcc-linaro-*i686-mingw32_aarch64_be-linux-gnu.tar.xz

o   Windows 32-bit binaries for the Aarch64 Linux Big Endian cross-toolchain

aarch64_be-none-elf

·        gcc-linaro-*x86_64_aarch64_be-elf.tar.xz

o   Linux 64-bit binaries for the Aarch64 bare-metal Big Endian cross-toolchain

·        gcc-linaro-*i686-mingw32_aarch64_be-elf.tar.xz

o   Windows 32-bit binaries for the Aarch64 bare-metal Big Endian cross-toolchain

arm-linux-gnueabi

·        gcc-linaro-*x86_64_arm-linux-gnueabi.tar.xz

o   Linux 64-bit binaries for the ARMv7 Linux soft float cross-toolchain

·        gcc-linaro-*i686-mingw32_arm-linux-gnueabi.tar.xz

o   Windows 32-bit binaries for the ARMv7 Linux soft float cross-toolchain

arm-linux-gnueabihf

·        gcc-linaro-*x86_64_arm-linux-gnueabihf.tar.xz

o   Linux 64-bit binaries for the ARMv7 Linux hard float cross-toolchain

·        gcc-linaro-*i686-mingw32_arm-linux-gnueabihf.tar.xz

o   Windows 32-bit binaries for the ARMv7 Linux hard float cross-toolchain

arm-none-eabi

·        gcc-linaro-*x86_64_arm-eabi.tar.xz

o   Linux 64-bit binaries for the ARMv7 bare-metal cross-toolchain

·        gcc-linaro-*i686-mingw32_arm-eabi.tar.xz

o   Windows 32-bit binaries for the ARMv7 bare-metal cross-toolchain

armeb-linux-gnueabihf

·        gcc-linaro-*x86_64_armeb-linux-gnueabihf.tar.xz

o   Linux 64-bit binaries for the ARMv7 Linux Big Endian hard float cross-toolchain

·        gcc-linaro-*i686-mingw32_armeb-linux-gnueabihf.tar.xz

o   Windows 32-bit binaries for the ARMv7 Linux Big Endian hard float cross-toolchain

armeb-none-eabi

·        gcc-linaro-*x86_64_armeb-eabi.tar.xz

o   Linux 64-bit binaries for the ARMv7 bare-metal Big Endian cross-toolchain

·        gcc-linaro-*i686-mingw32_armeb-eabi.tar.xz

o   Windows 32-bit binaries for the ARMv7 bare-metal Big Endian cross-toolchain

NOTE

·        The binary source package is no longer distributed as the components are now archived at http://abe.tcwglab.linaro.org/snapshots and downloaded automatically based on manifest.txt when (re)building with ABE.

·        The source package releases for the individual components are still at http://releases.linaro.org/latest/components/toolchain. Select the component (e.g. gcc, glibc, binutils, gdb) as necessary.

·        The binary tarball has been splitted into 3 parts. As a result, you can install only the parts needed:

o   gcc-linaro-*.tar.xz – the compiler and tools

o   runtime-linaro-*.tar.xz – runtime libraries needed on the target

o   sysroot-linaro-*.tar.xz – sysroot (a set of libraries and headers to develop against)

·        Beginning 2014.11, sysroots will use the latest glibc release provided by Linaro engineers in order that users get the latest features and optimizations in the system libraries.

·        Eglibc 2.15 compatible sysroots will no longer be released. Users that require Eglibc 2.15 sysroots that need the latest Linaro GCC compiler should use the previous quarterly released sysroot.

·        x86 (32-bit) Linux host toolchains are no longer provided. x86_64 (64-bit) Linux host toolchains are provided instead.

·        Soft-float targeted toolchains are no longer supported.

笔者使用的ARM交叉工具链版本为gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

下载地址为:

http://releases.linaro.org/components/toolchain/binaries/6.1-2016.08/arm-linux-gnueabi/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

3、安装步骤

3.1、Ubuntu14.04  64bit系统下安装标准的C开发环境

    sudo apt-get install gcc g++ libgcc1 libg++ make gdb

或者  sudo apt-get install build-essential

3.2、下载gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

1> 在/usr/local/文件夹下建立名为ARM-toolchain的文件夹

$ sudo mkdir /usr/local/ARM-toolchain

2> 下载gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

$ cd /usr/local/ARM-toolchain

sudo wget http://releases.linaro.org/components/toolchain/binaries/6.1-2016.08/ arm-linux-gnueabi/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

3.3、安装gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi

解压gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

$ xz –d gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar.xz

$ tar xvf gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi.tar

3.4、修改环境变量,把交叉编译器的路径加入到PATH

修改/etc/bash.bashrc文件(此文件只对当前用户适用)

$sudo gedit  /etc/bash.bashrc

然后在文件的末尾空白处加入一下代码:

# Add ARM toolschain path

if [ -d /usr/local/ARM-toolchain/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi ] ; then

PATH= /usr/local/ARM-toolchain/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi/bin:"${PATH}"

fi

3.5、使新的环境变量生效(不用重启电脑)

$ source /etc/bash.bashrc

3.6. 检查是否将路径加入到PATH:

$ echo $PATH

若显示的内容中含有:/usr/local/ARM-toolchain/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi/bin 说明已经将交叉编译器的路径加入PATH。

至此,交叉编译环境安装完成。

3.7. 测试是否安装成功

$ arm-linux-gnueabi-gcc -v

执行上面的命令,显示arm-linux-gnueabi-gcc -v信息和版本:

$ arm-linux-gnueabi-gcc -v

Using built-in specs.

COLLECT_GCC=arm-linux-gnueabi-gcc

COLLECT_LTO_WRAPPER=/usr/local/ARM-toolchain/gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/6.1.1/lto-wrapper

Target: arm-linux-gnueabi

Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/snapshots/gcc-linaro-6.1-2016.08/configure SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --enable-gnu-indirect-function --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=softfp --with-mode=thumb --disable-multilib --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/sysroots/arm-linux-gnueabi --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabi/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabi --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg/target/arm-linux-gnueabi/_build/builds/destdir/x86_64-unknown-linux-gnu

Thread model: posix

gcc version 6.1.1 20160711 (Linaro GCC 6.1-2016.08)

安装gcc-linaro-6.1.1-2016.08-x86_64_arm-linux-gnueabi交叉编译器的更多相关文章

  1. CentOS_5.5_安装GCC编译LiME

    1 概述 近期遇到个使用CentOS 5.5的系统,生产环境没有GCC.GDB.要对这台机器抓取关键内存回去用volatility分析. 思路1:使用工具Dump某个进程的内存.使用cat /proc ...

  2. 在CentOS 6.4中编译安装gcc 4.8.1

    在CentOS 6.4中编译安装gcc 4.8.1 分类: C/C++ Linux/Unix2013-11-28 21:02 1877人阅读 评论(0) 收藏 举报 原文链接:http://www.c ...

  3. Ubuntu 16.04 LTS 降级安装GCC 4.8

    转载自https://www.linuxidc.com/Linux/2017-03/142299.htm Ubuntu 16.04 LTS 降级安装GCC 4.8 [日期:2017-03-28] 来源 ...

  4. 最新版Theos.2016.08的安装方法

    http://bbs.pediy.com/showthread.php?t=212425 标题: [翻译]手把手安装最新版Theos.2016.08作者: roysue时间: 2016-08-26,1 ...

  5. Mac 安装GCC

    OS X上安装Homebrew和GCC的图文攻略 2016年08月31日 11:21:27 白马负金羁 阅读数:11380 标签: OS XGCCHomebrew 更多 个人分类: 应用技巧   版权 ...

  6. yum安装gcc

    如果服务器是自己的,并且机器就在身边,那什么都不用说了,缺少gcc顶多就是重新放入安装盘,把开发工具包安装上.但是如果是租的服务器,托管服务 方那帮人又搞不懂你说的啥子gcc,要安装gcc实在是太麻烦 ...

  7. windows安装gcc编译器

    由于vc6.0对c语言编译不是很好,有些语句是正确的,但是编译却不能通过 所以决定在windows中安装gcc编译器来使用! http://www.cnblogs.com/cryinstall/arc ...

  8. Fedora 安装gcc gcc-c++

    Fedora本身没有自带gcc 和 g++编译器,所以需要我们自己去安装,步骤如下: 1.切换到root用户(或者跳过这个步骤,直接在下面命令前面加上 sudo) su root 2.安装gcc yu ...

  9. Linux(RHEL6.0)下安装GCC

    查看系统版本 [root@CP-RHEL proc]# cat /etc/issue Red Hat Enterprise Linux Server release 6.0 (Santiago) Ke ...

  10. Red Hat Enterprise Linux Server 6.5安装GCC 4.9.2

    现在很多程序员都应用GCC,怎样才能更好的应用GCC.目前,GCC可以用来编译C/C++.FORTRAN.JAVA.OBJC.ADA等语言的程序,可根据需要选择安装支持的语言.本文以在RedHat L ...

随机推荐

  1. netlink socket编程

    转载 原文地址:netlink socket编程之why & how (转) 作者:renyuan000 作者: Kevin Kaichuan He@2005-1-5 翻译整理:duanjig ...

  2. glom模块的使用(一)

    glom模块的使用 简单说下glom模块主要是处理结构化数据用的,安装简单pip install glom即可,下面就glom的方法参数做例子讲解. glom 和模块同名的glom方法使用方法: .g ...

  3. 用intellj 建一个spring mvc 项目DEMO

    spring的起初可能经常碰壁,因为网上的资料都是混乱的xml堆成的,混乱难以理解,我这个也是,阿哈哈哈哈! 新建一个Maven->create from archetype->org.j ...

  4. 【bzoj3682】Phorni

    后缀平衡树裸题. 后缀平衡树呢,实际上是一个很naive的东西.就是用平衡树维护后缀数组. 这样的话就可以支持在最前端插入一个字符(相当于插入新的后缀) 每次比较节点的tag是O(1)的,所以可以快速 ...

  5. cacti (可以利用yum安装cacti的配置)

    [root@localhost ~]# yum install -y epel-release[root@localhost ~]# [root@localhost ~]# yum install - ...

  6. C#ActiveX安装项目

    C#开发的ActiveX控件发布方式有三种: 制作客户端安装包,分发给客户机安装: 制作在线安装包,客户机联机安装: 使用html中object的codebase指向安装包地址. 以下为制作安装包: ...

  7. 【Android开发日记】之入门篇(十五)——ViewPager+自定义无限ViewPager

    ViewPager 在 Android 控件中,ViewPager 一直算是使用率比较高的控件,包括首页的banner,tab页的切换都能见到ViewPager的身影. viewpager 来源自 v ...

  8. HIbernate学习笔记4 之 延迟加载和 关联映射

    一.延迟加载 * 在使用hibernate一些方法的查询数据的时候,返回的只是一个空对象(除id外属性都为NULL),并没有真正的查询数据库,而是在使用这个对象时才会触发查询数据库,并将这些数据注入到 ...

  9. servlet为什么要配置web.xml

    (1).为Servlet命名:  <servlet>  <servlet-name>servlet1</servlet-name> <- 这是用于,在serv ...

  10. .NET 二进制序列化器,SOAP序列化器,XML序列化器

    这里就不说JSON序列化了,只介绍三种:二进制序列化器,SOAP序列化器,XML序列化器 直接上代码: /// <summary> /// 二进制序列化器. /// 最节省流量,压缩程度最 ...