Reputation:
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;
}
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?
Upvotes: 1
Views: 1040
Reputation:
The compiler was using the wrong assembler. I had to specify the prefix with -B/opt/local/arm-elf-
Upvotes: 2
Reputation: 43280
Reads like the compiler spat out assembly the assembler couldn't read. Check for mismatches.
Upvotes: 0