<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 1, 2014 at 6:39 PM, Yuri Gribov <span dir="ltr"><<a href="mailto:tetra2005@gmail.com" target="_blank">tetra2005@gmail.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">BTW here is a small bug:<br>
  append_if(COMPILER_RT_HAS_LIBPTHREAD dl ASAN_DYNAMIC_LIBS)<br>
(should be COMPILER_RT_HAS_LIBDL).<br></blockquote><div><br></div><div>I've fixed this before submitting the patch.</div><div> </div><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">

<div class=""><div class="h5"><br>
<br>
On Tue, Apr 1, 2014 at 6:35 PM, Yuri Gribov <<a href="mailto:tetra2005@gmail.com">tetra2005@gmail.com</a>> wrote:<br>
>> I presume, this happens because we don't explicitly provide -lpthread in the<br>
>> clang invocation in RUN: line. "-lpthread" is added automatically if we link<br>
>> with static ASan runtime, but in your patch<br>
>> to the Clang driver you explicitly changed this behavior for<br>
>> -shared-libasan.<br>
><br>
> Right, I link shared libasan against pthread if it's available so it<br>
> should not be necessary to link it in driver. Here's the excerpt from<br>
> lib/asan/CMakeFiles.txt:<br>
><br>
> set(ASAN_DYNAMIC_LIBS stdc++ m c)<br>
> append_if(COMPILER_RT_HAS_LIBPTHREAD pthread ASAN_DYNAMIC_LIBS)<br>
><br>
> Perhaps COMPILER_RT_HAS_LIBPTHREAD is OFF on your platform?<br></div></div></blockquote><div><br></div><div>No, it's ON. Also,</div><div><div>$ ldd lib/clang/3.5.0/lib/linux/<a href="http://libclang_rt.asan-x86_64.so">libclang_rt.asan-x86_64.so</a> </div>
<div><span class="" style="white-space:pre">    </span>linux-vdso.so.1 =>  (0x00007fff33d88000)</div><div><span class="" style="white-space:pre">       </span>libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42d663f000)</div>
<div><span class="" style="white-space:pre">    </span>libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42d6422000)</div><div><span class="" style="white-space:pre">   </span>libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f42d621d000)</div>
<div><span class="" style="white-space:pre">    </span>libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42d5f21000)</div><div><span class="" style="white-space:pre">       </span>libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f42d5b61000)</div>
<div><span class="" style="white-space:pre">    </span>/lib64/ld-linux-x86-64.so.2 (0x00007f42d7647000)</div><div><span class="" style="white-space:pre">   </span>libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42d594a000)</div>
</div><div><br></div><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"><div class=""><div class="h5">
><br>
> -Y<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>