Fedora20-64bit cross-compiling arm-linux-gcc

 0按照友善之臂的手册建立交叉编译环境时,添加用户变量,最好是去更改 profile 文件

因为 profile 是所有用户都可以使用的,类似于 windows 中的系统变量

而 .bashrc 只有该所属用户可使用,类似于windows 中的用户变量

su root
vi /etc/profile

1添加如下路径在profile文件最后

export PATH=$PATH:/opt/FriendlyARM/toolschain/5.4.3/bin

2 使修改的profile文件立即生效,不用重启

source /etc/profile

 3测试 arm-linux-gcc -v,以下是安装正确的情况:

[hy@localhost ~]$ arm-linux-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /opt/FriendlyARM/mini2440/build-toolschain/working/src/gcc-4.4.3/configure --build=i386-build_redhat-linux-gnu --host=i386-build_redhat-linux-gnu --target=arm-none-linux-gnueabi --prefix=/opt/FriendlyARM/toolschain/4.4.3 --with-sysroot=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --enable-languages=c,c++ --disable-multilib --with-arch=armv4t --with-cpu=arm920t --with-tune=arm920t --with-float=soft --with-pkgversion=ctng-1.6.1 --disable-sjlj-exceptions --enable-__cxa_atexit --with-gmp=/opt/FriendlyARM/toolschain/4.4.3 --with-mpfr=/opt/FriendlyARM/toolschain/4.4.3 --with-ppl=/opt/FriendlyARM/toolschain/4.4.3 --with-cloog=/opt/FriendlyARM/toolschain/4.4.3 --with-mpc=/opt/FriendlyARM/toolschain/4.4.3 --with-local-prefix=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi//sys-root --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-c99 --enable-long-long --enable-target-optspace
Thread model: posix
gcc version 4.4.3 (ctng-1.6.1) 

 4但是由于使用的是 Fedora20-64bit,出现了些要安装64位的库的错误。

4.1以下来安装所需要的文件 glibc.i686:
[hy@localhost ~]$ yum install glibc.i686
 4.2安装所需要的文件 libstdc++:
[hy@localhost ~]$ yum install libstdc++.so

 4.3以上安装完毕后,在进行make 时,还是会提示缺少文件,再安装以下文件 zlib.i686:

 >>这时,交叉编译可通过。

 

参考:

http://blog.chinaunix.net/uid-29532371-id-4616525.html

posted @ 2016-03-20 21:23  .Think  阅读(476)  评论(0编辑  收藏  举报