为什么在ubuntu编译下uboot时总是出错?
-
- 帖子: 43
- 注册时间: 2005-11-24 1:26
为什么在ubuntu编译下uboot时总是出错?
本人用的是6.06的ubuntu。
经多次试验确认,在ubuntu编译下uboot时总是出现以下错误:
img2srec.c:56:19: error: stdio.h: No such file or directory
img2srec.c:57:20: error: stdlib.h: No such file or directory
img2srec.c:58:19: error: ctype.h: No such file or directory
img2srec.c:59:20: error: string.h: No such file or directory
In file included from img2srec.c:60:
../include/elf.h:43:20: error: stdint.h: No such file or directory
In file included from img2srec.c:60:
../include/elf.h:58: error: syntax error before 'Elf32_Addr'
../include/elf.h:59: error: syntax error before 'Elf32_Off'
../include/elf.h:60: error: syntax error before 'Elf32_Sword'
。。。。。。。
我使用公司的redhat服务器编译相同的代码,可以顺利完成编译。编译链也是一样的,真搞不懂为什么了。
请指教,谢谢!
经多次试验确认,在ubuntu编译下uboot时总是出现以下错误:
img2srec.c:56:19: error: stdio.h: No such file or directory
img2srec.c:57:20: error: stdlib.h: No such file or directory
img2srec.c:58:19: error: ctype.h: No such file or directory
img2srec.c:59:20: error: string.h: No such file or directory
In file included from img2srec.c:60:
../include/elf.h:43:20: error: stdint.h: No such file or directory
In file included from img2srec.c:60:
../include/elf.h:58: error: syntax error before 'Elf32_Addr'
../include/elf.h:59: error: syntax error before 'Elf32_Off'
../include/elf.h:60: error: syntax error before 'Elf32_Sword'
。。。。。。。
我使用公司的redhat服务器编译相同的代码,可以顺利完成编译。编译链也是一样的,真搞不懂为什么了。
请指教,谢谢!
-
- 帖子: 22
- 注册时间: 2006-07-13 0:26
- 来自: Shenzhen
-
- 帖子: 43
- 注册时间: 2005-11-24 1:26
感谢你的回复!!!
说得有理有据,感谢!!!
我按照你说的安装了GCC后,
发现还出现了一下错误:
/usr/local/arm/2.95.3/bin/arm-linux-ar crv libstubs.a stubs.o
a - stubs.o
make[1]: *** No rule to make target `hello_world.srec', needed by `all'. Stop.
make[1]: Leaving directory `/home/aaron/share/u-boot-20060523/examples'
make: *** [examples] Error 2
呵呵,很晚了我脑袋已经不转了。。。
我按照你说的安装了GCC后,
发现还出现了一下错误:
/usr/local/arm/2.95.3/bin/arm-linux-ar crv libstubs.a stubs.o
a - stubs.o
make[1]: *** No rule to make target `hello_world.srec', needed by `all'. Stop.
make[1]: Leaving directory `/home/aaron/share/u-boot-20060523/examples'
make: *** [examples] Error 2
呵呵,很晚了我脑袋已经不转了。。。
- volans
- 帖子: 67
- 注册时间: 2006-11-15 14:28
- 来自: Beijing
-
- 帖子: 43
- 注册时间: 2005-11-24 1:26
谢谢提醒!
我试试看,我还有下面一个问题。
我现在用3.4.1的编译链编译u-boot时还是会出现以下错误;
lib_arm/libarm.a(_udivsi3.o)(.text+0x8c):/home/aaron/share/u-boot-1.1.6/lib_arm/_udivsi3.S:67: relocation truncated to fit: R_ARM_PLT32 __div0
lib_arm/libarm.a(_umodsi3.o)(.text+0xa8):/home/aaron/share/u-boot-1.1.6/lib_arm/_umodsi3.S:79: relocation truncated to fit: R_ARM_PLT32 __div0
make: *** [u-boot] Error 1
这是怎么回事呢?谢谢回复!!
我现在用3.4.1的编译链编译u-boot时还是会出现以下错误;
lib_arm/libarm.a(_udivsi3.o)(.text+0x8c):/home/aaron/share/u-boot-1.1.6/lib_arm/_udivsi3.S:67: relocation truncated to fit: R_ARM_PLT32 __div0
lib_arm/libarm.a(_umodsi3.o)(.text+0xa8):/home/aaron/share/u-boot-1.1.6/lib_arm/_umodsi3.S:79: relocation truncated to fit: R_ARM_PLT32 __div0
make: *** [u-boot] Error 1
这是怎么回事呢?谢谢回复!!
-
- 帖子: 43
- 注册时间: 2005-11-24 1:26
感谢jarodwang和volans。
感谢两位3楼的问题也解决了,在顶层Makefile中把example前加上“#”,如下:
SUBDIRS = tools \
#examples \
post \
post/cpu
.PHONY : $(SUBDIRS)
还请大家看看我5楼的问题。
SUBDIRS = tools \
#examples \
post \
post/cpu
.PHONY : $(SUBDIRS)
还请大家看看我5楼的问题。
-
- 帖子: 22
- 注册时间: 2006-07-13 0:26
- 来自: Shenzhen
-
- 帖子: 43
- 注册时间: 2005-11-24 1:26
感谢关注!
我是个新手,所以很多问题都描述不清楚。不好意思。
我现在用3.3.2的编译链编译u-boot-1.2.0,基本没什么问题了。谢谢
5楼那个问题是软浮点的问题,解决办法见下:
http://blog.tianya.cn/blogger/post_show ... 9149&Key=0
当然也是和编译链的版本有关。
最后,推荐大家用3.3.2来编译u-boot-1.2.0,不会出现以上问题。
我现在用3.3.2的编译链编译u-boot-1.2.0,基本没什么问题了。谢谢
5楼那个问题是软浮点的问题,解决办法见下:
http://blog.tianya.cn/blogger/post_show ... 9149&Key=0
当然也是和编译链的版本有关。
最后,推荐大家用3.3.2来编译u-boot-1.2.0,不会出现以上问题。
- volans
- 帖子: 67
- 注册时间: 2006-11-15 14:28
- 来自: Beijing
-
- 帖子: 1
- 注册时间: 2007-05-17 10:29
-
- 帖子: 1
- 注册时间: 2007-05-15 19:03
我也在编译1.1.6时出错了,错误描述如下:
make[1]: Entering directory `/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/post'
arm-linux-gcc -D__ASSEMBLY__ -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -malignment-traps -D__KERNEL__ -DTEXT_BASE=0xc0f80000 -I/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/lib/gcc/arm-linux/3.4.4/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -mtune=arm7tdmi -mapcs-32 -c -o cache_8xx.o cache_8xx.S
Assembler messages:
Fatal error: Invalid -march= option: `armv4'
make[1]: *** [cache_8xx.o] 错误 2
make[1]: Leaving directory `/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/post'
make: *** [post] 错误 2
谁给给我解释一下这个规则是从哪里来的?
make[1]: Entering directory `/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/post'
arm-linux-gcc -D__ASSEMBLY__ -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -malignment-traps -D__KERNEL__ -DTEXT_BASE=0xc0f80000 -I/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/lib/gcc/arm-linux/3.4.4/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -mtune=arm7tdmi -mapcs-32 -c -o cache_8xx.o cache_8xx.S
Assembler messages:
Fatal error: Invalid -march= option: `armv4'
make[1]: *** [cache_8xx.o] 错误 2
make[1]: Leaving directory `/home/gflfof/Desktop/uboot/SourceCode/u-boot-1.1.6/post'
make: *** [post] 错误 2
谁给给我解释一下这个规则是从哪里来的?