u-boot移植过程中的问题:board.c:126: error: inline function 'coloured_LED_init' cannot be declared weak

错误一:

main.c:51:error:inline function ‘show_boot_progress’ cannot be decleared weak

make[1]?**[main.0]错误1

make[1]:正在离开目录’/home/sns/linux2.6.32/icetek-v3/u-boot-orig/common’

make:***[common/libcommon.a]错误2

解决方法:common/main.c去掉show_boot_progress 前面的inline即可

错误二:

board.c:127: error: inline function ‘coloured_LED_init’ cannot be declared weak
board.c:129: error: inline function ‘red_LED_on’ cannot be declared weak
board.c:131: error: inline function ‘red_LED_off’ cannot be declared weak
board.c:133: error: inline function ‘green_LED_on’ cannot be declared weak
board.c:135: error: inline function ‘green_LED_off’ cannot be declared weak
board.c:137: error: inline function ‘yellow_LED_on’ cannot be declared weak
board.c:139: error: inline function ‘yellow_LED_off’ cannot be declared weak
board.c:141: error: inline function ‘blue_LED_on’ cannot be declared weak
board.c:143: error: inline function ‘blue_LED_off’ cannot be declared weak
make[1]: *** [board.o] 错误 1
make[1]: Leaving directory `/root/workspace/u-boot-2009.08/lib_arm’
make: *** [lib_arm/libarm.a] 错误 2

错误三:

cpu/arm920t/start.o: In function start_code': /home/zyc/SoftWare/u-boot-2009.03/cpu/arm920t/start.S:118: undefined reference tocoloured_LED_init’
/home/zyc/SoftWare/u-boot-2009.03/cpu/arm920t/start.S:119: undefined reference to `red_LED_on’

错误四:

main.c:51: error: inline function ‘show_boot_progress’ cannot be declared weak
/home/zyc/SoftWare/u-boot-2009.03/config.mk:216: recipe for target ‘main.o’ failed
make[1]: *** [main.o] Error 1

解决方法:

即找到对应的位置,将其注释掉即可

打开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__的部分即可

你可能感兴趣的:(嵌入式)