<!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 class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/ffontaine">Fabrice Fontaine</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1330">#1330</a>
</p>
<div></div>
<h2 dir="auto">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true"></a>Description of problem</h2>
<p dir="auto">Build failure without threads raised since version 3.7.3 and commit <a href="https://gitlab.com/gnutls/gnutls/-/commit/482380e9eb78ee134ca985fd7d03306b07c457ce" data-original="482380e9eb78ee134ca985fd7d03306b07c457ce" data-link="false" data-link-reference="false" data-project="179611" data-commit="482380e9eb78ee134ca985fd7d03306b07c457ce" data-reference-type="commit" data-container="body" data-placement="top" title='locks: replace custom mutex wrappers with "glthread/lock.h"' class="gfm gfm-commit has-tooltip">482380e9</a>.</p>
<h2 dir="auto">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true"></a>Version of gnutls used:</h2>
<p dir="auto">3.7.3</p>
<h2 dir="auto">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto">buildroot</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>Build gnutls on a toolchain without threads support</li>
</ul>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<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">kx.c: In function '_gnutls_nss_keylog_write':</span>
<span id="LC2" class="line" lang="plaintext">kx.c:164:33: error: 'keylog_mutex' undeclared (first use in this function); did you mean 'keylog_once'?</span>
<span id="LC3" class="line" lang="plaintext">  164 |   if (gnutls_static_mutex_lock(&keylog_mutex) < 0) {</span>
<span id="LC4" class="line" lang="plaintext">      |                                 ^~~~~~~~~~~~</span>
<span id="LC5" class="line" lang="plaintext">      |                                 keylog_once</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto"><code>keylog_mutex</code> is defined as:</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">GNUTLS_STATIC_MUTEX(keylog_mutex);</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">and <code>GNUTLS_STATIC_MUTEX</code> is defined as:</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">#define GNUTLS_STATIC_MUTEX(lock) gl_lock_define_initialized(static, lock)</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">This build failure is raised because <code>gl_rwlock_define_initialized</code> won't define <code>lock</code> if threads are unavailable, see extract of <a href="https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/glthread/lock.h" rel="nofollow noreferrer noopener" target="_blank">https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/glthread/lock.h</a>:</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">#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext">/* Provide dummy implementation if threads are not supported.  */</span>
<span id="LC4" class="line" lang="plaintext"></span>
<span id="LC5" class="line" lang="plaintext"># define gl_rwlock_define_initialized(STORAGECLASS, NAME)</span>
<span id="LC6" class="line" lang="plaintext"></span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">Full build log: <a href="http://autobuild.buildroot.org/results/e09/e092bc11ce4b5908cb6285aa77a3594b8626eeec/build-end.log" rel="nofollow noreferrer noopener" target="_blank">http://autobuild.buildroot.org/results/e09/e092bc11ce4b5908cb6285aa77a3594b8626eeec/build-end.log</a></p>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">Build should succeed</p>

</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">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/95228be00daf73707d245374351296ea/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"}}</script>


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