最近在编译一个新的rk sdk的时候,编译内核报错

  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  TIMEC   kernel/timeconst.h
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/home/liuxueneng/workCode/rk3066/kernel/kernel/Makefile:141: recipe for target 'kernel/timeconst.h' failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:973: recipe for target 'kernel' failed
make: *** [kernel] Error 2

显示错误

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

已经提示纤细的错误信息在哪里了,打开timeconst.ps看一下

 372        @val = @{$canned_values{$hz}};                                        
 373         if (!defined(@val)) {                                                          
 374                 @val = compute_values($hz);                                   
 375         }                                                                     
 376         output($hz, @val);

 

改成如下就可以编译了

 

 372        @val = @{$canned_values{$hz}};                                        
 373         if (!@val) {                                                          
 374                 @val = compute_values($hz);                                   
 375         }                                                                     
 376         output($hz, @val);

参考http://blog.5ibc.net/p/48570.html

查了一下更新,发现其中有一项是perl版本升级到了 v5.22.1,然后查了perl官方文档,发现官网因为一个bug,该版本将defined(@array)去掉了。可以直接使用数组判断非空。

转载于:https://www.cnblogs.com/tid-think/p/10929435.html

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐