diff --git a/configure.ac b/configure.ac index 0115e9e8..056845b3 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,13 @@ AS_CASE([$host_os], ], [cygwin*|msys*|mingw*], [ CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO=1" + # Fix a bug in mingw gcc where stack doesn't get aligned properly, force all AVX instructions to be unaligned + if test x"${CC}" = x"gcc" ; then + AX_CHECK_COMPILE_FLAG([-Wa,-muse-unaligned-vector-move], + [CFLAGS="-Wa,-muse-unaligned-vector-move $CFLAGS"], + [AC_MSG_ERROR([-Wa,-muse-unaligned-vector-move not supported, required with mingw+gcc to fix alignment bugs, update the used gcc])] + ) + fi AS_IF( [test "x$BITS" = "x32"], [ ASFLAGS="$ASFLAGS -fwin32 -DPREFIX -DHAVE_ALIGNED_STACK=0" @@ -174,7 +181,7 @@ AS_IF([test "x$YASM" != "xno"], [have_yasm="yes"]) AC_ARG_ENABLE([asm], [AS_HELP_STRING([--disable-asm], [disable assembly [no]])], [], [enable_asm="yes"] ) -AS_IF([test "x$enable_asm" != "xno" -a $have_yasm != "yes"], +AS_IF([test "x$enable_asm" != "xno" -a "$have_yasm" != "yes"], [enable_asm="no"] )