如何从命令行编译iOS ARM汇编代码?

时间:2015-07-07 13:31:30

标签: ios assembly compilation arm

我尝试使用命令行编译包含ARM代码的iOS项目。

这是命令行:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/as -arch armv6 engines/scumm/smush/codec47ARM.s -o engines/scumm/smush/codec47ARM.o

......以下是错误:

engines/scumm/smush/codec47ARM.s:29:Unknown pseudo-op: .global
engines/scumm/smush/codec47ARM.s:29:Rest of line ignored. 1st junk character valued 95 (_).
engines/scumm/smush/codec47ARM.s:43:bad instruction `STMFD r13!,{r2,r4-r11,R14}'
engines/scumm/smush/codec47ARM.s:45:bad instruction `LDR r4,[r13,#40]'
engines/scumm/smush/codec47ARM.s:48:bad instruction `SUB r4,r4,#0xF8'
engines/scumm/smush/codec47ARM.s:55:bad instruction `ADD r7,r2,#7'
engines/scumm/smush/codec47ARM.s:56:bad instruction `MOV r7,r7,LSR#3'

如果我尝试使用gcc(或clang)进行编译,则会收到以下错误:

engines/scumm/smush/codec47ARM.s:162:2: error: invalid instruction
 LDREQB r6,[r1],#1 @ r6 = t = *_d_src++
 ^
engines/scumm/smush/codec47ARM.s:279:2: error: invalid instruction
 LDREQB r6,[r1],#1 @ r6 = t = *_d_src++
 ^
engines/scumm/smush/codec47ARM.s:330:2: error: invalid instruction
 LDRLTB r6,[r4,r6] @ r6 = t = _paramPtr[code]
 ^

我做错了什么?我相信ARMv6应该支持MOV,ADD等。

0 个答案:

没有答案