[Android] [PATCH 6/7] contrib: ffmpeg: Disable fPIC when compiling for Android x86

Edward Wang edward.c.wang at compdigitec.com
Wed Jul 25 00:54:25 CEST 2012


On 12-07-23 11:02 AM, Martin Storsjö <martin at martin.st> wrote:
> On Mon, 23 Jul 2012, Rafaël Carré wrote:
>
>> Did you ask libav or ffmpeg people about this?
>
> The issue here is that android-x86 doesn't guarantee an aligned stack, 
> which means some of the inline asm functions will waste an extra 
> register on realigning the stack.
>
> libavcodec does however have stuff in place in all entrypoints that 
> realign the stack on all calls into the library. If you build with 
> --extra-cflags='-mincoming-stack-boundary=4', gcc assumes that the 
> stack actually is aligned already, which the entry points ensure, so 
> this inline asm builds fine.
>
> I've got a fate instance running that builds using this configuration, 
> at http://fate.libav.org/i686-android-linux-gcc-4.4/20120723140530. I 
> haven't ever actually test run it though, so it's probably good if 
> someone could test code built with these flags, by actually running 
> e.g. some mpegaudio decoding via libavcodec, to see that it works as 
> intended.
>
> // Martin
>
VLC on Android-x86 seems to work with those flags and I am able to play 
some mp3 files with it:

D/VLC     (  652): [0x8895138]: main decoder using decoder module "avcodec"

So I will edit this patch to use Martin's cflags.

Thanks,
         Edward Wang


More information about the Android mailing list