<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
玩了几天,终于把u-boot 给make 通了一次 呵呵,总结下
环境如下:
VM + REDHAT9 + U-BOOT1。1。4 + ARM-LINUX-GCC 2.95.3
首先,解压交叉工具连
Tar –xjvf cross-gcc2.95.3.tar.bz2
然后,Copy 2。95。3 目录到 /usr/local/arm目录下
接着解压 u-boot-<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.1.4
然后,Copy整个u-boot-1.1.4到 跟目录下的/ u-boot(事先建好的目录)里
同时查看了,在用其他两个版本的时候,对一些文件的设置,如下:
/cpu/arm920t/config.mk的 内容如下:
PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 /
-msoft-float
PLATFORM_CPPFLAGS += -march=armv4
# ====================================================================
#
# Supply options according to compiler version
#
# ====================================================================
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32)#,-mabi=apcs-gnu)
PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
下面是设置交叉工具连的路径,之前是 3。3。2, 修改见下面:
[root@localhost arm920t]# vi /etc/profile
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
pathmunge /usr/local/arm/2.95.3/bin //后加的
[root@localhost arm920t]# source /etc/profile
可以到任意目录测试是否生效
[root@localhost arm920t]# arm-linux-gcc –v
正确的结果如下:
Reading specs from /usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/specs
gcc version 2.95.3 20010315 (release)
最后在,在u-boot-1.1.4目录下
[root@localhost u-boot-1.1.4]# make clean
正常
然后做下面工作:
[root@localhost u-boot-1.1.4]# make smdk2410_config
Configuring for smdk2410 board...
正常
再make
一切OK , 被折磨了两天,终于算是舒坦了下 哈哈
然一开始用的也是2。95。3 + uboot 1。1。4, 同时也用过 gcc3.4.1, u-boot 1.1.5, u-boot 1.1.6
不能make通过
其中一种情况的描述大致如下:
VM + REDHAT9V。0 + ARM-LINUX-GCC-3。3。2 + U-BOOT-1。1。4
路径都设置后, 在 u-boot-1.1.4目录
1 make clean
2 make smdk2410-config
[root@localhost u-boot-1.1.4]# make smdk2410_config
Configuring for smdk2410 board...
3 [root@localhost u-boot-1.1.4]# make
报错如下:
cc1: error: invalid option `abi=apcs-gnu'
as: unrecognized option `-march=armv4'
make[1]: *** [hello_world.o] Error 1
make[1]: Leaving directory `/u-boot/u-boot-1.1.4/examples'
make: *** [examples] Error 2
[root@localhost u-boot-1.1.4]#
按文档和网上的描述: /cpu/arm920T 下的 config.mk 文件
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
改成:
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
4 再make,提示如下的错误,
make -C examples all
make[1]: Entering directory `/u-boot/u-boot-1.1.4/examples'
arm-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -mshort-load-bytes -D__KERNEL__ -DTEXT_BASE=0x33F80000 -I/u-boot/u-boot-1.1.4/include
-fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -mapcs-32 -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c
as: unrecognized option `-march=armv4'
make[1]: *** [hello_world.o] Error 2
make[1]: Leaving directory `/u-boot/u-boot-1.1.4/examples'
make: *** [examples] Error 2