U_BOOT移植时出现相关错误时解决办法

来源:互联网 发布:绿色上网软件 编辑:程序博客网 时间:2024/05/22 03:52

1.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

出现错误,内嵌函数不能被声明为weak属性,打开lib_arm/board.c,定位到127行开始,将其注释掉,修改后结果如下:

void inline __coloured_LED_init (void) {}
//void inline coloured_LED_init (void) __attribute__((weak, alias("__coloured_LED_init")));
void inline __red_LED_on (void) {}
//void inline red_LED_on (void) __attribute__((weak, alias("__red_LED_on")));
void inline __red_LED_off(void) {}
//void inline red_LED_off(void)      __attribute__((weak, alias("__red_LED_off")));
void inline __green_LED_on(void) {}
//void inline green_LED_on(void) __attribute__((weak, alias("__green_LED_on")));
void inline __green_LED_off(void) {}
//void inline green_LED_off(void)__attribute__((weak, alias("__green_LED_off")));
void inline __yellow_LED_on(void) {}
//void inline yellow_LED_on(void)__attribute__((weak, alias("__yellow_LED_on")));
void inline __yellow_LED_off(void) {}
//void inline yellow_LED_off(void)__attribute__((weak, alias("__yellow_LED_off")));
void inline __blue_LED_on(void) {}
//void inline blue_LED_on(void)__attribute__((weak, alias("__blue_LED_on")));
void inline __blue_LED_off(void) {}
//void inline blue_LED_off(void)__attribute__((weak, alias("__blue_LED_off")));

 

2.

cpu/arm920t/start.o: In function `start_code':
/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:117: undefined reference to `coloured_LED_init'

/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:118: undefined reference to `red_LED_on'
make: *** [u-boot] 错误 1
出现错误coloured_LED_init'未定义。打开cpu/arm920t/start.S,搜索“coloured_LED_init”定位到117行,找到如下代码:

 bl coloured_LED_init
 bl red_LED_on

将其注释掉

//这两行是AT91RM9200DK开发板的LED初始化,注释掉

//bl coloured_LED_init
 //bl red_LED_on


然后执行清除、编译命令

 

原创粉丝点击