From f4cf47e4c2ad192487c6d95785baa64e4f01d33b Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Tue, 6 Feb 2024 15:53:36 +0100 Subject: [PATCH] FreeBSD regtest: feature test for aio_readv Doesn't exist on FreeBSD 12.4 and earlier. Also clean up configure output - was missing a few yes/nos. --- configure.ac | 23 +++++++++++++++++++++++ memcheck/tests/freebsd/Makefile.am | 6 +++++- memcheck/tests/freebsd/aiov.vgtest | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 207648f340..2aa11f29fd 100755 --- a/configure.ac +++ b/configure.ac @@ -5394,8 +5394,10 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ return __NR_openat2 ]])], [ ac_have_openat2=yes + AC_MSG_RESULT([yes]) ], [ ac_have_openat2=no + AC_MSG_RESULT([no]) ]) AM_CONDITIONAL([HAVE_OPENAT2], @@ -5413,14 +5415,35 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ CRYPTO_secure_malloc_init(1<<20, 8); ]])], [ ac_have_openssl=yes + AC_MSG_RESULT([yes]) ], [ ac_have_openssl=no + AC_MSG_RESULT([no]) ]) LIBS=$safe_LIBS AM_CONDITIONAL([HAVE_OPENSSL], [test x$ac_have_openssl = xyes]) +AC_MSG_CHECKING([if platform has aio_readv]) + +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include +]], [[ + aio_readv(NULL); +]])], [ + ac_have_aio_readv=yes + AC_MSG_RESULT([yes]) + +], [ + ac_have_aio_readv=no + AC_MSG_RESULT([no]) +]) + +AM_CONDITIONAL([HAVE_AIO_READV], + [test x$ac_have_aio_readv = xyes]) + # does g++ have built-in functions for atomic memory access ? AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch]) diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index 5476203a95..af8d0cacac 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -138,7 +138,7 @@ EXTRA_DIST = \ utimes.stderr.exp check_PROGRAMS = \ - access aio aiov aio_read aligned_alloc bug464476 bug470713 \ + access aio aio_read aligned_alloc bug464476 bug470713 \ capsicum chflags \ chmod_chown delete_sized_mismatch errno_aligned_allocs \ extattr \ @@ -165,6 +165,10 @@ check_PROGRAMS = \ AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) +if HAVE_AIO_READV +check_PROGRAMS += aiov +endif + inlinfo_SOURCES = inlinfo.c inlinfo_DEPENDENCIES = inlinfo_nested.so inlinfo_LDFLAGS = -Wl,-rpath,$(top_builddir)/memcheck/tests/freebsd diff --git a/memcheck/tests/freebsd/aiov.vgtest b/memcheck/tests/freebsd/aiov.vgtest index 5f2dabdcca..80ef274fc2 100644 --- a/memcheck/tests/freebsd/aiov.vgtest +++ b/memcheck/tests/freebsd/aiov.vgtest @@ -1,3 +1,4 @@ +prereq: test -e ./aiov prog: aiov vgopts: --leak-check=no stderr_filter: ../filter_allocs -- 2.47.2