Bug 1413257: Allow disabling ffvpx's AVX2 support on linux64 for Thunderbird's buildbot; r?jya,rillian
MozReview-Commit-ID: 6USzO1GE7dJ
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -52,16 +52,28 @@ yasm = check_prog('YASM', ['yasm'], allo
def yasm_version(yasm):
version = check_cmd_output(
yasm, '--version',
onerror=lambda: die('Failed to get yasm version.')
).splitlines()[0].split()[1]
return Version(version)
+@depends(yasm_version)
+def yasm_major_version(yasm_version):
+ return str(yasm_version.major)
+
+
+@depends(yasm_version)
+def yasm_minor_version(yasm_version):
+ return str(yasm_version.minor)
+
+
+set_config('YASM_MAJOR_VERSION', yasm_major_version)
+set_config('YASM_MINOR_VERSION', yasm_minor_version)
# Until we move all the yasm consumers out of old-configure.
# bug 1257904
add_old_configure_assignment('_YASM_MAJOR_VERSION',
yasm_version.major)
add_old_configure_assignment('_YASM_MINOR_VERSION',
yasm_version.minor)
--- a/media/ffvpx/config_common.h
+++ b/media/ffvpx/config_common.h
@@ -1,4 +1,14 @@
#ifndef MOZ_FFVPX_CONFIG_COMMON_H
#define MOZ_FFVPX_CONFIG_COMMON_H
#include "defaults_disabled.h"
+
+#ifdef YASM_MISSING_AVX2
+#undef HAVE_AVX2
+#undef HAVE_AVX2_INTERNAL
+#undef HAVE_AVX2_EXTERNAL
+#define HAVE_AVX2 0
+#define HAVE_AVX2_INTERNAL 0
+#define HAVE_AVX2_EXTERNAL 0
#endif
+
+#endif
--- a/media/ffvpx/ffvpxcommon.mozbuild
+++ b/media/ffvpx/ffvpxcommon.mozbuild
@@ -5,16 +5,17 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Add assembler flags and includes
ASFLAGS += CONFIG['FFVPX_ASFLAGS']
ASFLAGS += ['-I%s/media/ffvpx' % TOPSRCDIR]
if CONFIG['FFVPX_ASFLAGS']:
USE_YASM = True
+
if CONFIG['OS_ARCH'] == 'WINNT':
# Fix inline symbols and math defines for windows.
DEFINES['_USE_MATH_DEFINES'] = True
DEFINES['inline'] = "__inline"
# 32-bit windows need to prefix symbols with an underscore.
if CONFIG['CPU_ARCH'] == 'x86':
ASFLAGS += ['-DPREFIX']
ASFLAGS += ['-Pconfig_win32.asm']
@@ -27,16 +28,25 @@ if CONFIG['FFVPX_ASFLAGS']:
'-DPREFIX'
]
else:
# Default to unix, similar to how ASFLAGS setup works in configure.in
ASFLAGS += ['-Pconfig_unix64.asm']
# default disabled components
ASFLAGS += ['-Pdefaults_disabled.asm']
+ if int(CONFIG['YASM_MAJOR_VERSION']) == 1 and int(CONFIG['YASM_MINOR_VERSION']) < 2:
+ DEFINES['YASM_MISSING_AVX2'] = True
+ ASFLAGS += [
+ '-DHAVE_AVX2=0',
+ '-DHAVE_AVX2_INTERNAL=0',
+ '-DHAVE_AVX2_EXTERNAL=0',
+ ]
+
+
LOCAL_INCLUDES += ['/media/ffvpx']
# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += [