编译内核错误:Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373

Recently compiled a new rk sdk when compiling the kernel error

  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

Display error

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

Where it has prompted an error message in a slim, open look timeconst.ps

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

 

It can be compiled into the following

 

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

Reference http://blog.5ibc.net/p/48570.html

Update checked and found that an upgrade to a version of perl v5.22.1, and then check the perl official documents, found the official website because of a bug, this version will be defined (@array) removed. Analyzing the array may be used as a non-empty.

Guess you like

Origin www.cnblogs.com/tid-think/p/10929435.html