[FFmpeg-devel] [PATCH] x86: cabac: Disable the inline asm on clang on windows on i386
Martin Storsjö
martin at martin.st
Sat May 23 21:29:17 EEST 2020
The cabac inline assembly is very brittle to assemble properly
on i386 windows with clang; libavcodec/hevc_cabac.c fails to build
in the default mode (which is -march=pentium4), it only works if
ffmpeg is configured with --cpu=i686 (translating to -march=i686),
and likewise, the inline assembly fails to assemble in
libavcodec/h264_cabac.c if building with optimizations disabled.
Instead of trying to step around the problem (and end up bit by it
occasionally), just disable the inline assembly for this configuration.
---
libavcodec/x86/cabac.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index cfd3b759c9..5f1b97cec0 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -27,7 +27,7 @@
#include "libavutil/x86/asm.h"
#include "config.h"
-#if (defined(__i386) && defined(__clang__) && (__clang_major__<2 || (__clang_major__==2 && __clang_minor__<10)))\
+#if (defined(__i386) && defined(__clang__) && (__clang_major__<2 || (__clang_major__==2 && __clang_minor__<10)) || defined(_WIN32))\
|| ( !defined(__clang__) && defined(__llvm__) && __GNUC__==4 && __GNUC_MINOR__==2 && __GNUC_PATCHLEVEL__<=1)\
|| (defined(__INTEL_COMPILER) && defined(_MSC_VER))
# define BROKEN_COMPILER 1
--
2.17.1
More information about the ffmpeg-devel
mailing list