[ERROR] Linux kernel compile error elf_x86_64 missing

错误一:

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值