You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fast context swap is broken on little-endian ppc. This switches to
using the fallback implementation from the system in that case.
[Contributed by @insertinterestingnamehere, reviewed and merged by @jabraham17]
set(QTHREADS_HASHMAP hashmap CACHE STRING "Which hashmap implementation to use. Valid values are \"hashmap\" and \"lf_hashmap\".")
86
+
set(QTHREADS_DICT_TYPE shavit CACHE STRING "Which dictionary implementation to use. Valid values are \"shavit\", \"trie\", and \"simple\".")
87
+
set(QTHREADS_TIMER_TYPE gettimeofday CACHE STRING "Which timer implementation to use. Valid values are \"clock_gettime\", \"mach\", \"gettimeofday\", and \"gethrtime\".")
88
+
-set(QTHREADS_CONTEXT_SWAP_IMPL fastcontext CACHE STRING "Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
89
+
+# Only default to the fastcontext implementation in cases where it's confirmed to work.
90
+
+# Note: apparently 32-bit x86 may show up as i386, i486, i586, or i686.
91
+
+# Little-endian powerpc variants are excluded here as they're known not to work
92
+
+# due to an unresolved bug in our fastcontext code.
93
+
+if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR
94
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64" OR
95
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR
96
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64" OR
97
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm" OR
98
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386" OR
99
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i486" OR
100
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i586" OR
101
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686" OR
102
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64" OR
103
+
+ "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc")
104
+
+ set(QTHREADS_CONTEXT_SWAP_IMPL fastcontext CACHE STRING "Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
105
+
+else()
106
+
+ message(WARNING "No fast context swap available on this system, falling back to the system-provided one.")
107
+
+ set(QTHREADS_CONTEXT_SWAP_IMPL system CACHE STRING "Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
108
+
+endif()
109
+
set(QTHREADS_HWLOC_GET_TOPOLOGY_FUNCTION "" CACHE STRING "function to get hwloc topology (otherwise uses hwloc_topology_init and hwloc_topology_load)")
110
+
set(QTHREADS_GUARD_PAGES OFF CACHE BOOL "Whether or not to guard memory pages to help with debugging stack overflows. Default is OFF.")
111
+
set(QTHREADS_CONDWAIT_QUEUE OFF CACHE BOOL "Use a waiting queue based on pthread condition variables instead of a spin-based queue for inter-thread communication. Default is OFF.")
set(QTHREADS_HASHMAP hashmap CACHESTRING"Which hashmap implementation to use. Valid values are \"hashmap\" and \"lf_hashmap\".")
9
9
set(QTHREADS_DICT_TYPE shavit CACHESTRING"Which dictionary implementation to use. Valid values are \"shavit\", \"trie\", and \"simple\".")
10
10
set(QTHREADS_TIMER_TYPE gettimeofday CACHESTRING"Which timer implementation to use. Valid values are \"clock_gettime\", \"mach\", \"gettimeofday\", and \"gethrtime\".")
11
-
set(QTHREADS_CONTEXT_SWAP_IMPL fastcontext CACHESTRING"Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
11
+
# Only default to the fastcontext implementation in cases where it's confirmed to work.
12
+
# Note: apparently 32-bit x86 may show up as i386, i486, i586, or i686.
13
+
# Little-endian powerpc variants are excluded here as they're known not to work
14
+
# due to an unresolved bug in our fastcontext code.
15
+
if ("${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"x86_64"OR
16
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"amd64"OR
17
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"aarch64"OR
18
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"arm64"OR
19
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"arm"OR
20
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"i386"OR
21
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"i486"OR
22
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"i586"OR
23
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"i686"OR
24
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"ppc64"OR
25
+
"${CMAKE_SYSTEM_PROCESSOR}"STREQUAL"ppc")
26
+
set(QTHREADS_CONTEXT_SWAP_IMPL fastcontext CACHESTRING"Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
27
+
else()
28
+
message(WARNING "No fast context swap available on this system, falling back to the system-provided one.")
29
+
set(QTHREADS_CONTEXT_SWAP_IMPL systemCACHESTRING"Which context swap implementation to use. Valid values are \"system\" and \"fastcontext\".")
30
+
endif()
12
31
set(QTHREADS_HWLOC_GET_TOPOLOGY_FUNCTION ""CACHESTRING"function to get hwloc topology (otherwise uses hwloc_topology_init and hwloc_topology_load)")
13
32
set(QTHREADS_GUARD_PAGES OFFCACHEBOOL"Whether or not to guard memory pages to help with debugging stack overflows. Default is OFF.")
14
33
set(QTHREADS_CONDWAIT_QUEUE OFFCACHEBOOL"Use a waiting queue based on pthread condition variables instead of a spin-based queue for inter-thread communication. Default is OFF.")
0 commit comments