[技术问题解答] Ubuntu14.04下基于i.mx6的简单helloworld.ko的编译问题

[复制链接]
1907|0
 楼主| lengfeng0313 发表于 2015-3-13 09:54 | 显示全部楼层 |阅读模式
我自己写了一个简单的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后出错的问题,求教各位大神支招,不胜感激:)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

2

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部