【个人笔记】Ubuntu安装arm-linux-gcc 交叉工具链

51 篇文章 0 订阅

注:之前用redhat和CentOS。现在的Ubuntu版本是最新的16,很多问题没注意到。


假设交叉编译工具链版本*.*.1

解压好了arm-linuxg-gcc 放到了$PATH路径下, (/usr/local)

mv opt/**/toolschain/*.*.1  /usr/local/arm
修改.bash_profile

PATH=$PATH:$HOME/bin
PATH=/usr/local/arm/*.*.1/bin:$PATH
export PATH

# source ~/.bash_profile
#arm-linux-gcc --version

执行提示说: no such file or directory

arm-linux-gcc这个命令是32位的, 需要安装兼容包,于是apt-get install libc6:i386 

ia32-libs;libstdc++5:i386 libstdc++6:i386        libgcc1:i386 gcc-4.6-base:i386:

Redhat::

yum install glibc.i686


编译内核

以下是编译错误提示的内容:

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/opt/ARM/mini6410/linux/linux-2.6.38/kernel/Makefile:140: recipe for target 'kernel/timeconst.h' failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:916: recipe for target 'kernel' failed
make: *** [kernel] Error 2

可以修改timeconst.pl的内容后正常编译。将kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了.


另一个

. error while loading shared libraries: libz.so.1


sudo apt-get install lib32z1




交叉编译

#arm-linux-gcc abc.c
/opt/FriendlyARM/toolschain/4.5.1/lib/gcc/arm-none-linux-gnueabi/4.5.1/../../../../arm-none-linux-gnueabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory   
sno@sno:~$ sudo apt-get install lib32z1





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值