kernel编译报Can't use 'defined(@array)'问题

xiaoxiao2021-02-28  106

在编译LINUX3.3内核时,报了一个  错误:

TIMEC   kernel/timeconst.h Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373. /mnt/WORKSPACE/omapl138/kernel/linux-3.3/kernel/Makefile:130: recipe for target 'kernel/timeconst.h' failed make[1]: *** [kernel/timeconst.h] Error 255 Makefile:945: recipe for target 'kernel' failed make: *** [kernel] Error 2 make: *** 正在等待未完成的任务....   CC      fs/super.o

最后调查发现是和所使用的UBUNTU版本有关系,在使用ubuntu 16.04编译时,报这个错误;

使用ubuntu 12.04编译时,不会报这个错误。

 

依照编译器的提示kernel/timeconst.pl line 373,在ubuntu16.04中可以通过修改kernel/timeconst.pl的第373行:

把if (!defined(@val))修改成

 #if (!defined(@val))  if (!@val){   @val = compute_values($hz);  }

即可以修正这个问题。

之前看网页上有介绍可能和64位机器环境有关系,ubuntu16.04和ubuntu12.04都是32位的虚拟机,应该和64位无关。

转载请注明原文地址: https://www.6miu.com/read-44031.html

最新回复(0)