主题 : 编译内核问题 复制链接 | 浏览器收藏 | 打印
级别: 侠客
UID: 95531
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2013-08-16
最后登录: 2014-04-04
楼主  发表于: 2014-03-20 14:06

 编译内核问题

以前编译内核都是十几二十秒,只是重新编译修改过的文件,但是执行了
make CONFIG_DEBUG_SECTION_MISMATCH=y之后,每次编译都很久,感觉是全部重新编译一次,各位大大有什么办法修改吗?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2014-03-20 19:16
这是lib/Kconfig.debug里对这个选项的描述:

          The section mismatch analysis checks if there are illegal
          references from one section to another section.
          During linktime or runtime, some sections are dropped;
          any use of code/data previously in these sections would
          most likely result in an oops.
          In the code, functions and variables are annotated with
          __init, __devinit, etc. (see the full list in include/linux/init.h),
          which results in the code/data being placed in specific sections.
          The section mismatch analysis is always performed after a full
          kernel build, and enabling this option causes the following
          additional steps to occur:
          - Add the option -fno-inline-functions-called-once to gcc commands.
            When inlining a function annotated with __init in a non-init
            function, we would lose the section information and thus
            the analysis would not catch the illegal reference.
            This option tells gcc to inline less (but it does result in
            a larger kernel).
          - Run the section mismatch analysis for each module/built-in.o file.
            When we run the section mismatch analysis on vmlinux.o, we
            lose valueble information about where the mismatch was
            introduced.
            Running the analysis for each module/built-in.o file
            tells where the mismatch happens much closer to the
            source. The drawback is that the same mismatch is
            reported at least twice.
          - Enable verbose reporting from modpost in order to help resolve
            the section mismatches that are reported.

也就是说,打开这个选项之后会在编译过程中检查所有的module/built-in.o, 这可能就是你感觉编译时间变长的原因。
事实上,除非你遇到问题,一般情况下不需要使用这个选项。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 侠客
UID: 95531
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2013-08-16
最后登录: 2014-04-04
2楼  发表于: 2014-03-21 11:16

 回 1楼(kasim) 的帖子

那要怎么改回只编译更新部分
级别: 侠客
UID: 95531
精华: 0
发帖: 58
金钱: 290 两
威望: 58 点
综合积分: 116 分
注册时间: 2013-08-16
最后登录: 2014-04-04
3楼  发表于: 2014-03-21 11:39

 回 1楼(kasim) 的帖子

YES!!!解决了,谢谢提醒!!!