From f0c28b84eac0dc516a4ef7a84a72dabc2f60b625 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 29 Jul 2026 00:25:25 +0200 Subject: [PATCH] autoconf: build wolfevent.c under --enable-usersettings wolfevent.c (the wolfEvent completion queue) only compiled under --enable-asynccrypt: AM_CONDITIONAL([BUILD_WOLFEVENT],...) tested only ENABLED_ASYNCCRYPT. But HAVE_WOLF_EVENT is a user-settable macro that internal.c/ssl.c gate their wolfEventQueue_* references on, so a --enable-usersettings build that defines HAVE_WOLF_EVENT referenced the queue API while the object was never built -> link error (undefined wolfEventQueue_Init/Free). BUILD_WOLFEVENT was also the only BUILD_* conditional missing the standard "|| ENABLED_USERSETTINGS = yes" escape hatch that lets a header-driven build compile a source and defer the decision to the file's own #ifdef. Add that clause (matching BUILD_FALCON/BUILD_MLKEM/etc.) so usersettings builds compile wolfevent.c; its internal #ifdef HAVE_WOLF_EVENT still gates whether the code is active, so non-event builds get an empty object. Also silence wolfEvent_Poll's unused-parameter -Werror in non-async builds (event/flags are consumed only by the async hardware poll), which the above change surfaces now that the file compiles without WOLFSSL_ASYNC_CRYPT. --- configure.ac | 2 +- wolfcrypt/src/wolfevent.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 93ea4e5a9c..21a2a808b3 100644 --- a/configure.ac +++ b/configure.ac @@ -13092,7 +13092,7 @@ AM_COND_IF([BUILD_SP_INT], [INCLUDE_SP_INT="yes"]) AC_SUBST([INCLUDE_SP_INT]) AM_CONDITIONAL([BUILD_MCAPI],[test "x$ENABLED_MCAPI" = "xyes"]) AM_CONDITIONAL([BUILD_ASYNCCRYPT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"]) -AM_CONDITIONAL([BUILD_WOLFEVENT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"]) +AM_CONDITIONAL([BUILD_WOLFEVENT],[test "x$ENABLED_ASYNCCRYPT" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) AM_CONDITIONAL([BUILD_CRYPTOCB],[test "x$ENABLED_CRYPTOCB" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"]) AM_CONDITIONAL([BUILD_SWDEV],[test "x$ENABLED_SWDEV" = "xyes"]) AM_CONDITIONAL([BUILD_PSK],[test "x$ENABLED_PSK" = "xyes"]) diff --git a/wolfcrypt/src/wolfevent.c b/wolfcrypt/src/wolfevent.c index 6c8f8d4737..7dbfdad623 100644 --- a/wolfcrypt/src/wolfevent.c +++ b/wolfcrypt/src/wolfevent.c @@ -51,6 +51,14 @@ int wolfEvent_Poll(WOLF_EVENT* event, WOLF_EVENT_FLAG flags) { int ret = WC_NO_ERR_TRACE(BAD_COND_E); + /* event/flags are only consumed by the async hardware poll below, which is + * compiled out in non-async builds (the event queue core is + * async-independent). */ +#ifndef WOLFSSL_ASYNC_CRYPT + (void)event; + (void)flags; +#endif + /* Check hardware */ #ifdef WOLFSSL_ASYNC_CRYPT if (event->type >= WOLF_EVENT_TYPE_ASYNC_FIRST &&