c - Cross-compiling of kernel module for ARM architecture -
i'm trying create .ko file arm linux x86 machine. tried next makefile:
1 obj-m +=helloworldtest_module.o 2 modules_install: 3 create arch=$(arch) cc=$(cross_compiler) -c /lib/modules/$(shell uname -r)/build m=$(pwd) modules 4 clean: 5 create -c /lib/modules/$(shell uname -r)/build m=$(pwd) clean
... got error on giving make -f makefile arch=arm cross_compiler=arm-linux-gnueabi-gcc
in command prompt follows:
make arch=arm cc=arm-linux-gnueabi-gcc -c /lib/modules/3.2.0-29-generic/build m=/home/terenesas/sample modules make[1]: entering directory `/usr/src/linux-headers-3.2.0-29-generic' cc [m] /home/terenesas/sample/helloworldtest_module.o in file included /usr/src/linux-headers-3.2.0-29-generic/arch/arm/include/asm/types.h:4:0, include/linux/types.h:4, include/linux/list.h:4, include/linux/module.h:9, /home/terenesas/sample/helloworldtest_module.c:2: include/asm-generic/int-ll64.h:11:29: fatal error: asm/bitsperlong.h: no such file or directory compilation terminated. make[2]: *** [/home/terenesas/sample/helloworldtest_module.o] error 1 make[1]: *** [_module_/home/terenesas/sample] error 2 make[1]: leaving directory `/usr/src/linux-headers-3.2.0-29-generic' make: *** [modules_install] error 2
what did wrong?
shell uname -r
means makefile build module host(x86) scheme , not arm.
you need specify source directory of arm kernel. may utilize next makefile cross-compile module.
makefile:
cc=$(cross_compile)gcc # if kernelrelease defined, we've been invoked # kernel build scheme , can utilize language. ifneq ($(kernelrelease),) obj-m := modulename.o # otherwise called straight command # line; invoke kernel build system. else kerneldir ?= /path/to/kernel/linux pwd := $(shell pwd) default: ${make} -c ${kernel_source} subdirs=${pwd} modules clean: ${make} -c ${kernel_source} subdirs=${pwd} clean endif
c linux makefile arm
No comments:
Post a Comment