<!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/ametzler">Andreas Metzler</a>
commented on a
<a href="https://gitlab.com/gnutls/gnutls/issues/818#note_202264295">discussion</a>:
</p>
<div style="">
<p dir="auto">When openssl is built, aesni-x86.s is not generated by a simple</p>
<blockquote dir="auto">
<p>CC="gcc" /usr/bin/perl ../crypto/aes/asm/aesni-x86.pl elf crypto/aes/aesni-x86.s</p>
</blockquote>
<p dir="auto">the respective build.info file reads</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> GENERATE[aesni-x86.s]=asm/aesni-x86.pl \</span>
<span id="LC2" class="line" lang="plaintext">        $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)</span></code></pre>
<p dir="auto">which expands to e.g.</p>
<blockquote dir="auto">
<p>CC="gcc" /usr/bin/perl ../crypto/aes/asm/aesni-x86.pl elf -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/dev/shm/GNUTLS/openssl-1.1.1c=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR=""/usr/lib/ssl"" -DENGINESDIR=""/usr/lib/i386-linux-gnu/engines-1.1"" -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2  crypto/aes/aesni-x86.s</p>
</blockquote>
<p dir="auto">Playing around a little bit we find that the <code>-fPIC</code> is significant, adding/removing it triggers exactly the one-line change mentioned above. And indeed we find this in perlasm/x86asm.pl:</p>
<pre class="code highlight js-syntax-highlight perl" lang="perl" v-pre="true"><code><span id="LC1" class="line" lang="perl"><span class="nv">$pic</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span></span>
<span id="LC2" class="line" lang="perl"><span class="k">for</span> <span class="p">(</span><span class="nv">@ARGV</span><span class="p">)</span> <span class="p">{</span> <span class="nv">$pic</span><span class="o">=</span><span class="mi">1</span> <span class="k">if</span> <span class="p">(</span><span class="sr">/\-[fK]PIC/i</span><span class="p">);</span> <span class="p">}</span></span></code></pre>
</div>


</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/818#note_202264295">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/0ff1caed070bbbe2f10bd6b7b2efb9a2/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/818#note_202264295"}}</script>


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