arm-linux交叉编译环境搭建及交叉工具链 (JZ2440v2)

1. 交叉编译环境搭建:

(1)caihuanming@ubuntu:/home/caihuanming#          #不是root用户

tar xvf arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2 -C ./      #注意是xvf不是xvzf

(2)caihuanming@ubuntu:/home/caihuanming#

export PATH=$PATH:/home/caihuanming/gcc-3.4.5-glibc-2.3.6/bin

(3)caihuanming@ubuntu:/home/caihuanming#echo $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/caihuanming/gcc-3.4.5-glibc-2.3.6/bin

 

(4)sudo vim /etc/environment

source /etc/environment

(5)PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/caihuanming/gcc-3.4.5-glibc-2.3.6/bin”

 

2.交叉工具链

(1)编译 产生led.o

arm-linux-gcc –g –c led.S

(2)链接 产生led.elf   运用led.lds链接器脚本

arm-linux-ld –Tled.lds –o led.elf

(3)led.elf信息 大下端 运行平台 类似file led.elf

arm-linux-readelf –a led.elf

(4)反汇编hello输出到dump文件夹

arm-linux-objdump –D –S hello >dump

(5)格式转换 产生led.bin

arm-linux-objcopy –O binary led.elf led.bin

你可能感兴趣的:(嵌入式,系统移植)