在新版linux上编译老版本的kernel出现kernel/timeconst.h] Error 255

在使用ubuntu16.4编译Linux-2.6.31内核时出现这样的错误

可以修改timeconst.pl的内容后正常编译。

以下是编译错误提示的内容:

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/opt/ARM/mini6410/linux/linux-2.6.38/kernel/Makefile:140: recipe for target 'kernel/timeconst.h' failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:916: recipe for target 'kernel' failed
make: *** [kernel] Error 2

将kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了

原文地址:https://www.cnblogs.com/zxc2man/p/6370603.html