GNOME Bugzilla – Bug 724105
gst-libav build fails when building for android-x86
Last modified: 2014-11-08 14:15:14 UTC
This is the error from cerbero build: libavcodec/x86/mpegaudiodec.c: In function 'apply_window_mp3': libavcodec/x86/mpegaudiodec.c:76:5: error: 'asm' operand has impossible constraints __asm__ volatile( ^ libavcodec/x86/mpegaudiodec.c:76:5: error: 'asm' operand has impossible constraints __asm__ volatile( ^ make[5]: *** [libavcodec/x86/mpegaudiodec.o] Error 1 make[5]: Leaving directory `/home/gstbuilder/cerbero/sources/android_x86/gst-libav-1.0-1.2/gst-libs/ext/libav' make[4]: *** [all-local] Error 2 make[4]: Leaving directory `/home/gstbuilder/cerbero/sources/android_x86/gst-libav-1.0-1.2/gst-libs/ext' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/gstbuilder/cerbero/sources/android_x86/gst-libav-1.0-1.2/gst-libs/ext' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/gstbuilder/cerbero/sources/android_x86/gst-libav-1.0-1.2/gst-libs' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/gstbuilder/cerbero/sources/android_x86/gst-libav-1.0-1.2' make: *** [all] Error 2 ***** Error running 'package' command: Recipe 'gst-libav-1.0' failed at the build step 'compile'
I get the same failure building android-x86 here from an x86_64 host. It's not clear to me why building gst-libav natively on an i686 works fine
Apparently this is a gcc regression with inline-asm, caused by mixing 32 and 64-bit registers. It's supposed to be fixed in gcc 4.8.2, but doesn't seem to have been imported to the NDK gcc.
Also fails with gcc 4.6 from the r9c NDK. Should probably switch to clang for gst-libav, but that requires setting up a completely different environment. Compiler executable and stuff has different names.
Still fails with current master (which uses the r9d sdk).
commit b15ae7b747cb7a21ccf35199d300a91e24252243 Author: Jan Schmidt <jan@centricular.com> Date: Sat Apr 19 02:23:19 2014 +1000 Add -mincoming-stack-boundary=4 to the libav cflags. Android doesn't guarantee stack alignment, but libav already has compiler directives to force the stack alignment. This frees up a register that lets the asm build. Suggested as a fix by VLC: https://mailman.videolan.org/pipermail/vlc-commits/2012-July/015881.html I've tested as well as I can without actual hardware. SSSE3 seems broken on the android emulator, but I think that's the emulator - the other accelerations work fine. Fixes bug #724105