编译linux 内核时:decompress.c:(.text+0x25c4): undefined reference to `error'的解决办法

想把ARM下的linux升级,

下载了linux-2.6.33.6并打了实时补丁后开编译:一直到最后在制作压缩文件时:出现了

  OBJCOPY arch/arm/boot/Image
  Kernel: arch/arm/boot/Image is ready
  GZIP    arch/arm/boot/compressed/piggy.gzip
  AS      arch/arm/boot/compressed/piggy.gzip.o
  CC      arch/arm/boot/compressed/decompress.o
  SHIPPED arch/arm/boot/compressed/lib1funcs.S
  AS      arch/arm/boot/compressed/lib1funcs.o
  LD      arch/arm/boot/compressed/vmlinux
arch/arm/boot/compressed/decompress.o: In function `do_decompress':
decompress.c:(.text+0x25c4): undefined reference to `error'
decompress.c:(.text+0x25e8): undefined reference to `error'
decompress.c:(.text+0x260c): undefined reference to `error'
decompress.c:(.text+0x2660): undefined reference to `error'
decompress.c:(.text+0x272c): undefined reference to `error'
make[2]: *** [arch/arm/boot/compressed/vmlinux] 错误 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] 错误 2
make: *** [zImag 错误 2

 

 

即退出.

这是在2.6.28版本以前所没有的现象.

 

遍查网上资料,也无所获.

http://tima-sls.imag.fr/viewgit/rabbits/?a=viewblob&p=Linux&h=d2b2ef41cd4ff7ac32bf91e4e947cc57993cbb2d&hb=0b0c06d1476290cea248923c0ee7be9fd61cacea&f=arch/arm/boot/compressed/misc.c

这遍文章中提到修改misc.c
增加extern void error(char *x);,试后也不行.

 

只能自己分析.

首先 在decompress.c中增加了do_decompress函数中增加了一句error("sdfsdfsdfsdfs");屏蔽decompress(

执行后不报错.说明在这里error函数是能用的,和编译报的错不相符....

通过查找,decompress()函数是在./lib/decompress_inflate.c 中用

#define decompress gunzip

指定是gunzip

摸摸索两天后才发现在这个回调函数中指定是error_fn.

但是在函数体中却又使用了error原型函数.

于是将函数体中的所有error 改为error_fn

编译通过.

 

特此记录,以备参考.

 

转载请附上原址,谢谢

einsteinz 2010年7月23日

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值