FindThreads: libc check does not work with asan
Clang asan's runtime library provides pthread_create
and tricks FindThreads into thinking that libc has pthreads.
!2629 (merged) tried to address this by switching to pthread_kill
. However, on FreeBSD that symbol is in libc but the rest of pthreads is not so we reverted the fix in !3022 (merged). This issue serves to record the original problem which is restored by the revert.
Discussion in !2629 (merged) had considered pthread_key_create
, pthread_self
, and pthread_attr_init
also but each had a reason it would not work.