1: /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: not found
wihoog@ubuntu:/work/arm9_develop/linux-3.5$ make
make: /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc:命令未找到
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: 1: /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-gcc: not found
/work/arm9_develop/linux-3.5/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 127
Makefile:820: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
找到问题所在:因为我系统是64位的,需要安装32位库,执行下面语句便可安装
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.
2:Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
0、开发环境
Ubuntu16.04.1(64bit)
linux-2.6.39.4
1、错误描述
使用ubuntu14.04(64bit)编译linux2.6.39.4并没有出现什么错误,但是使用ubuntu16.04.1(64bit)编译linux-2.6.39.4时,却提示Can't use 'defined(@array)' (Maybe you should just omit the defined()?)错误。
2、解决方法
参考:编译kernel perl版本bug
最近升级了一下MAC系统,突然发现android的Linux kernel无法编译通过了,报了如下错误:
Can't use '!defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
其实,提示的错误信息已经明确告诉你了,你应该省略defined().
这里,我们打开 kernel/timeconst.pl
@val = @{$canned_values{$hz}};
if (!defined(@val)) {
@val = compute_values($hz);
}
output($hz, @val);
将if (!defined(@val)) 改为if (!(@val)),再次编译就可以通过了。
查了一下更新,发现其中有一项是perl版本升级到了 v5.22.1,然后查了perl官方文档,发现官网因为一个bug,该版本将defined(@array)去掉了。可以直接使用数组判断非空。