Bug 1491848 Patch libyuv to fix the x86 mingw-clang build r=jesup
authorTom Ritter <tom@mozilla.com>
Wed, 03 Oct 2018 22:00:44 +0000
changeset 487896 bd1d38fb62484d96857a2900a7085687ab49a308
parent 487895 9eff0dcbd18f0b29bd6f6f7bcb2707404ca58935
child 487897 f87eeba88f1cf3f4d41095f7a58cb518a59f844c
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjesup
bugs1491848
milestone64.0a1
Bug 1491848 Patch libyuv to fix the x86 mingw-clang build r=jesup This patch combines the following two upstream patches (which we are missing, because we're out of date): https://chromium.googlesource.com/libyuv/libyuv/+/d8680893ecfcffd952c7a5d0dc1878d1c486a4e4%5E%21/ https://chromium.googlesource.com/libyuv/libyuv/+/6e498475c749063485a046dfb24e1fa1a81cbedf%5E%21/ Differential Revision: https://phabricator.services.mozilla.com/D7218
media/libyuv/libyuv/include/libyuv/compare_row.h
media/libyuv/libyuv/include/libyuv/row.h
--- a/media/libyuv/libyuv/include/libyuv/compare_row.h
+++ b/media/libyuv/libyuv/include/libyuv/compare_row.h
@@ -40,32 +40,26 @@ extern "C" {
 
 // clang >= 3.4.0 required for AVX2.
 #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
 #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
 #define CLANG_HAS_AVX2 1
 #endif  // clang >= 3.4
 #endif  // __clang__
 
-// The following are available for Visual C:
-#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
-    (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
-#define HAS_HASHDJB2_AVX2
-#endif
-
 // The following are available for Visual C and GCC:
 #if !defined(LIBYUV_DISABLE_X86) && \
     (defined(__x86_64__) || defined(__i386__) || defined(_M_IX86))
 #define HAS_HASHDJB2_SSE41
 #define HAS_SUMSQUAREERROR_SSE2
 #define HAS_HAMMINGDISTANCE_SSE42
 #endif
 
 // The following are available for Visual C and clangcl 32 bit:
-#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
+#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) && \
     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
 #define HAS_HASHDJB2_AVX2
 #define HAS_SUMSQUAREERROR_AVX2
 #endif
 
 // The following are available for GCC and clangcl 64 bit:
 #if !defined(LIBYUV_DISABLE_X86) && \
     (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER)))
--- a/media/libyuv/libyuv/include/libyuv/row.h
+++ b/media/libyuv/libyuv/include/libyuv/row.h
@@ -227,17 +227,17 @@ extern "C" {
 // TODO(fbarchard): fix build error on android_full_debug=1
 // https://code.google.com/p/libyuv/issues/detail?id=517
 #define HAS_I422ALPHATOARGBROW_AVX2
 #endif
 #endif
 
 // The following are available for AVX2 Visual C and clangcl 32 bit:
 // TODO(fbarchard): Port to gcc.
-#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && \
+#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) && \
     (defined(VISUALC_HAS_AVX2) || defined(CLANG_HAS_AVX2))
 #define HAS_ARGB1555TOARGBROW_AVX2
 #define HAS_ARGB4444TOARGBROW_AVX2
 #define HAS_ARGBTOARGB1555ROW_AVX2
 #define HAS_ARGBTOARGB4444ROW_AVX2
 #define HAS_ARGBTORGB565ROW_AVX2
 #define HAS_J400TOARGBROW_AVX2
 #define HAS_RGB565TOARGBROW_AVX2