我正在尝试使用 crosstool-ng 1.15.3 为 raspberryPi(arm)交叉编译一个(示例)linuxmodule。
我得到以下输出:
markus@markus-R55S:~/Desktop/speakerarm$ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi-
make -C /lib/modules/3.2.0-35-generic-pae/build SUBDIRS=/home/markus/Desktop/speakerarm modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-35-generic-pae'
CC [M] /home/markus/Desktop/speakerarm/speaker.o
In file included from /usr/src/linux-headers-3.2.0-35-generic-pae/arch/arm/include/asm/types.h:4:0,
from include/linux/types.h:4,
from include/linux/list.h:4,
from include/linux/module.h:9,
from /home/markus/Desktop/speakerarm/speaker.c:1:
include/asm-generic/int-ll64.h:11:29: fatal error: asm/bitsperlong.h: No such file or directory
compilation terminated.
make[2]: *** [/home/markus/Desktop/speakerarm/speaker.o] Error 1
make[1]: *** [_module_/home/markus/Desktop/speakerarm] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-35-generic-pae'
make: *** [default] Error 2
我想包含路径有问题。我的主机有内核 3.2.35,我的目标机器是 3.2.27+。我的错误是什么?Makefile 包含以下内容:
obj-m := speaker.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules