我自己写了一个简单的helloworld.c的驱动程序,想insmod后打印"hello world",可是在make 后出现了一下问题:
[board]$make
PWD=/opt/freescale/project/board
make -C /opt/git M=/opt/freescale/project/board
make[1]: Entering directory `/opt/git'
LD /opt/freescale/project/board/built-in.o
CC [M] /opt/freescale/project/board/hellokernel_01.o
Building modules, stage 2.
MODPOST 1 modules
CC /opt/freescale/project/board/hellokernel_01.mod.o
LD [M] /opt/freescale/project/board/hellokernel_01.ko
arm-poky-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
arm-poky-linux-gnueabi-ld: use the --help option for usage information
make[2]: *** [/opt/freescale/project/board/hellokernel_01.ko] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/opt/git'
make: *** [all] Error 2
另附上Makefile信息:
1 ifneq ($(KERNELRELEASE),)
2 obj-m += hellokernel_01.o
3 else
4 KERNELDIR=/opt/git
5 all:
6 PWD=$(shell pwd)
7 make -C $(KERNELDIR) M=$(PWD)
8
9 clean:
10 rm -rf .*.cmd *.o *.mod.c *.ko .tmp_versions module* Module*:)
11 endif
对于make后出错的问题,求教各位大神支招,不胜感激:) |