Tor ./configure fails when --enable-static-libevent and --enable-static-openssl when cross compiling mingw target
Some of the test programs fail to build due to missing symbols provided by bcrypt.dll and iphlpapi.dll which are normally resolved when building libevent.dll
Possible fix:
diff --git a/configure.ac b/configure.ac
index 2e1de76606..82bc320a9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -871,6 +871,7 @@ if test "$bwin32" = "true"; then
# think it's actually necessary.
TOR_LIB_GDI=-lgdi32
TOR_LIB_USERENV=-luserenv
+ TOR_LIB_BCRYPT=-lbcrypt
else
TOR_LIB_WS32=
TOR_LIB_GDI=
@@ -879,6 +880,7 @@ fi
AC_SUBST(TOR_LIB_WS32)
AC_SUBST(TOR_LIB_GDI)
AC_SUBST(TOR_LIB_IPHLPAPI)
+AC_SUBST(TOR_LIB_BCRYPT)
AC_SUBST(TOR_LIB_SHLWAPI)
AC_SUBST(TOR_LIB_USERENV)
@@ -896,7 +898,7 @@ if test "$enable_static_libevent" = "yes"; then
fi
fi
-TOR_SEARCH_LIBRARY(libevent, $trylibeventdir, [-levent $STATIC_LIBEVENT_FLAGS $TOR_LIB_WS32], [
+TOR_SEARCH_LIBRARY(libevent, $trylibeventdir, [-levent $STATIC_LIBEVENT_FLAGS $TOR_LIB_IPHLPAPI $TOR_LIB_BCRYPT $TOR_LIB_WS32], [
#ifdef _WIN32
#include <winsock2.h>
#endif
EDIT: see patch that fixes openssl linker problems as well -> #40116 (comment 2707945)