From 44b0ab50214051ca05c46274ef21dae86316298b Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 24 Oct 2025 01:12:19 +0200 Subject: [PATCH] configure.ac: Use primary arch flags for openssl and libaio checks Make sure that the configure check for openssl/crypto and libaio use the primary arch flags. These are used in testcases for the primary arch and should compile and link with the primary arch flags (which are empty on most arches, but are set explicitly on e.g. mips). Move the libaio check after the compiler check flags. --- configure.ac | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 90fafaf1c..c485b4c8c 100644 --- a/configure.ac +++ b/configure.ac @@ -2173,25 +2173,6 @@ AC_MSG_RESULT([no]) AM_CONDITIONAL(HAVE_NR_IO_PGETEVENTS, [test x$ac_have_nr_io_pgetevents = xyes]) -safe_LIBS="$LIBS" -LIBS="-laio" -AC_MSG_CHECKING([for libaio]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -]], [[ -io_context_t ctx; -io_submit(ctx, 1, NULL); -]])], [ -ac_have_libaio=yes -AC_MSG_RESULT([yes]) -], [ -ac_have_libaio=no -AC_MSG_RESULT([no]) -]) - -AM_CONDITIONAL(HAVE_LIBAIO, [test x$ac_have_libaio = xyes]) -LIBS=$safe_LIBS - #---------------------------------------------------------------------------- # Checking for supported compiler flags. #---------------------------------------------------------------------------- @@ -5393,6 +5374,28 @@ CFLAGS=$safe_CFLAGS AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) +safe_CFLAGS=$CFLAGS +CFLAGS="$mflag_primary" +safe_LIBS="$LIBS" +LIBS="-laio" +AC_MSG_CHECKING([for libaio]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include +]], [[ +io_context_t ctx; +io_submit(ctx, 1, NULL); +]])], [ +ac_have_libaio=yes +AC_MSG_RESULT([yes]) +], [ +ac_have_libaio=no +AC_MSG_RESULT([no]) +]) + +AM_CONDITIONAL(HAVE_LIBAIO, [test x$ac_have_libaio = xyes]) +LIBS=$safe_LIBS +CFLAGS=$safe_CFLAGS + # Check for __builtin_popcount AC_MSG_CHECKING([for __builtin_popcount()]) @@ -5559,6 +5562,8 @@ AM_CONDITIONAL([HAVE_OPENAT2], # check for crypto +safe_CFLAGS=$CFLAGS +CFLAGS="$mflag_primary" safe_LIBS="$LIBS" LIBS="-lcrypto" AC_MSG_CHECKING([if platform has openssl crypto]) @@ -5575,6 +5580,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_MSG_RESULT([no]) ]) LIBS=$safe_LIBS +CFLAGS=$safe_CFLAGS AM_CONDITIONAL([HAVE_OPENSSL], [test x$ac_have_openssl = xyes]) -- 2.47.3