编译内核为什么失败?

Kanglase 2005-08-29 10:31:21
rh9.0
gcc 4.0.0.8
make mrproper
make dep
make clean
都正常
但make bzImage就报错
D__KERNEL__ -I/home/fudancs/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common
-pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=main -c
-o init/main.o init/main.c
In file included from /home/fudancs/linux/include/linux/prefetch.h:13,
from /home/fudancs/linux/include/linux/list.h:6,
from /home/fudancs/linux/include/linux/wait.h:14,
from /home/fudancs/linux/include/linux/fs.h:12,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/asm/processor.h:73: error: array type has
incomplete element type
In file included from /home/fudancs/linux/include/linux/fs.h:201,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/asm/byteorder.h:14: warning: type qualifiers
ignored on function return type
/home/fudancs/linux/include/asm/byteorder.h:28: warning: type qualifiers
ignored on function return type
In file included from
/home/fudancs/linux/include/linux/byteorder/little_endian.h:11,
from /home/fudancs/linux/include/asm/byteorder.h:45,
from /home/fudancs/linux/include/linux/fs.h:201,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/linux/byteorder/swab.h:132: warning: type
qualifiers ignored on function return type
/home/fudancs/linux/include/linux/byteorder/swab.h:145: warning: type
qualifiers ignored on function return type
/home/fudancs/linux/include/linux/byteorder/swab.h:159: warning: type
qualifiers ignored on function return type
In file included from /home/fudancs/linux/include/linux/unistd.h:9,
from init/main.c:17:
/home/fudancs/linux/include/asm/unistd.h:360: warning: conflicting types
for built-in function a€?_exita€?
make: *** [init/main.o] Error 1




why?
后来发现,连本机的2.6内核也编译不了
同样的错误
gcc版本太高了?
不明白
求教
狂谢
...全文
245 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
WhoAmI999 2005-09-06
  • 打赏
  • 举报
回复
我用rh9(2.4.20-8)自己带的源码重新编译也会出问题
你从www.kernel.org重新下载一个新的内核再编译试试
反正我后来编译2.6.10的内核都是可以成功的
kangjian1 2005-09-06
  • 打赏
  • 举报
回复
把/home/fudancs/linux/include/asm/processor.h:73贴上来
sourceid 2005-09-03
  • 打赏
  • 举报
回复
可以,很顺利.
运行环境:FC4 gcc4.0.0.8
编译linux2.6.12
yanghuajia 2005-09-02
  • 打赏
  • 举报
回复
gcc的版本真是高啊!
xingzhe2001 2005-09-02
  • 打赏
  • 举报
回复
make mrproper后最好make menuconfig改改配置
eternal_baggio 2005-09-02
  • 打赏
  • 举报
回复
你内核版本是多少?重新解压一个干净的kernel再试试。
理论上跟gcc版本应该没关系,不妨换个gcc版本再试。
flinymengw4u 2005-09-01
  • 打赏
  • 举报
回复
不要随便make mrproper
你知道这是干什么的?
这会删除一些脚本和配置文件,把配置还原的
Kanglase 2005-08-29
  • 打赏
  • 举报
回复
还是不行
在make bzImage过程中出现
D__KERNEL__ -I/home/fudancs/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
In file included from /home/fudancs/linux/include/linux/prefetch.h:13,
from /home/fudancs/linux/include/linux/list.h:6,
from /home/fudancs/linux/include/linux/wait.h:14,
from /home/fudancs/linux/include/linux/fs.h:12,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/asm/processor.h:73: error: array type has incomplete element type
In file included from /home/fudancs/linux/include/linux/fs.h:201,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/asm/byteorder.h:14: warning: type qualifiers ignored on function return type
/home/fudancs/linux/include/asm/byteorder.h:28: warning: type qualifiers ignored on function return type
In file included from /home/fudancs/linux/include/linux/byteorder/little_endian.h:11,
from /home/fudancs/linux/include/asm/byteorder.h:45,
from /home/fudancs/linux/include/linux/fs.h:201,
from /home/fudancs/linux/include/linux/capability.h:17,
from /home/fudancs/linux/include/linux/binfmts.h:5,
from /home/fudancs/linux/include/linux/sched.h:9,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/linux/byteorder/swab.h:132: warning: type qualifiers ignored on function return type
/home/fudancs/linux/include/linux/byteorder/swab.h:145: warning: type qualifiers ignored on function return type
/home/fudancs/linux/include/linux/byteorder/swab.h:159: warning: type qualifiers ignored on function return type
In file included from /home/fudancs/linux/include/linux/sched.h:23,
from /home/fudancs/linux/include/linux/mm.h:4,
from /home/fudancs/linux/include/linux/slab.h:14,
from /home/fudancs/linux/include/linux/proc_fs.h:5,
from init/main.c:15:
/home/fudancs/linux/include/linux/smp.h:29: error: conflicting types for ‘smp_send_reschedule’
/home/fudancs/linux/include/asm/smp.h:65: error: previous declaration of ‘smp_send_reschedule’ was here
In file included from /home/fudancs/linux/include/linux/unistd.h:9,
from init/main.c:17:
/home/fudancs/linux/include/asm/unistd.h:360: warning: conflicting types for built-in function ‘_exit’
make: *** [init/main.o] Error 1


然后就终止了...
sharkhuang 2005-08-29
  • 打赏
  • 举报
回复
make mrproper
make menuconfig
make bzImage
make clean
make modules
make modules_install
wolfaska 2005-08-29
  • 打赏
  • 举报
回复
取掉检测
Kanglase 2005-08-29
  • 打赏
  • 举报
回复
也试了
一共就那几条命令
我把几乎所有的顺序都试了...
sigh...太郁闷了
flinymengw4u 2005-08-29
  • 打赏
  • 举报
回复
先make clean
make dep
make bzImage

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧