Linux kernel compile error elf_x86_64 missing

本小妞迷上赌 提交于 2020-05-13 19:18:07

问题


I'm using Ubuntu Linux 12.04 with the 3.11 kernel.

For my work I have to patch the kernel to make it realtime able.

So I downloaded the Linux 2.6.31.6 kernel with the patch and tried to patch, compile and instal it.

While I try to compile it there comes this error:

CC      arch/x86/vdso/vgetcpu.o
CC      arch/x86/vdso/vvar.o
VDSO    arch/x86/vdso/vdso.so.dbg

gcc: Error: elf_x86_64: File or directory not found
make[2]: *** [arch/x86/vdso/vdso.so.dbg] Error 1
make[1]: *** [arch/x86/vdso] Error 2
make: *** [arch/x86] Error 2

For the compilation of the RT 2.6... kernel I use the same configfile like the 3.11 (with some edited points of course) and I looked into the /arch/x86/vdso directory and the vdso.so.dbg file is missing (and I don't know where to get it).

I hope you can help me and if you need some further informations I will try to provide them.

Yours sincerely Adrian


回答1:


I changed in arch/x86/vdso/Makefile

VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 [...]
...
VDSO_LDFLAGS_vdso32.lds = -m elf_x86 [...]

to

VDSO_LDFLAGS_vdso.lds = -m64 [...]
...
VDSO_LDFLAGS_vdso32.lds = -m32 [...]



回答2:


The problem is how gcc is getting some flags from arch/x86/vdso/Makefile. Replacing the

VDSO_LDFLAGS_vdso.lds = -m elf_x86_64

with

VDSO_LDFLAGS_vdso.lds = -m64

should work.



来源:https://stackoverflow.com/questions/22662906/linux-kernel-compile-error-elf-x86-64-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!