内核编译错误解答(elf_i386错误)

内核编译错误解答(elf_i386错误)
在编译内核过程中遇到的问题及解决方法:
1.root@org:/usr/src/linux# make menuconfig
 *** Unable to find the ncurses librariesor the
 *** required header files.
 *** 'make menuconfig' requires thencurses libraries.
 ***
 *** Install ncurses (ncurses-devel) andtry again.
 ***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2

解决方法:
根据网上资料的提示进行如下的安装过程:
1.sudo apt-get install ncurses
如果安装失败,软件包ncurses还没有可供安装的候选者.就先安装libncurses*
2.sudo apt-get install libncurses*

问题2.make bzImage或make或make modules提示如下错误(这个错误不是每个人都会遇到的,可以用gcc--help查看你的gcc版本,如果你的版本是4.6或者4.6之后的应该会有下面的问题,如果比4.6的早就不会出现这个问题):
gcc: 错误: elf_i386:没有那个文件或目录
make[2]: *** [arch/x86/vdso/vdso32-int80.so.dbg] 错误 1
make[1]: *** [arch/x86/vdso] 错误 2
make: *** [arch/x86] 错误 2
解决方法:
这个问题是由于 gcc 4.6 不再支持 linker-style 架构。将arch/x86/vdso/Makefile 中,
以VDSO_LDFLAGS_vdso.lds 开头所在行的 "-m elf_x86_64" 替换为 "-m64"。
以VDSO_LDFLAGS_vdso32.lds 开头所在行的 "-m elf_x86" 替换为 "-m32"。

 

推荐:最好使用之前的Gcc工具链


原文地址:https://www.cnblogs.com/xj626852095/p/3648251.html