Create ARM assembler vorbis decoder lib 'Tremolo' for iPhone

I am trying to compile Tremolo for iPhone. I pulled 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 to the new target, added the following user settings:

GCC_PREPROCESSOR_DEFINITIONS = _ARM_ASSEM_ GCC_C_LANGUAGE_STANDARD = gnu99 GCC_THUMB_SUPPORT = YES 

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

 /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]' 

The first error that I could work with Google and changing .global to .globl fixed the first errors, but I still get bad instructions and I donโ€™t understand why. Googling for the ARM instruction set, the above instructions look valid for me. I tried to flip my thumb support and build for armv7 instead of armv6, but it didn't help.

+3
source share
2 answers

According to Igor, the apple gas fork is ancient and wants to:

  • .global replaced by .globl
  • all lowercase instructions
  • replace ';' comment delimiter with '@'
  • stub labels for importing addresses

I wrote an awk script pre-processor for Tremolo.s files to make them acceptable for Xcode, which I will be contributing back through Robin.

Alternatively you can try this .

+7
source

He seems to be trying to compile bitwiseARM.s in Thumb mode (for example, Thumb uses PUSH instead of STMFD SP!, ). I'm not sure which Apple directives support gas (it's based on some really ancient plug), but try adding .arm or .code32 at the top of the file.

0
source

Source: https://habr.com/ru/post/1411463/


All Articles