由一道笔试题想到的:原码反码和补码
时间:2010-11-24
来源:互联网
有一个简单的helloworld驱动程序,只有基本的安装和卸载功能,并打印出语句。现在已经在PC上编译出.ko模块,然后insmod加载到内核,这些都已经实现了。现在我想把这个驱动加载到2440开发板的嵌入式linux上,于是arm-linux-gcc交叉编译,但是报错了,请问如何解决?
我的配置:PC机ubuntu9.04,2.6.28,arm-linux-gcc 4.3.3; 开发板2440,linux 2.6.30
Makefile如下:
# Makefile 2.6
obj-m += hello.o
CC=arm-linux-gcc
KDIR:=/lib/modules/$(shell uname -r)/build
#PWD=$(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
报错:
root@xdh-laptop:/home/xdh/helloworld# make
make -C /lib/modules/2.6.28-11-generic/build M=/home/xdh/helloworld modules
make[1]: 正在进入目录 `/usr/src/linux-headers-2.6.28-11-generic'
CC [M] /home/xdh/helloworld/hello.o
Assembler messages:
Error: unknown architecture `i586'
Error: unrecognized option -march=i586
cc1: error: unrecognized command line option "-m32"
cc1: error: unrecognized command line option "-mregparm=3"
cc1: error: unrecognized command line option "-mpreferred-stack-boundary=2"
cc1: error: unrecognized command line option "-mno-sse"
cc1: error: unrecognized command line option "-mno-mmx"
cc1: error: unrecognized command line option "-mno-sse2"
cc1: error: unrecognized command line option "-mno-3dnow"
/home/xdh/helloworld/hello.c:1: error: bad value (generic) for -mtune= switch
/home/xdh/helloworld/hello.c:1: error: bad value (i586) for -march= switch
make[2]: *** [/home/xdh/helloworld/hello.o] 错误 1
make[1]: *** [_module_/home/xdh/helloworld] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-2.6.28-11-generic'
make: *** [all] 错误 2
我的配置:PC机ubuntu9.04,2.6.28,arm-linux-gcc 4.3.3; 开发板2440,linux 2.6.30
Makefile如下:
# Makefile 2.6
obj-m += hello.o
CC=arm-linux-gcc
KDIR:=/lib/modules/$(shell uname -r)/build
#PWD=$(shell pwd)
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
报错:
root@xdh-laptop:/home/xdh/helloworld# make
make -C /lib/modules/2.6.28-11-generic/build M=/home/xdh/helloworld modules
make[1]: 正在进入目录 `/usr/src/linux-headers-2.6.28-11-generic'
CC [M] /home/xdh/helloworld/hello.o
Assembler messages:
Error: unknown architecture `i586'
Error: unrecognized option -march=i586
cc1: error: unrecognized command line option "-m32"
cc1: error: unrecognized command line option "-mregparm=3"
cc1: error: unrecognized command line option "-mpreferred-stack-boundary=2"
cc1: error: unrecognized command line option "-mno-sse"
cc1: error: unrecognized command line option "-mno-mmx"
cc1: error: unrecognized command line option "-mno-sse2"
cc1: error: unrecognized command line option "-mno-3dnow"
/home/xdh/helloworld/hello.c:1: error: bad value (generic) for -mtune= switch
/home/xdh/helloworld/hello.c:1: error: bad value (i586) for -march= switch
make[2]: *** [/home/xdh/helloworld/hello.o] 错误 1
make[1]: *** [_module_/home/xdh/helloworld] 错误 2
make[1]:正在离开目录 `/usr/src/linux-headers-2.6.28-11-generic'
make: *** [all] 错误 2
作者: foxrommel 发布时间: 2010-11-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28