summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.tests/cxa_thread_atexit/main.c13
-rw-r--r--src/corelib/configure.cmake2
2 files changed, 14 insertions, 1 deletions
diff --git a/config.tests/cxa_thread_atexit/main.c b/config.tests/cxa_thread_atexit/main.c
index 19eef494392..297e3939a5f 100644
--- a/config.tests/cxa_thread_atexit/main.c
+++ b/config.tests/cxa_thread_atexit/main.c
@@ -2,6 +2,19 @@
// SPDX-License-Identifier: BSD-3-Clause
#include <stddef.h>
+#if defined(__vxworks) || defined(__VXWORKS__)
+/*
+ * In VxWorks pthread implementation, when thread is finishing it calls pthread_exit(), which:
+ * - calls pthread cleanup procedure
+ * - clears pthread data (setting current thread to null)
+ * - calls `taskExit` VxWorks system procedure
+ * `taskExit` procedure calls thread_local object destructors, which if call directly or indirectly
+ * `pthread_self()`, terminate with error, due to not being able to obtain pthread entity.
+ * Thus, we need to treat VxWorks pthread implementation as `broken` in terms of thread_local variables.
+ */
+# error "VxWorks threadlocal destructors are called after pthread data is destroyed, causing crash."
+#endif
+
typedef void (*dtor_func) (void *);
int TEST_FUNC(dtor_func func, void *obj, void *dso_symbol);
int main()
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index de42a8c03ee..71812527917 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -615,7 +615,7 @@ qt_feature("cxx17_filesystem" PUBLIC
)
qt_feature("broken-threadlocal-dtors" PRIVATE
LABEL "Broken execution of thread_local destructors at exit() time"
- # Windows broken in different ways from Unix
+ # Windows is broken in different ways from Unix
CONDITION WIN32 OR NOT (TEST_cxa_thread_atexit OR TEST_cxa_thread_atexit_impl)
)
qt_feature("dladdr" PRIVATE