summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorHarry van Haaren <harry.van.haaren@intel.com>2020-07-29 11:59:34 +0100
committerIan Stokes <ian.stokes@intel.com>2020-08-05 15:57:40 +0100
commit930f135f5ddc4372c1615bc7674dda35c229b6bd (patch)
tree708b7a448ba3b8bf2ec0a4a7dc4b5a4e9b09b7ea /m4
parentba5e3117828f6cc2a0c9eefd292b2b4f7da75e6b (diff)
downloadopenvswitch-930f135f5ddc4372c1615bc7674dda35c229b6bd.tar.gz
configure: explicitly disable avx512 if bintuils check fails
This commit explicitly disables avx512f if the binutils assembler check fails to correctly assemble its input. Without this fix, there is a possibility that users can see undefined behaviour when compiling with -march=native on a CPU which supports avx512 and with a buggy binutils version (v2.30 and 2.31), without a backported fix, if the compiler's vectorizing optimizations convert scalar code to avx512 instructions. Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/openvswitch.m44
1 files changed, 4 insertions, 0 deletions
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 7c9a507e5..6fe79297e 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -426,8 +426,12 @@ AC_DEFUN([OVS_CHECK_BINUTILS_AVX512],
CFLAGS="$CFLAGS -DHAVE_LD_AVX512_GOOD"
else
ovs_cv_binutils_avx512_good=no
+ dnl Explicitly disallow avx512f to stop compiler auto-vectorizing
+ dnl and causing zmm usage with buggy binutils versions.
+ CFLAGS="$CFLAGS -mno-avx512f"
fi
else
+ dnl non x86_64 architectures don't have avx512, so not affected
ovs_cv_binutils_avx512_good=no
fi])
rm $OBJFILE