交叉编译问题

我们在交叉编译的时候可能会遇到下面两个问题,
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
或者 make 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-
问题解决了

你可能感兴趣的:(linux)