前段时间编译了linux2.6.34的内核,我的linux是12.0.4ubuntu ,以下是我在编译内核时候遇到的问题。
第一个错误
- Unable to find the ncurses libraries or the
- *** required h *** 'make menuconfig' requires the ncurses libraries.
- ***
- *** Install ncurses (ncurses-devel) and try again.
解决办法:
1. 根据提示,需要安装ncurses-devel的库,但是,通过命令
查不到任何信息;
通过命令
查到N多信息;
光是以libncurses开头的就有这么多:
2. 放狗搜一下,看到说只要安装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 架构。
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