背景:用4.4.3版本的交叉编译环境编译u-boot-2009版u-boot 移植到fl2440开发板平台。
错误一:
main.c:51:error:inline function 'show_boot_progress' cannot bedecleared weak
make[1]:***[main.0]错误1
make[1]:正在离开目录'/home/sns/linux2.6.32/icetek-v3/u-boot-orig/common'
make:***[common/libcommon.a]错误2
解决方法:去掉/home/sns/linux2.6.32/icetek-v3/u-boot-orig/common/main.c 文件里第51行show_boot_progress 前面的inline即可
错误二:
board.c:127: error: inline function 'coloured_LED_init' cannotbe declared weak
board.c:129: error: inline function 'red_LED_on' cannot be declaredweak
board.c:131: error: inline function 'red_LED_off' cannot bedeclared weak
board.c:133: error: inline function 'green_LED_on' cannot bedeclared weak
board.c:135: error: inline function 'green_LED_off' cannot bedeclared weak
board.c:137: error: inline function 'yellow_LED_on' cannot bedeclared weak
board.c:139: error: inline function 'yellow_LED_off' cannot bedeclared weak
board.c:141: error: inline function 'blue_LED_on' cannot bedeclared weak
board.c:143: error: inline function 'blue_LED_off' cannot bedeclared weak
make[1]: *** [board.o] 错误 1
make[1]: Leaving directory`/root/workspace/u-boot-2009.08/lib_arm'
make: *** [lib_arm/libarm.a] 错误 2
解决方法:
打开lib_arm/board.c,定位到127行开始,将其注释掉:
void inline __coloured_LED_init (void){}
//void inline coloured_LED_init (void) __attribute__((weak,alias("__coloured_LED_init")));
这里注释掉了'coloured_LED_init' 的部分,自己做时对照注释掉后面几个带__attribute__的部分即可
错误三:cpu/arm920t/start.o: In function`start_code':
/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:117: undefinedreference to `coloured_LED_init'
/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:118: undefinedreference to `red_LED_on'
make: *** [u-boot] 错误 1
解决方法:
打开cpu/arm920t/start.S,搜索“coloured_LED_init”定位到117行,找到如下代码:
bl coloured_LED_init
bl red_LED_on
这两行是AT91RM9200DK开发板的LED初始化,注释掉即可。
五:warning: target CPU does not support interworking
解决:一看就知道是跟CPU有关,到u-boot根目录下执行
$sudo gedit "cpu/arm920t/config.mk"
把 PLATFORM_CPPFLAGS += -march=armv4 改成 PLATFORM_CPPFLAGS += -march=armv4t
六:uboot软浮点错误
问题:
opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0 -lgcc \
-Map u-boot.map -o u-boot
arm-linux-ld: ERROR: /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_udivdi3.o) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_udivdi3.o)
arm-linux-ld: ERROR: /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_clz.o) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_clz.o)
make: *** [u-boot] 错误 1
不过用2.95版本的时候还要修改一个链接。