本文转载自:http://sunyongfeng.com/201701/programmer/linux/kernel_compile_fail.html

编译内核出现以下错误

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.

/root/working/Hi3520D_SDK_V2.0.3.0/osdrv/kernel/linux-3.0.y/kernel/Makefile:140: 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

解决办法:

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

05-08 15:48