Build failure without threads
Description of problem
Build failure without threads raised since version 3.7.3 and commit 482380e9.
Version of gnutls used:
3.7.3
Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)
buildroot
How reproducible:
Steps to Reproduce:
- Build gnutls on a toolchain without threads support
Actual results:
kx.c: In function '_gnutls_nss_keylog_write':
kx.c:164:33: error: 'keylog_mutex' undeclared (first use in this function); did you mean 'keylog_once'?
164 | if (gnutls_static_mutex_lock(&keylog_mutex) < 0) {
| ^~~~~~~~~~~~
| keylog_once
keylog_mutex
is defined as:
GNUTLS_STATIC_MUTEX(keylog_mutex);
and GNUTLS_STATIC_MUTEX
is defined as:
#define GNUTLS_STATIC_MUTEX(lock) gl_lock_define_initialized(static, lock)
This build failure is raised because gl_rwlock_define_initialized
won't define lock
if threads are unavailable, see extract of https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/glthread/lock.h:
#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
/* Provide dummy implementation if threads are not supported. */
# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
Full build log: http://autobuild.buildroot.org/results/e09/e092bc11ce4b5908cb6285aa77a3594b8626eeec/build-end.log
Expected results:
Build should succeed