[PATCH] Optional support for dynamic Asan runtime

Yuri Gribov tetra2005 at gmail.com
Tue Apr 1 07:39:09 PDT 2014


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


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?
>
> -Y



More information about the llvm-commits mailing list