From 8a06144bd05e2d3b65a461a0483229fedbdb5152 Mon Sep 17 00:00:00 2001 From: Greg Zharun Date: Wed, 22 Apr 2015 11:06:26 +0300 Subject: [PATCH] [Summary] To make build portable on systems with a processor which does not support AVX, only file which contains AVX intrinsics should be compiled with -mavx flag [Reviewed by] Paul Davis --- libs/ardour/wscript | 14 +++++++++++++- wscript | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 5d9a09d37e..3771d24a0f 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -414,8 +414,20 @@ def build(bld): u = PLATFORM.uname () cpu = u[4] if re.search ("(x86_64|AMD64)", cpu) != None: - obj.source += [ 'sse_functions_xmm.cc', 'sse_functions_avx.cc' ] + obj.source += [ 'sse_functions_xmm.cc' ] obj.source += [ 'sse_functions_64bit_win.s', 'sse_avx_functions_64bit_win.s' ] + + # as long as we want to use AVX intrinsics in this file, + # compile it with -mavx flag - append avx flag to the existing + avx_cxxflags = list(bld.env['CXXFLAGS']) + avx_cxxflags.append ('-mavx') + + bld(features = 'cxx', + source = 'sse_functions_avx.cc', + cxxflags = avx_cxxflags, + target = 'sse_avx_functions') + + obj.use += ['sse_avx_functions'] # i18n if bld.is_defined('ENABLE_NLS'): diff --git a/wscript b/wscript index dee423afce..134e2f7445 100755 --- a/wscript +++ b/wscript @@ -266,7 +266,7 @@ def set_compiler_flags (conf,opt): # mingw GCC compiler to uses at&t (Unix specific) assembler dialect by default # compiler_flags.append (["--mmnemonic=att", "msyntax=att") - compiler_flags.extend (["-mavx", "-mvzeroupper", "-DUSE_XMMINTRIN"]) + compiler_flags.extend (["-DUSE_XMMINTRIN"]) # end of processor-specific section