summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-qt/qt5/nativesdk-qtbase_git.bb1
-rw-r--r--recipes-qt/qt5/qtbase-native_git.bb1
-rw-r--r--recipes-qt/qt5/qtbase/0020-Revert-Fix-workaround-in-pthread-destructor.patch67
-rw-r--r--recipes-qt/qt5/qtbase_git.bb1
4 files changed, 70 insertions, 0 deletions
diff --git a/recipes-qt/qt5/nativesdk-qtbase_git.bb b/recipes-qt/qt5/nativesdk-qtbase_git.bb
index 4bf81339..06d237d0 100644
--- a/recipes-qt/qt5/nativesdk-qtbase_git.bb
+++ b/recipes-qt/qt5/nativesdk-qtbase_git.bb
@@ -42,6 +42,7 @@ SRC_URI += "\
42 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ 42 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
43 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \ 43 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \
44 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \ 44 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \
45 file://0020-Revert-Fix-workaround-in-pthread-destructor.patch \
45" 46"
46 47
47# common for qtbase-native and nativesdk-qtbase 48# common for qtbase-native and nativesdk-qtbase
diff --git a/recipes-qt/qt5/qtbase-native_git.bb b/recipes-qt/qt5/qtbase-native_git.bb
index 4be4aaa8..8effb0af 100644
--- a/recipes-qt/qt5/qtbase-native_git.bb
+++ b/recipes-qt/qt5/qtbase-native_git.bb
@@ -37,6 +37,7 @@ SRC_URI += "\
37 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ 37 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
38 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \ 38 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \
39 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \ 39 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \
40 file://0020-Revert-Fix-workaround-in-pthread-destructor.patch \
40" 41"
41 42
42# common for qtbase-native and nativesdk-qtbase 43# common for qtbase-native and nativesdk-qtbase
diff --git a/recipes-qt/qt5/qtbase/0020-Revert-Fix-workaround-in-pthread-destructor.patch b/recipes-qt/qt5/qtbase/0020-Revert-Fix-workaround-in-pthread-destructor.patch
new file mode 100644
index 00000000..c397ddb3
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0020-Revert-Fix-workaround-in-pthread-destructor.patch
@@ -0,0 +1,67 @@
1From aeaea761f21e5430d3199d2ca4414d18ed7b0fd5 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Tue, 26 Jan 2021 08:50:45 +0100
4Subject: [PATCH] Revert "Fix workaround in pthread destructor"
5
6This reverts commit 81ce2d1d6fa741de4d27b939a378147a02019ec1.
7
8currentThreadData was reverted in 5.12 before this commit:
9
1081ce2d1d6f Fix workaround in pthread destructor
118867e0eaa7 Revert "Remove pthread storage for thread local data"
1278665d8a0c Remove pthread storage for thread local data
13
14causing build failures in configurations which use this
15| /home/jenkins/workspace/luneos-unstable/webos-ports/tmp-glibc/work/cortexa8t2hf-neon-halium-webos-linux-gnueabi/qtbase/5.15.2+gitAUTOINC+40143c189b-r0/git/src/corelib/thread/qthread_unix.cpp: In function 'void destroy_current_thread_data(void*)':
16| /home/jenkins/workspace/luneos-unstable/webos-ports/tmp-glibc/work/cortexa8t2hf-neon-halium-webos-linux-gnueabi/qtbase/5.15.2+gitAUTOINC+40143c189b-r0/git/src/corelib/thread/qthread_unix.cpp:121:5: error: 'currentThreadData' was not declared in this scope
17| 121 | currentThreadData = data;
18| | ^~~~~~~~~~~~~~~~~
19
20---
21 src/corelib/thread/qthread_unix.cpp | 25 +++++++++++++++++++------
22 1 file changed, 19 insertions(+), 6 deletions(-)
23
24diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
25index 659d5fb03c..1da68b3130 100644
26--- a/src/corelib/thread/qthread_unix.cpp
27+++ b/src/corelib/thread/qthread_unix.cpp
28@@ -116,11 +116,18 @@ static pthread_key_t current_thread_data_key;
29
30 static void destroy_current_thread_data(void *p)
31 {
32+#if defined(Q_OS_VXWORKS)
33+ // Calling setspecific(..., 0) sets the value to 0 for ALL threads.
34+ // The 'set to 1' workaround adds a bit of an overhead though,
35+ // since this function is called twice now.
36+ if (p == (void *)1)
37+ return;
38+#endif
39+ // POSIX says the value in our key is set to zero before calling
40+ // this destructor function, so we need to set it back to the
41+ // right value...
42+ pthread_setspecific(current_thread_data_key, p);
43 QThreadData *data = static_cast<QThreadData *>(p);
44- // thread_local variables are set to zero before calling this destructor function,
45- // if they are internally using pthread-specific data management,
46- // so we need to set it back to the right value...
47- currentThreadData = data;
48 if (data->isAdopted) {
49 QThread *thread = data->thread.loadAcquire();
50 Q_ASSERT(thread);
51@@ -131,8 +138,14 @@ static void destroy_current_thread_data(void *p)
52 data->deref();
53
54 // ... but we must reset it to zero before returning so we aren't
55- // leaving a dangling pointer.
56- currentThreadData = nullptr;
57+ // called again (POSIX allows implementations to call destructor
58+ // functions repeatedly until all values are zero)
59+ pthread_setspecific(current_thread_data_key,
60+#if defined(Q_OS_VXWORKS)
61+ (void *)1);
62+#else
63+ nullptr);
64+#endif
65 }
66
67 static void create_current_thread_data_key()
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb
index a7811ddf..19c22d0a 100644
--- a/recipes-qt/qt5/qtbase_git.bb
+++ b/recipes-qt/qt5/qtbase_git.bb
@@ -33,6 +33,7 @@ SRC_URI += "\
33 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \ 33 file://0016-Define-QMAKE_CXX.COMPILER_MACROS-for-clang-on-linux.patch \
34 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \ 34 file://0018-tst_qpainter-FE_-macros-are-not-defined-for-every-pl.patch \
35 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \ 35 file://0019-Define-__NR_futex-if-it-does-not-exist.patch \
36 file://0020-Revert-Fix-workaround-in-pthread-destructor.patch \
36" 37"
37 38
38# Disable LTO for now, QT5 patches are being worked upstream, perhaps revisit with 39# Disable LTO for now, QT5 patches are being worked upstream, perhaps revisit with