FindThreads: Revert "Honor THREADS_PREFER_PTHREAD_FLAG when ... in libc"
Revert !6693 (merged)/!6906 (merged). The check for
the -pthread
flag can pass on compilers like XL, that interprets it as
-p -t hread
and returns zero. Prior to that commit, we did not use
the check in the CMAKE_HAVE_LIBC_PTHREAD
code path. Now we do, it
succeeds, and we incorrectly add the -pthread
flag for XL.
This change was backported to the 3.21 and 3.22 release series long
after they initially came out. Since there may be more cases where we
now add -pthread
incorrectly, it is simplest to revert the change in
all release series pending further investigation.
Fixes: #23270 (closed)
Backport: release