[FFmpeg-devel] Hacks on FATE
Måns Rullgård
mans
Thu Jun 18 12:34:53 CEST 2009
Michael Kostylev <michael.kostylev at gmail.com> writes:
> fix building with i386-*-gcc-3.3 -fPIC
>
> --- ffmpeg.orig/libavcodec/x86/cavsdsp_mmx.c
> +++ ffmpeg/libavcodec/x86/cavsdsp_mmx.c
> @@ -280,7 +280,7 @@
> VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
> \
> : "+a"(src), "+c"(dst)\
> - : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
> + : "S"((x86_reg)srcStride), "rm"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
> : "memory"\
> );\
> if(h==16){\
> @@ -295,7 +295,7 @@
> VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
> \
> : "+a"(src), "+c"(dst)\
> - : "S"((x86_reg)srcStride), "r"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
> + : "S"((x86_reg)srcStride), "rm"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
> : "memory"\
> );\
> }\
An 'm' constraint requires an lvalue operand (or ought to do (llvm
does)), which a cast expression is not.
> fix building with i386-*-gcc>=3.4 -fPIC
>
> --- ffmpeg.orig/libavcodec/x86/h264dsp_mmx.c
> +++ ffmpeg/libavcodec/x86/h264dsp_mmx.c
> @@ -973,7 +973,7 @@
> "add %4, %1 \n\t"\
> "decl %2 \n\t"\
> " jnz 1b \n\t"\
> - : "+a"(src), "+c"(dst), "+g"(h)\
> + : "+a"(src), "+c"(dst), "+m"(h)\
> : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
> : "memory"\
> );\
> @@ -1164,7 +1164,7 @@
> "add %4, %1 \n\t"\
> "decl %2 \n\t"\
> " jnz 1b \n\t"\
> - : "+a"(src), "+c"(dst), "+g"(h)\
> + : "+a"(src), "+c"(dst), "+m"(h)\
> : "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
> : "memory"\
> );\
> @@ -1649,7 +1649,7 @@
> "add %4, %1 \n\t"\
> "decl %2 \n\t"\
> " jnz 1b \n\t"\
> - : "+a"(src), "+c"(dst), "+g"(h)\
> + : "+a"(src), "+c"(dst), "+m"(h)\
> : "D"((x86_reg)srcStride), "S"((x86_reg)dstStride),\
> "m"(ff_pw_5), "m"(ff_pw_16)\
> : "memory"\
A 'g' constraint allows a memory operand, so this is definitely a bug
in gcc. Needless to say, the patch is unacceptable.
Is no more recent gcc version available for OpenBSD? If yes, I would
suggest officially not supporting the older versions that fail. If
not, I suggest someone at OpenBSD get a clue and use it.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list