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

Martin Storsjö martin at martin.st
Mon Jul 23 17:02:03 CEST 2012


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


More information about the Android mailing list