1. 解压gcc_toolchain到/usr目录;

2. 执行:sudo gedit /etc/profile:

  添加export PATH=$PATH:/usr/.../.../bin/

3. 执行:source /etc/profile 

  通过指令:echo $PATH 查看是否有成功添加环境变量;

4. 编译对应source code,一般会遇到如下几个问题

  4.1 使用的时候出现一个错误

    bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    是因为64位系统中安装了32位程序

    解决方法:yum install glibc.i686
  4.2 若遇到“error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
     解决方法:yum install zlib.i686
  4.3 若继续出现“error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    解决方法:先查找这个库存在于哪个安装包中

      yum whatprovides libstdc++.so.6

    得到信息:
      Loaded plugins: fastestmirror, refresh-packagekit, security
      Loading mirror speeds from cached hostfile
      * base: mirrors.yun-idc.com
      * epel: mirror.premi.st
      * extras: mirrors.yun-idc.com
      * updates: mirrors.btte.net
      libstdc++-4.8.5-4.el7.i686: GNU Standard C++ Library
      Repo : base
      Matched from:
      Other : libstdc++.so.6

    可以看到包  libstdc++-4.8.5-4.el7.i686

    执行命令: yum install libstdc++-4.8.5-4.el7.i686

==========================================

20160719 补充

  make menuconfig的时候报错

  ./tools/mconf: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
make: *** [menuconfig] Error 127
  解决办法: 执行 yum whatprovides libncursesw.so.5
    Loaded plugins: fastestmirror, langpacks
    Determining fastest mirrors
     * base: mirrors.aliyun.com
     * extras: mirrors.zju.edu.cn
     * updates: mirrors.aliyun.com
    ncurses-libs-5.9-13.20130511.el7.i686 : Ncurses libraries
    Repo        : base
    Matched from:
    Provides    : libncursesw.so.5
  然后执行 yum install ncurses-libs-5.9-13.20130511.el7.i686

 缺mkimage的时候

在uboot的tools里面,把这个mkimage考到/usr/bin下就行了:

#cp mkimage /usr/bin/mkimage

记得要chmod 755 mkimage

 

yum install make

yum groupinstall "Development Tools"

yum install gcc gcc-c++ kernel-devel

转载于:https://www.cnblogs.com/cutelinux/p/5682352.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐