Disable AVX512 optimizations on clang < 4

This commit is contained in:
Frank Denis 2017-09-15 09:54:20 +02:00
parent 4aba976d5f
commit b31a3f247e

View File

@ -302,6 +302,19 @@ 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,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"])
AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"]) AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"])
AC_MSG_CHECKING(for a broken clang + AVX512 combination)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
#if !(defined(__AVX512F__) && defined(__clang__) && __clang_major__ < 4)
Not a broken clang + AVX512 combination
#endif
]])],
[AC_MSG_RESULT(yes - disabling AVX512 optimizations)
AX_CHECK_COMPILE_FLAG([$CFLAGS -mno-avx512f],
[CFLAGS="$CFLAGS -mno-avx512f"])
],
[AC_MSG_RESULT(no)
])
AX_CHECK_CATCHABLE_SEGV AX_CHECK_CATCHABLE_SEGV
LT_INIT LT_INIT