Libtsan intercepts the pthread exported functions with

dlsym(RTLD_NEXT, func_name).  This fails for pthread_join() as it
is present both as a stub in libc and as real operation in libpthread
and the search order is "libtsan.so libc.so libpthread.so".

Force the order "libtsan.so libpthread.so libc.so" so symbols
get intercepted from libpthread first.

Ok: Matthew Green <mrg@netbsd.org>
This commit is contained in:
hannken 2021-11-07 09:22:58 +00:00
parent 43742ee02a
commit c60326deac
1 changed files with 6 additions and 0 deletions

View File

@ -203,3 +203,9 @@ along with GCC; see the file COPYING3. If not see
do { \
netbsd_patch_builtins (); \
} while(0)
#if defined(HAVE_LD_STATIC_DYNAMIC)
#undef LIBTSAN_EARLY_SPEC
#define LIBTSAN_EARLY_SPEC "%{static-libtsan:" LD_STATIC_OPTION "}" \
" -ltsan %{static-libtsan:" LD_DYNAMIC_OPTION "} -lpthread"
#endif