linux 建立交叉编译环境变量,ARM-Linux-gcc-4.4.3交叉编译环境终于搭建

Linux交叉编译环境终于搭建完成具体步骤:

0、软件请到友善之臂的官网下载

1、解压

tar zxvf arm-linux-gcc-4.4.3-20100728.tar.gz

-C/(别make了,直接解压后就可以)

2、设置环境变量:首先

vi ~/.bashrc

然后在最后加上

export

PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin

3、使环境变量立即生效:

source ~/.bashrc

4、验证:arm-linux-gcc-v,我的显示如下:

aidway@aidway-desktop:~$

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)

5、编写一个简单的hello程序,用arm-linux-gcc

-o hello hello.c

编译,生成hello文件,将该文件上传到ARM板(我用的使2440),在ARM板上用./hello

运行程序,如果所有步骤正确的话,将能够正常运行。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值