From e0267eb1d327befd9839c0d745c84e6550618104 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 26 Feb 2019 07:46:26 -0500 Subject: FindThreads: Fix libc check to use proper header for pthread_kill In commit e9a1ddc594 (FindThreads: Replace the pthread symbol checking in libc., 2018-11-18, v3.14.0-rc1~292^2) we switched to checking for `pthread_kill` in libc but did not update the symbol check's header file to match. Add `signal.h` to get `pthread_kill`. Keep `pthread.h` anyway since the purpose of the check is to verify that the pthread API works. Fixes: #18984 --- Modules/FindThreads.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 5d894c8..a2f3fa3 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -125,8 +125,10 @@ if(CMAKE_HAVE_PTHREAD_H) # libc(libasan). However, it doesn't have the full pthread implementation. # So, we can't assume that we have the pthread implementation in libc # using the pthread_create() checking here. Then, we turn to check the - # pthread_kill() symbol instead. - CHECK_SYMBOL_EXISTS(pthread_kill pthread.h CMAKE_HAVE_LIBC_PTHREAD_KILL) + # pthread_kill() symbol instead. It is in the "signal.h" header, but + # the purpose of this check is to verify that the pthread API works with + # pure libc, so verify that "pthread.h" can be included too. + CHECK_SYMBOL_EXISTS(pthread_kill "signal.h;pthread.h" CMAKE_HAVE_LIBC_PTHREAD_KILL) if(CMAKE_HAVE_LIBC_PTHREAD_KILL) set(CMAKE_THREAD_LIBS_INIT "") set(CMAKE_HAVE_THREADS_LIBRARY 1) -- cgit v0.12