[opus] Building Opus (git master) ARM assembly for iOS

Jonathan Lennox jonathan at vidyo.com
Mon Mar 10 14:47:11 PDT 2014


I’m trying to build Opus (git master) for iOS, and it doesn’t build unless I disable the ARM assembly.

It looks like the problem is that Apple’s assembler doesn’t support all the assembler directives that the GNU assembler does.  I suspect this is a combination of the fact that Apple platforms are Mach-O rather than Elf, and just the fact that Apple’s assembler is extremely divergent from the mainline GNU one.

Specifically, if I configure with:
../configure -C CC="xcrun --sdk iphoneos clang -arch armv7" --build=x86_64-apple-darwin13.1.0 --host=arm-apple-darwin11 --enable-fixed-point

I get:

$ make V=1
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
depbase=`echo celt/arm/celt_pitch_xcorr_arm-gnu.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool    --mode=compile xcrun --sdk iphoneos clang -arch armv7 -DHAVE_CONFIG_H -I. -I..  -I../include -I../celt -I../silk -I../silk/float -I../silk/fixed   -g -O2 -MT celt/arm/celt_pitch_xcorr_arm-gnu.lo -MD -MP -MF $depbase.Tpo -c -o celt/arm/celt_pitch_xcorr_arm-gnu.lo celt/arm/celt_pitch_xcorr_arm-gnu.S &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  xcrun --sdk iphoneos clang -arch armv7 -DHAVE_CONFIG_H -I. -I.. -I../include -I../celt -I../silk -I../silk/float -I../silk/fixed -g -O2 -MT celt/arm/celt_pitch_xcorr_arm-gnu.lo -MD -MP -MF celt/arm/.deps/celt_pitch_xcorr_arm-gnu.Tpo -c celt/arm/celt_pitch_xcorr_arm-gnu.S  -fno-common -DPIC -o celt/arm/.libs/celt_pitch_xcorr_arm-gnu.o
celt/arm/celt_pitch_xcorr_arm-gnu.S:30:24: error: unknown directive
    .text; .p2align 2; .arch armv7-a
                       ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:31:4: error: unknown directive
   .fpu neon
   ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:32:4: error: unknown directive
   .object_arch armv4t
   ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:47:2: error: unknown directive
 .type xcorr_kernel_neon, %function; xcorr_kernel_neon: @ PROC
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:155:2: error: unknown directive
 .size xcorr_kernel_neon, .-xcorr_kernel_neon @ ENDP
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:159:2: error: unknown directive
 .type celt_pitch_xcorr_neon, %function; celt_pitch_xcorr_neon: @ PROC
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:254:2: error: unknown directive
 .size celt_pitch_xcorr_neon, .-celt_pitch_xcorr_neon @ ENDP
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:262:2: error: unknown directive
 .type xcorr_kernel_edsp, %function; xcorr_kernel_edsp: @ PROC
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:343:2: error: unknown directive
 .size xcorr_kernel_edsp, .-xcorr_kernel_edsp @ ENDP
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:345:2: error: unknown directive
 .type celt_pitch_xcorr_edsp, %function; celt_pitch_xcorr_edsp: @ PROC
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:544:2: error: unknown directive
 .size celt_pitch_xcorr_edsp, .-celt_pitch_xcorr_edsp @ ENDP
 ^
celt/arm/celt_pitch_xcorr_arm-gnu.S:549:23: error: unexpected token in '.section' directive
    .section .note.GNU-stack,"",%progbits
                      ^
make[2]: *** [celt/arm/celt_pitch_xcorr_arm-gnu.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

If I add --disable-asm to the build, it builds correctly.

Does anyone have experience with Apple assembler directives to know what’s the best way to fix this?  I assume the Perl script to generate the assembler file is going to need to be modified somehow.

(Note: if I build from the released opus-1.1, I get all the above errors, and also the UAS errors that were mentioned last month.  Those have been fixed in git.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/opus/attachments/20140310/b471bc99/attachment.htm 


More information about the opus mailing list