|
spca5xx-20060402编译完成后,加载时出现spca5xx.o:ELF file spca5xx.o not for this architectur
[复制链接]
解压完成后,对makefile的修改。
我的开发板内核是2.4.18_rmk7_pxa1。。。。。
##########modified by ly44770################
#ifneq ($(shell uname -r | cut -d. -f1,2), 2.4)
#ifneq ($(KERNELRELEASE),) # We were called by kbuild
#CFLAGS += $(DEFINES)
#obj-m += spca5xx.o
#spca5xx-objs := drivers/usb/spca5xx.o drivers/usb/spcadecoder.o
#else # We were called from command line
#KERNEL_VERSION = `uname -r`
#KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
#PWD := $(shell pwd)
#MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/media/
# Targets, don't change!
#default:
# @echo ' Building SPCA5XX driver for 2.5/2.6 kernel.'
# @echo ' Remember: you must have read/write access to your kernel source tree.'
# $(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) CC=$(CC) modules
#install:
# mkdir -p $(MODULE_INSTALLDIR)
# rm -f $(MODULE_INSTALLDIR)spca50x.ko
# rm -f $(MODULE_INSTALLDIR)et61x.ko
# install -c -m 0644 spca5xx.ko $(MODULE_INSTALLDIR)
# /sbin/depmod -ae
#uninstall:
# rm -f $(MODULE_INSTALLDIR)/spca5xx.ko
# /sbin/depmod -aq
#endif
#else # kernel version test
###############modified end########################
上边这一大段通通注释掉,:-)。
#KERNEL_VERSION = `uname -r`这句改成:
KERNEL_VERSION = 2.4.18_rmk7_pxa1
这几个变量根据自己的需要修改如下:
KINCLUDE = /armsys2410/kernel/include
KERNEL_ACFILE = $(KINCLUDE)/linux/autoconf.h
KERNEL_MODVERSIONSFILE = $(KINCLUDE)/linux/modversions.h
#MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/
CC = arm-linux-gcc
LD = arm-linux-ld
#CFLAGS += -mpreferred-stack-boundary=2 这个注释掉,否则编译通不过,:-)。
#CFLAGS += -I$(KINCLUDE) -Idrivers/usb
CFLAGS += -I/armsys2410/kernel/include -Idrivers/usb
最后注释掉:
#endif # End kernel version test
然后编译Make,加载insmod spca5xx.o
但是出现
spca5xx.o:ELF file spca5xx.o not for this architecture
请高手指点,到底是什么原因勒?
|
|