[Cmake-commits] CMake branch, master, updated. v3.14.0-rc2-279-g8989fa2
Kitware Robot
kwrobot at kitware.com
Thu Feb 28 10:33:03 EST 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 8989fa255b7c4d1b9a7598eec29335801292e149 (commit)
via 18320230ecb273233b1ccb133537daf16179262c (commit)
via e0267eb1d327befd9839c0d745c84e6550618104 (commit)
from 0d9471fa2dee221aef8166ea370a98cc26d783e4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8989fa255b7c4d1b9a7598eec29335801292e149
commit 8989fa255b7c4d1b9a7598eec29335801292e149
Merge: 0d9471f 1832023
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 28 15:24:56 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Feb 28 10:25:03 2019 -0500
Merge topic 'FindThreads-revert-libc-check'
18320230ec FindThreads: Revert libc symbol check to pthread_create
e0267eb1d3 FindThreads: Fix libc check to use proper header for pthread_kill
Acked-by: Kitware Robot <kwrobot at kitware.com>
Acked-by: Rolf Eike Beer <eike at sf-mail.de>
Merge-request: !3022
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18320230ecb273233b1ccb133537daf16179262c
commit 18320230ecb273233b1ccb133537daf16179262c
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 27 07:28:05 2019 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 27 07:33:31 2019 -0500
FindThreads: Revert libc symbol check to pthread_create
Since commit e9a1ddc594 (FindThreads: Replace the pthread symbol
checking in libc., 2018-11-18, v3.14.0-rc1~292^2) we check libc for
`pthread_kill` instead of `pthread_create`. However, on FreeBSD
`pthread_kill` is in libc but not `pthread_create`. Discussion in the
original merge request for the above commit also considered
`pthread_key_create`, `pthread_self`, and `pthread_attr_init`. Every
symbol seems to have some reason it is not an appropriate choice.
Revert to the pre-3.14 behavior of using `pthread_create` pending
further investigation.
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index a2f3fa3..919392a 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -118,18 +118,8 @@ if(CMAKE_HAVE_PTHREAD_H)
set(CMAKE_HAVE_THREADS_LIBRARY)
if(NOT THREADS_HAVE_PTHREAD_ARG)
# Check if pthread functions are in normal C library.
- # If the pthread functions already exist in C library, we could just use
- # them instead of linking to the additional pthread library. We could
- # try to check any pthread symbol name, but here is an exception. If we
- # use clang asan build, we will find the pthread_create() symbol in the
- # 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. 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)
+ CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
+ if(CMAKE_HAVE_LIBC_CREATE)
set(CMAKE_THREAD_LIBS_INIT "")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(Threads_FOUND TRUE)
@@ -154,7 +144,7 @@ if(CMAKE_HAVE_PTHREAD_H)
_check_pthreads_flag()
endif()
-if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD_KILL)
+if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
set(CMAKE_USE_PTHREADS_INIT 1)
set(Threads_FOUND TRUE)
endif()
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0267eb1d327befd9839c0d745c84e6550618104
commit e0267eb1d327befd9839c0d745c84e6550618104
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 26 07:46:26 2019 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 26 07:51:52 2019 -0500
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
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)
-----------------------------------------------------------------------
Summary of changes:
Modules/FindThreads.cmake | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list