Commit b6c82f0a authored by Edward Wang's avatar Edward Wang Committed by Rafaël Carré

contrib: ffmpeg: Use -mincoming-stack-boundary=4

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.
Pointed-out-by: default avatarMartin Storsjö <martin@martin.st>
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent 9cd6a205
......@@ -87,6 +87,17 @@ endif
# Linux
ifdef HAVE_LINUX
FFMPEGCONF += --target-os=linux --enable-pic
ifeq ($(ANDROID_ABI), x86)
ifdef HAVE_ANDROID
# Android-x86 gcc doesn't guarantee an aligned stack, but this is
# handled by __attribute__((force_align_arg_pointer)) in libavcodec
# already, so we tell gcc to assume this alignment, so we don't need
# to waste a precious register in assembly functions to realign it.
FFMPEG_CFLAGS += -mincoming-stack-boundary=4
endif # HAVE_ANDROID
endif # x86
endif
# Windows
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment