编译Linux内核时出现错误gcc: error: elf_i386: No such file or directory

LD arch/x86/mm/built-in.o
AS arch/x86/vdso/vdso32/int80.o
VDSO arch/x86/vdso/vdso32-int80.so.dbg
gcc: error: elf_i386: No such file or directory
make[2]: *** [arch/x86/vdso/vdso32-int80.so.dbg] Error 1
make[1]: *** [arch/x86/vdso] Error 2
make: *** [arch/x86] Error 2
[email protected]:/linux-2.6.34.14/linux-2.6.34.7#

编译内核时出现上述错误,

看一下gcc编译器版本:

[email protected]:/linux-2.6.34.14/linux-2.6.34.7# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion=‘Ubuntu/Linaro 4.6.3-1ubuntu5‘ --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
[email protected]:/linux-2.6.34.14/linux-2.6.34.7#

编译器是gcc-4.6.3的,编译器版本太高,对于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"

然后继续编译,就可以了。

时间: 2025-01-11 19:25:42

编译Linux内核时出现错误gcc: error: elf_i386: No such file or directory的相关文章

minGW安装出错gcc: error: CreateProcess: No such file or directory

我用的是在线安装的方式,调试的时候,出现以下错误: 23:23:45 **** Rebuild of configuration Debug for project helloworld_c ****Info: Internal Builder is used for buildgcc -O0 -g3 -Wall -c -fmessage-length=0 -o helloworld.o "..\\helloworld.c" gcc: error: CreateProcess: No 

编译Linux内核

这篇文章的目的是帮助理解如何编译一版Linux内核.熟悉Kconfig KBuild工具.无论是自己修改自己正在使用linux内核还是做嵌入式的交叉编译,都会有一些帮助. 内核编译体系 如果大家接触过一些Linux下的开源软件,就会知道它们使用 autotools 来进行配置及编译.通过执行./config --> make --> make install 命令来编译源代码.Linux内核的编译也需要先配置再编译.配置使用 Kconfig , 编译使用 KBuild , 这两个工具支撑起了L

如何解决编译linux内核(解决声卡问题),遭遇fatal error: linux/limits.h: 没有那个文件或目录

最近帮一位上海的朋友搞一块小板,在ubuntu15.04 vivid上已经加载了对应了.ko驱动包 但关键是系统根本就枚举不到该声卡ALC5640,试了OpenSUSE也是一样的结果,看来是内核漏加载了什么模块. 所以准备重新编译Linux内核3.19.3,结果运行: make?menuconfig 得到错误提示: ? ? ? ? local_lim.h:38:26: fatal error: linux/limits.h ? 应该是在linux目录下找不到limits.h文件.有诸多兄弟碰到过

编译依赖于React Native0.46.4的React Native IOS工程时,出现错误“fatal error: 'React/RCTEventEmitter.h' file not found”

我的环境: WebStorm 2017.2Build #WS-172.3317.70, built on July 14, 2017 JRE: 1.8.0_152-release-915-b5 x86_64JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.12.6 Xcode8.3.3(8E3004b) 网上搜索,可以解决我的问题的网址:https://stackoverflow.com/questions/41663002

Vs2012在Linux开发中的应用(8): 编译Linux内核

快乐虾 http://blog.csdn.net/lights_joy/ 欢迎转载,但请保留作者信息 在有了UBOOT的编译基础之后,编译Linux内核就简单多了,所不同的只有两个地方,一个是错误信息的转换,另一个是内核需要进行参数配置. 1.1    错误信息转换 UBOOT的错误信息中,文件名是不带路径的,而内核的错误信息中,文件名是带相对路径的,因此我们对转换脚本略做修改: #user code begin classCUBootMake: error=False defBuild(sel

自定义配置编译linux内核

1 编译linux内核原因一般情况下,我们是不需要重新去编译linux内核的,但如果你发现你需要修改内核的某个部分或者说你需要的某个模块并没有编译进内核,那里你可以通过重新编译内核来满足你的需求,比如当我们需要用bcache时,但默认bcache是没有编译进内核的,我们可以通过修改编译配置文件,将bcache编译进内核,以下的编译操作均是在Centos7.3平台上进行的演示. 2 编译前准备工作2.1 编译用户身份选择官方是强调编译linux内核是强烈不建议以root身份来进行编译的,因为这样有

决Ubuntu使用`make menuconfig`配置Linux 内核时,出现缺少'ncurses-devel'库支持。

*** Unable to find the ncurses libraries or the *** required header files. *** 'make menuconfig' requires the ncurses libraries. *** *** Install ncurses (ncurses-devel) and try again. ***  1. 问题状况 一般情况下使用系统自带的软件管理器apt-get就可以安装了(`sudo apt-get install 

学习重新编译Linux内核

一.实验目的学习重新编译Linux内核,理解.掌握Linux内核和发行版本的区别. 二.实验内容在Linux操作系统环境下重新编译内核.实验主要内容:A. 查找并且下载一份内核源代码,本实验使用最新的Linux内核2.6.36.B. 配置内核.C. 编译内核和模块.D. 配置启动文件.本次实验环境是Linux2.6.35内核的环境下,下载并重新编译内核源代码(2.6.36):然后,配置GNU的启动引导工具grub,成功运行编译成功的内核. 三.主要仪器设备(必填)Linux环境:utuntu10

Linux下使用vi新建文件保存文件时遇到错误:E212: Can't open file for writing

出现E212: Can't open file for writing的问题是由于权限问题导致的,解决方法有以下思路: 1.使用root进行登录,然后再操作. 2.在使用命令时,前面加sudo. 3.如果是多级文件夹的文件时,由于这个文件夹没有创建,所以要先创建这个文件夹,再来操作这个文件. Linux下使用vi新建文件保存文件时遇到错误:E212: Can't open file for writing