[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:40:24 PDT 2017


dim added a comment.

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

> Then the problem must be in the linking of asan-rt: libthr should go before libc. We use -nodefaultlibs, so this order is explicitly defined in CMakeLists.txt.


Aha, you are most likely right.  If I compile a small test case .so file (with just `int foo(void) { return pthread_key_create(&key, NULL); }` in it), the resulting .so indeed has libthr before libc:

  0x0000000000000001 (NEEDED)             Shared library: [libthr.so.3]
  0x0000000000000001 (NEEDED)             Shared library: [libc.so.7]


https://reviews.llvm.org/D39254





More information about the llvm-commits mailing list