编译内核2.3.4遇到的问题以及解决方案

前段时间编译了linux2.6.34的内核,我的linux是12.0.4ubuntu ,以下是我在编译内核时候遇到的问题。

第一个错误

  1. Unable to find the ncurses libraries or the  
  2.  *** required h *** 'make menuconfig' requires the ncurses libraries.  
  3.  ***   
  4.  *** Install ncurses (ncurses-devel) and try again.   
解决办法:

1. 根据提示,需要安装ncurses-devel的库,但是,通过命令


[plain]  view plain copy print ?
  1. sudo apt-cache search ncurses-devel  
查不到任何信息;

通过命令

[plain]  view plain copy print ?
  1. sudo apt-cache search ncurses  
查到N多信息;

光是以libncurses开头的就有这么多:

[html]  view plain copy print ?
  1. libncurses-gst - Ncurses bindings for GNU Smalltalk  
  2. libncurses-ruby - Transitional package for ruby-ncurses  
  3. libncurses-ruby1.8 - Transitional package for ruby-ncurses  
  4. libncurses-ruby1.9 - Transitional package for ruby-ncurses  
  5. libncurses-ruby1.9.1 - Transitional package for ruby-ncurses  
  6. libncursesada-doc - Ada binding to the ncurses text interface library: documentation  
  7. libncursesada1 - Ada binding to the ncurses text interface library: shared library  
  8. libncursesada1-dbg - Ada binding to the ncurses text interface library: debug symbols  
  9. libncursesada1-dev - Ada binding to the ncurses text interface library: development  
2. 放狗搜一下,看到说只要安装libncurses5-dev就够了。
[html]  view plain copy print ?
  1. sudo apt-get install libncurses5-dev  
 

第二个错误
gcc: 错误: elf_i386:没有那个文件或目录
make[2]: *** [arch/x86/vdso/vdso32-int80.so.dbg] 错误 1
make[1]: *** [arch/x86/vdso] 错误 2
make: *** [sub-make] 错误 2


原因是 gcc 4.6 不再支持 linker-style 架构。

修改:
1.在内核目录arch/x86/vdso/Makefile中,大约在28,29行 找到 VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -Wl,-soname=linux-vdso.so.1 \   -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 把"-m elf_x86_64" 替换为 "-m64"

2然后再继续找,大约在72行左右,找到VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -Wl,-soname=linux-gate.so.1中的 "-m elf_i386" 替换为 "-m32"


第三个错误
Ubuntu12.0.4自带的GCC是4.6.3,会出现编译错误,所以需要安装GCC-4.4.7。

Install GCC 4.4

First, install GCC 4.4 (and friends):

apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

Set 4.4 to be the default

Then set 4.4 to be higher priority than 4.6:

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50


附上三个地址:
http://blog.csdn.net/david_xtd/article/details/7838706
http://blog.csdn.net/liuqinstudy/article/details/9015145
http://blog.sina.com.cn/s/blog_6b46b17f010195w3.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值