<div dir="ltr"><div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">In your 15 February email you said you tried that and it didn't help...?</blockquote>>Ohhh right!<br>I did try it…. Thanks for the reminder >o<</blockquote></div><div dir="ltr"><br></div><div>I think you will need to compile both the JIT'd code and the executor process with -femulated-tls and include at least one thread-local in the executor in order for this to work: If you only compile your JIT'd code with -femulated-tls then you'll have a reference to __emutls_get_address as you've seen, but no definition for it. That symbol would usually be pulled in from compiler-rt by the static linker, but you're running under the JIT. Your two options are to either add compiler-rt to your JIT (this is untested on Windows, and consequently risky), or to compile your executor with -femulated-tls and include at least one thread local in it -- this will force the static linker to compile __emutls_get_address into your executor (lower risk, but may not work if __emutls_get_address is marked non-exported from compiler-rt).</div><div><br></div><div>-- Lang.</div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 3, 2021 at 5:15 AM Gaier, Bjoern <<a href="mailto:Bjoern.Gaier@horiba.com">Bjoern.Gaier@horiba.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">





<div lang="DE" style="word-wrap:break-word">
<div class="gmail-m_-3113044657026588375WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Ohhh right!<br>
I did try it…. Thanks for the reminder >o<<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Geoff Levner <<a href="mailto:glevner@gmail.com" target="_blank">glevner@gmail.com</a>>
<br>
<b>Sent:</b> 03 March 2021 10:02<br>
<b>To:</b> Gaier, Bjoern <<a href="mailto:Bjoern.Gaier@horiba.com" target="_blank">Bjoern.Gaier@horiba.com</a>><br>
<b>Cc:</b> Lang Hames <<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>>; David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>>; LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [llvm-dev] How to use thread local storage with ORC JIT?<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Bjoern,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">In your 15 February email you said you tried that and it didn't help...?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Geoff<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Wed, Mar 3, 2021 at 8:24 AM Gaier, Bjoern via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Hey Lang,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I can’t remember anymore but I think I haven’t tried with -femulated-tls.
</span><u></u><u></u></p>
<p class="MsoNormal"><snip><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Takashi Nagano, Junichi Tajika, Ergin Cansiz.
</div>

</blockquote></div></div></div></div>