[PATCH] D39254: On FreeBSD, add -pthread to the flags for dynamic ASan tests

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 14:09:45 PDT 2017


dim added a comment.

In https://reviews.llvm.org/D39254#905688, @eugenis wrote:

> What changes when the binary starts depending on libthr? Before that, we had
>  binary -> asan -> libthr
>  Now we have
>  binary -> asan -> libthr
>
>   -> libthr
>   
>
> This should affect neither symbol lookup order nor constructor order.


I agree, and I would think so too, but in practice it apparently does...  The way the dynamic linker fixes this up is rather magic to me, and I don't know the internal details. @emaste any idea?

In https://reviews.llvm.org/D39254#905707, @krytarowski wrote:

>


...

> Can you reproduce it with `check-asan-dynamic`?

Any of the dynamic asan tests should trigger it.  For example the `runtimes/compiler-rt/test/asan/TestCases/Posix/asprintf.cc`, which is the first one in the list.

>>> `check-asan-dynamic` on NetBSD/amd64 works fine. Modulo around 3 tests that are unresearched.
>> 
>> I guess NetBSD doesn't use libthr.so?
> 
> libthr.so does not exist on NetBSD.
> 
>>   Are all pthread functions folded into libc.so?
> 
> No. There are stubs as weak references.

FreeBSD's libc.so also has these stubs, but where does the actual pthread implementation live in NetBSD then?


https://reviews.llvm.org/D39254





More information about the llvm-commits mailing list