- 論壇徽章:
- 0
|
arm hello模塊make時(shí)錯(cuò)誤
宿主機(jī)環(huán)境:PC 虛擬機(jī) Linux(2.6.18-53.el5)_redhat gcc(4.3.2)
目標(biāo)機(jī):arm Linux(2.6.29) mini2440 hello.ko模塊在本開發(fā)板掛載
出現(xiàn)以下錯(cuò)誤:
[root@localhost arm_hello_module_makefile]# ls
hello.c Makefile
[root@localhost arm_hello_module_makefile]# make
make -C /home/sun/linux-2.6.29/ M=/temp/arm_hello_module_makefile modules ARCH=arm CROSS_COMPILE=arm-linux-
make[1]: Entering directory `/home/sun/linux-2.6.29'
CC [M] /temp/arm_hello_module_makefile/hello.o
In file included from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /temp/arm_hello_module_makefile/hello.c:1:
include/linux/mmzone.h:18:26: error: linux/bounds.h: No such file or directory
include/linux/mmzone.h:256:5: warning: "MAX_NR_ZONES" is not defined
In file included from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /temp/arm_hello_module_makefile/hello.c:1:
include/linux/mmzone.h:290: error: 'MAX_NR_ZONES' undeclared here (not in a function)
/temp/arm_hello_module_makefile/hello.c:10: warning: function declaration isn't a prototype
/temp/arm_hello_module_makefile/hello.c:16: warning: function declaration isn't a prototype
make[2]: *** [/temp/arm_hello_module_makefile/hello.o] Error 1
make[1]: *** [_module_/temp/arm_hello_module_makefile] Error 2
make[1]: Leaving directory `/home/sun/linux-2.6.29'
make: *** [all] Error 2
Makefile文件內(nèi)容如下:
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KDIR := /home/sun/linux-2.6.29/
all:
make -C $(KDIR) M=$(PWD) modules ARCH=arm CROSS_COMPILE=arm-linux-
clean:
rm -f *.ko *.o *.mod.o *.mod.c *.symvers
endif
|
|