<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 4:01 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 9, 2014 at 3:57 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 3:50 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>We currently don't have any macro that is used to enable lsan in llvm bootstrap. </div><div>We can easily add one, no problem, and then put this code under #ifdef LEAK_SANITIZER</div>



<div>It would make things a bit more ugly.</div><div><br></div><div>We have tow problems to solve wrt lsan and bootstrap: </div><div>1. Make asan+lsan bootstrap clean. This is what I need to solve now to enable leak checking for the entire llvm. For this we may also use #if __has_feature(address_sanitizer). </div>



<div>2. Make any+lsan bootstrap clean ("any" is one of asan, tsan, msan, <none>). This may introduce more complexity and that is why the current solution <span style="font-family:arial,sans-serif;font-size:13px">is nice. I don't have to solve this general problem though for the asan+lsan bootstrap bot. </span></div>


</blockquote></div><br></div>I would have some macro (or __has_feature) which is enabled by any flagset that links the lsan runtime library.</div></div></blockquote><div><br></div></div><div>That's not trivial because lsan could be used as a link-time-only feature (or even as LD_PRELOAD-ed library), </div>

<div>so there is not way to distinguish at compile time if lsan will be present. </div></blockquote></div><br>I understand that, but the question is -- do you think that usage pattern will be prevalent? Is it worth putting an external definition in the binary *always* just to catch the case where we do a link-time-only flag?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Put another way, is it really too burdensome to say that LSan does require a compile time flag in order to support some usage patterns?</div></div>