有什么不对我的交叉编译? [英] What is wrong with my cross compiler?

查看:288
本文介绍了有什么不对我的交叉编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一个基本程序,我可以交叉编译在我的Mac。我运行Mac OS X的小牛队。我的交叉编译器是arm-ELF-GCC-4.7.3。我写了一个简单的测试程序,它看起来像:

I am trying to compile a basic program that i can get to cross compile on my mac. I am running Mac OS X Mavericks. My cross compiler is arm-elf-gcc-4.7.3. I wrote a simple test program that looks like:

int main()
{
    ;
    return 0;
}

当我运行/opt/local/bin/arm-elf-gcc-4.7.3 -o测试test.c的我收到这些错误。

When I run /opt/local/bin/arm-elf-gcc-4.7.3 -o test test.c I receive these errors.

test.c:4:Unknown pseudo-op: .global
test.c:4:Rest of line ignored. 1st junk character valued 109 (m).
test.c:5:Unknown pseudo-op: .type
test.c:5:Rest of line ignored. 1st junk character valued 109 (m).
test.c:7:Junk character 64 (@).
test.c:7:Rest of line ignored. 1st junk character valued 32 ( ).
test.c:8:Junk character 64 (@).
test.c:8:Rest of line ignored. 1st junk character valued 32 ( ).
test.c:9:Junk character 64 (@).
test.c:9:Rest of line ignored. 1st junk character valued 32 ( ).
test.c:10:invalid char '[' beginning operand 2 `[sp'
test.c:11:too many memory references for `add'
test.c:12:expecting operand after ','; got nothing
test.c:13:too many memory references for `mov'
test.c:14:too many memory references for `add'
test.c:15:no such instruction: `ldmfd sp!, {fp}'
test.c:16:no such instruction: `bx lr'
test.c:17:Unknown pseudo-op: .size

什么是错我的交​​叉编译?

What is wrong with my cross compiler?

推荐答案

编译器使用了错误的汇编。我不得不指定preFIX与-B /选择/本地/ ARM-elf-

The compiler was using the wrong assembler. I had to specify the prefix with -B/opt/local/arm-elf-

这篇关于有什么不对我的交叉编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆