下面的我写的makefile,我在2.4内核下编译通过了,而在2.6的内核下有错误

来源:百度知道 编辑:UC知道 时间:2024/05/27 05:06:20
# The path of kernel source code
INCLUDEDIR = /home/study/part2/lesson3/linux-2.4.18/include/

# Compiler
CC = arm-linux-gcc

# Options
CFLAGS = -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-mapcs -fno-strict-aliasing -fno-common -fno-common -pipe \
-mapcs-32 -march=armv4 -mtune=arm9tdmi -mshort-load-bytes \
-msoft-float -I$(I
NCLUDEDIR)

# Target
OBJS = sbc2410_leds.o

all: $(OBJS)

$(OBJS): sbc2410_leds.c
$(CC) $(CFLAGS) -c $<
$(CC) app-led.c -static -o app-led

install:
insmod $(OBJS)

uninstall:
rmmod sbc2410_leds

.PHONY: clean
clean:
rm -f *.o
rm -f app-led

我在2.4.18内核下编译通过了,而在2.6的内黑出现下面的问题,请问是什么原因,该怎么解决?(在2.4我用的交叉编译器的版本为2.95.3),在2.6.19下用的是armv5l-linux-gcc,)请问是交叉编译器的版本问题,还是LINUX内核的问题,该怎么解决?

arm-linux-gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-

参考答案日出东海落西山,愁也一天,喜也一天;遇事不钻牛角尖,人也舒坦,心也舒坦。

高版本的编译器不支持-mshort-load-bytes选项,改为-malignment-traps即可。
apcs-32估计也是相同原因。
参考:http://hi.baidu.com/wangy0919/blog/item/3c6ad535cc50d71390ef39fc.html