<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 28, 2015 at 1:18 PM, Ulrich Weigand <span dir="ltr"><<a href="mailto:Ulrich.Weigand@de.ibm.com" target="_blank">Ulrich.Weigand@de.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br>
<br>
> This works for folks linking LLVM statically into the executable,<br>
> but my understanding is that it doesn't work in other cases (some<br>
> folks dlopen LLVM). I'm going to try forcing it to always be general<br>
> dynamic and precluding local dynamic on PPC64 so we actually get the<br>
> function call. If that makes the bots happy, I'll use that.<br>
> Otherwise, the options become either using initial-exec and breaking<br>
> dlopens or hacking back in pthread TLS under a macro. Hoping to<br>
> avoid the latter as I'd like to use raw TLS in a few other places in<br>
LLVM.<br>
<br>
</span>Well, initial-exec *should* usually work even with dlopen, since glibc will<br>
over-allocate the initial TLS areas on startup, exactly so that dlopen'ed<br>
libraries can use a bit of initial-exec space if that is critical to their<br>
performance.  There isn't a lot of space available but a single<br>
initial-exec<br>
pointer in a library usually works ...<br>
<br>
However, making it general-dynamic should also work, and is probably<br>
the better solution (stack dumping is not performance critical and should<br>
not use up space reserved for performance critical things ...).<br>
<br>
There is also a linker optimination for the general-dynamic case, but<br>
from reading the BFD sources this seems to work correctly for any<br>
target register and doesn't just assume r3.  Alan, is that right?</blockquote></div><br>Well, either setting it to global-dynamic doesn't work, or the bug persists:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/17252/steps/compile.llvm.stage2/logs/stdio">http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/17252/steps/compile.llvm.stage2/logs/stdio</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I think that as of that build the attribute is spelled and set up nicely, and it still explodes.</div></div>