From 43d51e4e6d8a72538ad2dc46036f556cee0450e6 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 31 Oct 2018 10:38:09 +0100 Subject: [PATCH] Disable AVX512 when using ancient versions of GCC --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a4688689..89c9096b 100644 --- a/configure.ac +++ b/configure.ac @@ -324,10 +324,12 @@ AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"]) AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"]) AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"]) -AC_MSG_CHECKING(for a broken clang + AVX512 combination) +AC_MSG_CHECKING(for obsolete compiler with possibly broken AVX512 support) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ -#if !(defined(__AVX512F__) && defined(__clang__) && __clang_major__ < 4) -#error Not a broken clang + AVX512 combination +#if !(defined(__AVX512F__) && \ + ((defined(__clang__) && __clang_major__ < 4) || \ + (defined(__GNUC__) && __GNUC__ < 6))) +#error Compiler should properly support AVX512 opcodes #endif ]])], [AC_MSG_RESULT(yes - disabling AVX512 optimizations)