Chinaunix首页 | 论坛 | 博客
  • 博客访问: 312798
  • 博文数量: 53
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 598
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-09 13:20
文章分类

全部博文(53)

文章存档

2011年(2)

2010年(22)

2009年(29)

我的朋友

分类: 嵌入式

2009-11-23 14:52:34

我们在交叉编译的时候可能会遇到下面两个问题,
1、
cc1: error: unrecognized command line option "-m64"
cc1: error: unrecognized command line option "-mno-red-zone"
cc1: error: unrecognized command line option "-mcmodel=kernel"
cc1: error: unrecognized command line option "-maccumulate-outgoing-args"
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"

解决办法:
因为这是交叉编译,需要指定机器类型
export ARCH=arm
 
 
2、
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
ld: /home/aa/Desktop/learn/completion/completion/complete.o: Relocations in generic ELF (EM: 40)
/home/aa/Desktop/learn/completion/completion/complete.o: could not read symbols: File in wrong format
出现这个问题说明gcc是arm的了,但是ld还是pc的
我用
export PATH=/usr/local/arm-linux-gcc4.1.1/bin:$PATH
好像仍然不行,必须使用:
export CROSS_COMPILE=/usr/local/arm-linux-gcc4.1.1/bin/arm-linux-
问题解决了
阅读(17271) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~