mini2440烧写u-boot(一)

来源:互联网 发布:rust知乎 编辑:程序博客网 时间:2024/06/04 20:55

移植环境
 
1,主机环境:VMare下Ubuntu ,512M内存。
 
2,编译编译环境:arm-linux-gcc v4.4.3
 
4,开发板:mini2440,2M nor flash,256M nand flash。
 
5,u-boot版本:

2010-04-26Michel PolletMINI2440:Fixes for gcc 4.xcommit |commitdiff | tree | snapshot (tar.gzzip)

下载网址:http://repo.or.cz/w/u-boot-openmoko/mini2440.git

 

make的时候出现问题:
 
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

出现错误,内嵌函数不能被声明为weak属性,打开lib_arm/board.c,将其注释掉,修改后结果如下:
 
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")));

 

问题解决参考网友文章:http://www.linuxidc.com/Linux/2011-05/35982.htm

 

然后又出现错误

main.c:51: error: inline function 'show_boot_progress' cannot be declared weak
make[1]: *** [main.o] 错误 1

 

解决:通过grep “show_boot_process” . -rn

找到所在文件

 

去掉函数头部的inline 关键字

原创粉丝点击