Jonathan Lennox
2014-Mar-10 21:47 UTC
[opus] Building Opus (git master) ARM assembly for iOS
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
On 2014-03-10 2:47 PM, Jonathan Lennox wrote:> 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.Yep, https://git.xiph.org/?p=opus.git;a=blob;f=celt/arm/arm2gnu.pl will need modifying to output something Apple's ancient gas fork understands, or perhaps more portably yasm syntax. I just found https://github.com/mansr/gas-preprocessor. Does that work on the opus code? -r
Justin Ruggles
2014-Mar-11 00:01 UTC
[opus] Building Opus (git master) ARM assembly for iOS
On 03/10/2014 06:56 PM, Ralph Giles wrote:> On 2014-03-10 2:47 PM, Jonathan Lennox wrote: >> 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. > > Yep, https://git.xiph.org/?p=opus.git;a=blob;f=celt/arm/arm2gnu.pl will > need modifying to output something Apple's ancient gas fork understands, > or perhaps more portably yasm syntax. > > I just found https://github.com/mansr/gas-preprocessor. Does that work > on the opus code?This one is maintained. https://git.libav.org/?p=gas-preprocessor.git;a=summary -Justin