[gnutls-devel] GnuTLS | Build failure without threads (#1330)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Mar 1 15:00:50 CET 2022



Fabrice Fontaine created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1330



## Description of problem
Build failure without threads raised since version 3.7.3 and commit 482380e9eb78ee134ca985fd7d03306b07c457ce.

## 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

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1330
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20220301/4c9ec037/attachment.html>


More information about the Gnutls-devel mailing list