[PATCH] Optional support for dynamic Asan runtime

Alexey Samsonov samsonov at google.com
Tue Apr 1 07:42:10 PDT 2014


On Tue, Apr 1, 2014 at 6:39 PM, Yuri Gribov <tetra2005 at gmail.com> wrote:

> BTW here is a small bug:
>   append_if(COMPILER_RT_HAS_LIBPTHREAD dl ASAN_DYNAMIC_LIBS)
> (should be COMPILER_RT_HAS_LIBDL).
>

I've fixed this before submitting the patch.


>
>
> On Tue, Apr 1, 2014 at 6:35 PM, Yuri Gribov <tetra2005 at gmail.com> wrote:
> >> I presume, this happens because we don't explicitly provide -lpthread
> in the
> >> clang invocation in RUN: line. "-lpthread" is added automatically if we
> link
> >> with static ASan runtime, but in your patch
> >> to the Clang driver you explicitly changed this behavior for
> >> -shared-libasan.
> >
> > Right, I link shared libasan against pthread if it's available so it
> > should not be necessary to link it in driver. Here's the excerpt from
> > lib/asan/CMakeFiles.txt:
> >
> > set(ASAN_DYNAMIC_LIBS stdc++ m c)
> > append_if(COMPILER_RT_HAS_LIBPTHREAD pthread ASAN_DYNAMIC_LIBS)
> >
> > Perhaps COMPILER_RT_HAS_LIBPTHREAD is OFF on your platform?
>

No, it's ON. Also,
$ ldd lib/clang/3.5.0/lib/linux/libclang_rt.asan-x86_64.so
linux-vdso.so.1 =>  (0x00007fff33d88000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f42d663f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f42d6422000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f42d621d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42d5f21000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f42d5b61000)
/lib64/ld-linux-x86-64.so.2 (0x00007f42d7647000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42d594a000)

>
> > -Y
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140401/90f172d7/attachment.html>


More information about the llvm-commits mailing list