【问题标题】:errors while compiling kernel on ubuntu在 ubuntu 上编译内核时出错
【发布时间】:2012-06-05 22:25:54
【问题描述】:

我在安装在 windows 7 pc 上的 vmware 上使用 ubuntu 12.04...我试图编译 linux-2.6.0 源文件(从 kernel.org 下载)...我按照网上所说的步骤进行操作但是有问题...

所以我搜索了一下,发现this...我按照答案中的方式进行操作,但在执行第二步之后,当我继续执行第三步(make menuconfig)时,我得到以下信息错误..

make[1]: `scripts/fixdep' is up to date.
HOSTCC  scripts/kconfig/mconf.o
scripts/kconfig/mconf.c:91:21: error: static declaration of ‘current_menu’ follows
non-static declaration
scripts/kconfig/lkc.h:63:21: note: previous declaration of ‘current_menu’ was here
scripts/kconfig/mconf.c: In function ‘show_textbox’:
scripts/kconfig/mconf.c:553:7: warning: ignoring return value of ‘write’, declared with
attribute warn_unused_result [-Wunused-result]
scripts/kconfig/mconf.c: In function ‘exec_conf’:
scripts/kconfig/mconf.c:225:6: warning: ignoring return value of ‘pipe’, declared with
attribute warn_unused_result [-Wunused-result]
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2

当我使用 make xconfig 时发生同样的错误...请告诉我应该怎么做?提前致谢。

【问题讨论】:

  • 使用Linux 2.6.0的原因是什么,已经有~9年了?
  • 我正在研究操作系统,想从一个较早的简单版本开始
  • Linux 2.6.0 和 Linux 3.2 之间的差异不会那么大。
  • 我非常怀疑您是否能够从 Ubuntu 12.04 获得与用户空间一起工作的 2.6.0 内核。 3.x 和 2.6.0 之间的复杂性没有重大差异,因此您不会通过研究旧内核获得任何收益。如果有的话,研究一个 small 内核,比如 Minix 甚至 Linux 0.x。

标签: compiler-errors linux-kernel kernel


【解决方案1】:

Here is the answer 只需从 scripts/kconfig/mconf.c 中的 'static struct menu *current_ment' 行中删除 'static' 关键字

【讨论】:

    【解决方案2】:

    'current_menu' 在 mconf.c:91 中声明为静态,但在 lkc.h:63 中未声明,这可能不被当前版本的 gcc 接受,根据 2.6.0 源中的 README 建议使用 gcc-2.95.3 ,所以如果你真的想编译 2.6.0,请尝试降级你的 gcc 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多