<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 13 Mar 2017, at 20:06, David Chisnall <<a href="mailto:david.chisnall@cl.cam.ac.uk" class="">david.chisnall@cl.cam.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 13 Mar 2017, at 04:39, David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">One thing we rely on heavily on in the FDR mode implementation is C++'s `thread_local` keyword. I'm not sure what that entails runtime-wise (does it need pthreads? or something else?) but I'm sure a functional replacement would be alright too.<br class=""><br class="">No doubt we can find some common API for that, I'd guess tsan probably has already had to figure out things like that.<br class=""></blockquote><br class="">thread_local depends on any runtime (ABI library) features for destruction, so it’s only a dependency if you have thread-local global with a non-trivial destructor. Local static (non-thread-local) variables also depend on the ABI library for atomic creation.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>We use at-thread-exit thread_local variables at global scope to do cleanup for "at end of thread" functionality. So this means we do need some runtime support for that.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">These are less of an issue than standard library dependencies though, because these calls are all defined by the platform ABI and so if there are multiple options (libcxxrt, libsupc++, libc++abi) then you substitute any of them at run time. This does mean that you’ll need to ensure that one of them is linked in the final binary though, and so must be overridden by the flag that selects C++ standard library implementation during linking.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>Fair enough. We already do some link-time flag selection in Clang for when you use it to link -fxray-instrument built/linked binaries.</div><div><br class=""></div><div>We currently do not change the C++ library dependency though (nor force one).</div><div><br class=""></div><div>Cheer</div></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">-- Dean</div></div>
</div>
<br class=""></body></html>