<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/ffontaine">Fabrice Fontaine</a>
<a href="https://gitlab.com/gnutls/gnutls/-/issues/1330#note_863539390">commented</a>:
</p>
<div style="">
<p dir="auto">Unfortunately, turning <code>gnutls_static_mutex_lock</code> into a macro doesn't fix the issue. <code>lock</code> will still be undefined. Indeed, the issue is due to <code>GNUTLS_STATIC_MUTEX</code>, not <code>gnutls_static_mutex_lock</code>. It should be noted that the same build failure is raised with <code>gnutls_rwlock_rdlock</code>:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style="border-radius: 2px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="plaintext">priority.c: In function '_gnutls_update_system_priorities':</span>
<span id="LC2" class="line" lang="plaintext">priority.c:1857:30: error: 'system_wide_config_rwlock' undeclared (first use in this function); did you mean 'system_wide_config'?</span>
<span id="LC3" class="line" lang="plaintext"> 1857 |  ret = gnutls_rwlock_rdlock(&system_wide_config_rwlock);</span>
<span id="LC4" class="line" lang="plaintext">      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~</span>
<span id="LC5" class="line" lang="plaintext">      |                              system_wide_config</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">A possible workaround is to guard all mutexes (i.e. <code>file_mutex</code>, <code>global_init_mutex</code>, <code>keylog_mutex</code>, <code>gnutls_rnd_ctx_list_mutex</code> and <code>system_wide_config_rwlock</code>) by <code>ifdef HAVE_PTHREAD_MUTEX_LOCK</code>. I can send a MR if this is acceptable. An other option is to disable gnutls on toolchains without threads.</p>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1330#note_863539390">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/79bc6f6bd1df9169c9c522b38034ad2a/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1330#note_863539390"}}</script>


</p>
</div>
</body>
</html>