From b7376b2e532a6b0e0cdbf2ebed526594d64675e2 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 27 Nov 2020 01:23:41 +0000 Subject: [PATCH] check for pthread_stackseg_np() during build Signed-off-by: Ivailo Monev --- CMakeLists.txt | 1 + src/3rdparty/javascriptcore/runtime/Collector.cpp | 4 ++-- src/core/global/qglobal.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10f4307bf..55a53fa04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,6 +389,7 @@ katie_check_function(fesetenv "fenv.h") katie_check_function(feclearexcept "fenv.h") katie_check_function(feenableexcept "fenv.h") # none +katie_check_function(pthread_stackseg_np "pthread_np.h" "${CMAKE_THREAD_LIBS_INIT}") katie_check_function(madvise "sys/mman.h") katie_check_function(getifaddrs "ifaddrs.h") katie_check_struct(sockaddr_ll sll_addr "netpacket/packet.h") diff --git a/src/3rdparty/javascriptcore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/runtime/Collector.cpp index 5318b45b1..41b2a3ca5 100644 --- a/src/3rdparty/javascriptcore/runtime/Collector.cpp +++ b/src/3rdparty/javascriptcore/runtime/Collector.cpp @@ -50,7 +50,7 @@ #include #endif -#if defined(Q_OS_OPENBSD) || defined(QT_HAVE_PTHREAD_ATTR_GET_NP) +#if defined(QT_HAVE_PTHREAD_STACKSEG_NP) || defined(QT_HAVE_PTHREAD_ATTR_GET_NP) #include #endif @@ -335,7 +335,7 @@ static inline void* currentThreadStackBase() stack_t s; thr_stksegment(&s); return s.ss_sp; -#elif defined(Q_OS_OPENBSD) +#elif defined(QT_HAVE_PTHREAD_STACKSEG_NP) pthread_t thread = pthread_self(); stack_t stack; pthread_stackseg_np(thread, &stack); diff --git a/src/core/global/qglobal.cpp b/src/core/global/qglobal.cpp index 3bd5eb59e..b9ba93129 100644 --- a/src/core/global/qglobal.cpp +++ b/src/core/global/qglobal.cpp @@ -1525,7 +1525,7 @@ void qsrand(uint seed) */ int qrand() { -#if defined(QT_HAVE_ARC4RANDOM) +#ifdef QT_HAVE_ARC4RANDOM return ::arc4random(); #else // Seed the PRNG once per thread with a combination of current time and its address -- 2.11.0