<!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: #777;">
<a href="https://gitlab.com/aberaud">Adrien Béraud</a> created an issue <a href="https://gitlab.com/gnutls/gnutls/-/issues/1045">#1045</a>:
</p>
<div></div>
<p dir="auto">When building a static library of gnutls, <code>nettle_ecc_scalar_random</code> is included in the resulting static library:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">nm -C x86_64-linux-android/lib/libgnutls.a  | grep nettle_ecc_scalar_random</span>
<span id="LC2" class="line" lang="plaintext">00000000000001f0 T nettle_ecc_scalar_random</span></code></pre>
<p dir="auto">However this symbol is really part of <code>libhogweed</code> (Nettle):</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">nm -C x86_64-linux-android/lib/libhogweed.a  | grep nettle_ecc_scalar_random</span>
<span id="LC2" class="line" lang="plaintext">00000000000001f0 T nettle_ecc_scalar_random</span></code></pre>
<p dir="auto">So when building an executable with <code>-lgnutls -lhogweed -lnettle</code>:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">ld: error: x86_64-linux-android/lib/libhogweed.a(ecc-random.o): multiple definition of 'nettle_ecc_scalar_random'</span>
<span id="LC2" class="line" lang="plaintext">ld: x86_64-linux-android/lib/libgnutls.a(ecc-random.o): previous definition here</span>
<span id="LC3" class="line" lang="plaintext">clang90++: error: linker command failed with exit code 1 (use -v to see invocation)</span></code></pre>
<p dir="auto">Or if trying to build without libhogweed (just <code>-lgnutls -lnettle</code>), the linker fails at runtime:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">dlopen failed: cannot locate symbol "nettle_rsa_pss_sha256_sign_digest_tr" referenced by "/data/app/blah.so"...</span></code></pre>
<p dir="auto">Expected behavior:</p>
<p dir="auto">No definition from libhogweed or nettle should be included in the static library</p>

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

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1045">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/a37b18ff65fe55e9ca74898b2d48fd29/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/1045"}}</script>


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