免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2693 | 回复: 8
打印 上一主题 下一主题

新手请教:编译内核的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-07 10:22 |只看该作者 |倒序浏览
春节的时候开始研究这个,从网上搜集各种资料,gcc都以成功,到了最后了,开始make,在做make的时候,出现错误,不论make oldcomfig或者make menuconfig中怎么选择,都是一样的错误:

还请指教

make
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/lex.c
  SHIPPED scripts/genksyms/parse.h
  SHIPPED scripts/genksyms/keywords.c
  HOSTCC  scripts/genksyms/lex.o
scripts/genksyms/lex.c:1228: warning: ‘input’ defined but not used
  SHIPPED scripts/genksyms/parse.c
  HOSTCC  scripts/genksyms/parse.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/empty.o
  MKELF   scripts/elfconfig.h
  HOSTCC  scripts/file2alias.o
  HOSTCC  scripts/modpost.o
  HOSTLD  scripts/modpost
  SPLIT   include/linux/autoconf.h -> include/config/*
  CC      arch/x86_64/kernel/asm-offsets.s
In file included from include/linux/spinlock.h:16,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/x86_64/kernel/asm-offsets.c:7:
include/asm/processor.h:80: error: array type has incomplete element type
In file included from include/asm/smp.h:18,
                 from include/linux/smp.h:17,
                 from include/linux/sched.h:23,
                 from arch/x86_64/kernel/asm-offsets.c:7:
include/asm/mpspec.h:79: warning: ‘packed’ attribute ignored for field of type ‘unsigned char[6]’
In file included from include/asm/smp.h:22,
                 from include/linux/smp.h:17,
                 from include/linux/sched.h:23,
                 from arch/x86_64/kernel/asm-offsets.c:7:
include/asm/apic.h: In function ‘apic_write_atomic’:
include/asm/apic.h:33: warning: value computed is not used
In file included from include/linux/topology.h:35,
                 from include/linux/mmzone.h:297,
                 from include/linux/gfp.h:4,
                 from include/linux/slab.h:15,
                 from include/linux/percpu.h:4,
                 from include/linux/sched.h:31,
                 from arch/x86_64/kernel/asm-offsets.c:7:
include/asm/topology.h: At top level:
include/asm/topology.h:15: error: conflicting types for ‘cpu_online_map’
include/asm/smp.h:39: note: previous declaration of ‘cpu_online_map’ was here
include/asm/topology.h: In function ‘pcibus_to_cpumask’:
include/asm/topology.h:26: error: invalid operands to binary & (have ‘cpumask_t’ and ‘long unsigned int’)
In file included from include/linux/mmzone.h:297,
                 from include/linux/gfp.h:4,
                 from include/linux/slab.h:15,
                 from include/linux/percpu.h:4,
                 from include/linux/sched.h:31,
                 from arch/x86_64/kernel/asm-offsets.c:7:
include/linux/topology.h: In function ‘__next_node_with_cpus’:
include/linux/topology.h:50: error: incompatible types when assigning to type ‘cpumask_t’ from type ‘long unsigned int’
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1
make: *** [arch/x86_64/kernel/asm-offsets.s] Error 2

论坛徽章:
0
2 [报告]
发表于 2012-02-07 10:39 |只看该作者
你.config用错 或是你编译环境用错都有可能, 请检查

论坛徽章:
0
3 [报告]
发表于 2012-02-07 10:42 |只看该作者
哦,谢谢,新手,请指点怎么检查呢?

论坛徽章:
0
4 [报告]
发表于 2012-02-07 12:48 |只看该作者
你gcc ,kernel, 怎么来的,版本是多少, gcc 跟kernl版本太多了 有些不兼容或需要做修改,
config你怎么设的,我看你是想编x64的kernel ?你去找正确的config来用八

论坛徽章:
0
5 [报告]
发表于 2012-02-07 14:10 |只看该作者
嗯:以下是版本号:

gcc-4.6.12.tar.bz2,gmp-4.3.2.tar.bz2,mpc-0.8.1.tar.gz,mpfr-2.4.2.tar.bz2

kenel:linux-2.6.1.tar.xz

下载的地址是百度搜索的
gcc:Index of ftp://gcc.gnu.org/pub/gcc/infrastructure/
内核:http://www.kernel.org/

我是想看看相关qla2xxxx的驱动编译

论坛徽章:
0
6 [报告]
发表于 2012-02-07 15:57 |只看该作者
下了一个linux kernel :linux-3.2.2.tar.bz2

make一切顺利,真的是版本问题吗?新版本的gcc对数据类型检查特别严格吗?

论坛徽章:
0
7 [报告]
发表于 2012-02-07 15:58 |只看该作者
我需要用linux-2.6.1的。请问都要修改什么呢?望指教

论坛徽章:
0
8 [报告]
发表于 2012-02-07 16:27 |只看该作者
版本:linux-2.6.32.56.tar.bz2

也可以正常编译,就2.61的出错~~~~

需要改什么地方呢??请高手指教

论坛徽章:
0
9 [报告]
发表于 2012-02-09 15:02 |只看该作者
看来是过高的版本无法编译太低版本的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP