错误一:
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
解决方案:
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 [...]
原文:
https://stackoverflow.com/questions/22662906/linux-kernel-compile-error-elf-x86-64-missing
错误二:
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/home/muhe/linux_kernel/linux-2.6.32.1/linux-2.6.32.1/kernel/Makefile:129: recipe for target 'kernel/timeconst.h' failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:878: recipe for target 'kernel' failed
make: *** [kernel] Error 2
解决方案:(修改了kernel/timeconst.h这个地方defined(@val),修改成了@val)
@val = @{$canned_values{$hz}};
- if (!defined(@val)) {
+ if (!@val) {
@val = compute_values($hz);
}
output($hz, @val);
--
373c373
< if (!@val) {
---
> if (!defined(@val)) {
参考:
https://my.oschina.net/hanxiaodong/blog/755703
http://www.playpenguin.net/an-zhuo-nei-he-bian-yi-cuo-wu-kerneltimeconsth-definedval.html