[x264-devel] Failure to build x264 with ASM on i386

Dimitry Andric dimitry at andric.com
Sun Feb 2 14:22:22 CET 2014


On 02 Feb 2014, at 11:24, Brad Smith <brad at comstyle.com> wrote:
> I am trying to build x264 with ASM on i386 but running into an issue with two functions within common/x86/util.h not building, the two
> functions in question are x264_predictor_clip_mmx2() and x264_predictor_roundclip_mmx2(). This code builds fine on amd64.
> I tried without and with -fomit-frame-pointer but that did not
> help. The rest of x264 builds just fine.
> 
> Looking for any assistance with trying to fix the build.
> 
> $ clang -Wshadow -ffast-math -O2 -pipe -fomit-frame-pointer -Wall -I. -I. -std=gnu99 -fno-tree-vectorize -fPIC -c -o encoder/me.so encoder/me.c
> In file included from encoder/me.c:28:
> In file included from ./common/common.h:1014:
> ./common/x86/util.h:131:9: error: inline assembly requires more registers than available
>        "movq       (%2), %%mm5 \n"
>        ^
> ./common/x86/util.h:194:9: error: inline assembly requires more registers than available
>        "movq       (%2), %%mm5 \n"
>        ^
> 2 errors generated.

If this is on OpenBSD or equivalent, you are running out of registers,
due to PIC, and possibly stack realignment.  If you try to compile this
without PIC, it will most likely work.  This is what is used for the
FreeBSD port on i386.

If you must use PIC, you need to free up one other register, for example
by assuming 16 byte stack alignment throughout.  The code will not be
ABI compatible with the rest of system, in that case.

-Dimitry



More information about the x264-devel mailing list