为 iPhone 构建 ARM 汇编器 vorbis 解码器库“颤音" [英] Building ARM assembler vorbis decoder lib 'Tremolo' for iPhone

查看:27
本文介绍了为 iPhone 构建 ARM 汇编器 vorbis 解码器库“颤音"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 iPhone 编译 Tremolo.我已经拉入文件 bitwise.c bitwiseARM.s codebook.c dpen.s dsp.c floor0.c floor1.c floor1ARM.s floor_lookup.c framing.c info.c mapping0.c mdct.c mdctARM.s misc.c res012.c 到一个新的目标,添加以下自定义设置:

I'm trying to compile Tremolo for iPhone. I've pulled in the files bitwise.c bitwiseARM.s codebook.c dpen.s dsp.c floor0.c floor1.c floor1ARM.s floor_lookup.c framing.c info.c mapping0.c mdct.c mdctARM.s misc.c res012.c into a new target, added the following custom settings:

GCC_PREPROCESSOR_DEFINITIONS = _ARM_ASSEM_
GCC_C_LANGUAGE_STANDARD = gnu99
GCC_THUMB_SUPPORT = YES

...但是一旦 xcode 到达第一个汇编程序文件 bitwiseARM.s,我就会收到如下错误:

... but as soon as xcode reaches the first assembler file, bitwiseARM.s, I get errors like these:

/tremolo/bitwiseARM.s:3:Unknown pseudo-op: .global
/tremolo/bitwiseARM.s:3:Rest of line ignored. 1st junk character valued 111 (o).
/tremolo/bitwiseARM.s:4:Unknown pseudo-op: .global
/tremolo/bitwiseARM.s:4:Rest of line ignored. 1st junk character valued 111 (o).
/tremolo/bitwiseARM.s:5:Unknown pseudo-op: .global
/tremolo/bitwiseARM.s:5:Rest of line ignored. 1st junk character valued 111 (o).
/tremolo/bitwiseARM.s:6:Unknown pseudo-op: .global
/tremolo/bitwiseARM.s:6:Rest of line ignored. 1st junk character valued 111 (o).
/tremolo/bitwiseARM.s:11:bad instruction `STMFD r13!,{r10,r11,r14}'
/tremolo/bitwiseARM.s:12:bad instruction `LDMIA r0,{r2,r3,r12}'
/tremolo/bitwiseARM.s:16:bad instruction `SUBS r2,r2,r1'
/tremolo/bitwiseARM.s:17:bad instruction `BLT look_slow'
/tremolo/bitwiseARM.s:19:bad instruction `LDR r10,[r3]'

第一个错误我可以用谷歌搜索,将 .global 更改为 .globl 修复了第一个错误,但我仍然收到错误的指令,我不明白为什么.谷歌搜索 ARM 指令集,上面的指令对我来说是有效的.我试过切换拇指支持,并只为 armv7 而​​不是 armv6 构建,但都没有帮助.

The first error I could google, and changing .global to .globl fixed the first errors, but I still get the bad instructions, and I don't get why. Googling for the ARM instruction set, the above instructions look valid to me. I've tried toggling thumb support, and building for just armv7 instead of armv6, but neither helped.

推荐答案

正如 Igor 所说,Apple 的气体叉子是古老的,需要:

As Igor says, Apple's fork of gas is ancient and wants:

  • .global 替换为 .globl
  • 小写的所有说明
  • 替换';'带有@"的注释分隔符
  • 地址导入的存根标签

我为 Tremolo .s 文件编写了一个预处理器 awk 脚本,使它们能够被 Xcode 接受,我将通过 Robin 回馈.

I've written a pre-processor awk script for the Tremolo .s files to make them acceptable to Xcode, which I'll contribute back via Robin.

或者,您可以尝试这个.

这篇关于为 iPhone 构建 ARM 汇编器 vorbis 解码器库“颤音"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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