From ca5ffc07433103273357059f39b9a3cf13711d4f Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Thu, 19 Nov 2020 09:44:58 +1000 Subject: [PATCH] AESNI compile flags: clang can't have -msse4 Setting the SSE4 architecture with clang creates executables that can't run on old machines. --- configure.ac | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 8f277be6f..db1ddd4b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1383,11 +1383,18 @@ then AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESNI" if test "$GCC" = "yes" then - # GCC needs these flags, icc doesn't - # opt levels greater than 2 may cause problems on systems w/o aesni - if test "$CC" != "icc" + # clang needs these flags + if test "$CC" = "clang" then - AM_CFLAGS="$AM_CFLAGS -maes -msse4 -mpclmul" + AM_CFLAGS="$AM_CFLAGS -maes -mpclmul" + else + # GCC needs these flags, icc doesn't + # opt levels greater than 2 may cause problems on systems w/o + # aesni + if test "$CC" != "icc" + then + AM_CFLAGS="$AM_CFLAGS -maes -msse4 -mpclmul" + fi fi fi AS_IF([test "x$ENABLED_AESGCM" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"])