compile kernel error-- size of unnamed array is negative无名数组的大小为负

   今天在编译linux内核的时候遇到如下错误提示:

include/linux/rcupdate.h: 在函数‘__kfree_rcu’中:
include/linux/rcupdate.h:822:2: 错误: 无名数组的大小为负
对应的英文错误是:

include/linux/rcupdate.h:function ‘__kfree_rcu’:
include/linux/rcupdate.h:808:2: error: size of unnamed array is negative


Makefile文件如下:

obj-m	+= 8139cp.o
KDIR	= /dir/to/linux-3.0.1

EXTRA_CFLAGS=-g  -O0

build:kernel_modules

kernel_modules:
	make -C $(KDIR) M=$(CURDIR) modules

clean:
	make -C $(KDIR) M=$(CURDIR) clean 



经过网上搜索发现原来在某些函数中是不允许用 -O0 ,优化等级来编译的。

修改为 -O1 或者 -O2 可以顺利编译通过。




你可能感兴趣的:(compile kernel error-- size of unnamed array is negative无名数组的大小为负)