Obsolete golang-120
[oi-userland.git] / components / library / qt6 / patches / 10-PhysX-Solaris-support.patch
blob45f3884f9adab9aab80e1cadcc077eedb85109c0
1 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxIntrinsics.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxIntrinsics.h
2 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxIntrinsics.h 2022-12-12 20:36:44.000000000 +0000
3 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxIntrinsics.h 2023-01-12 09:46:33.266160798 +0000
4 @@ -34,7 +34,7 @@
6 #if PX_WINDOWS_FAMILY
7 #include "foundation/windows/PxWindowsIntrinsics.h"
8 -#elif(PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4)
9 +#elif(PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4 || PX_SOLARIS)
10 #include "foundation/unix/PxUnixIntrinsics.h"
11 #elif PX_XBOXONE
12 #include "foundation/XboxOne/PxXboxOneIntrinsics.h"
13 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h
14 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h 2022-12-12 20:36:44.000000000 +0000
15 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h 2023-01-12 10:07:19.377991385 +0000
16 @@ -108,6 +108,8 @@
17 #define PX_PS4 1
18 #elif defined(__NX__)
19 #define PX_SWITCH 1
20 +#elif defined(__sun)
21 +#define PX_SOLARIS 1
22 #else
23 #error "Unknown operating system"
24 #endif
25 @@ -193,6 +195,9 @@
26 #ifndef PX_SWITCH
27 #define PX_SWITCH 0
28 #endif
29 +#ifndef PX_SOLARIS
30 +#define PX_SOLARIS 0
31 +#endif
32 #ifndef PX_UWP
33 #define PX_UWP 0
34 #endif
35 @@ -253,7 +258,7 @@
36 #define PX_MICROSOFT_FAMILY (PX_XBOXONE || PX_WINDOWS_FAMILY || PX_XBOX_SERIES_X)
37 #define PX_LINUX_FAMILY (PX_LINUX || PX_ANDROID)
38 #define PX_APPLE_FAMILY (PX_IOS || PX_OSX) // equivalent to #if __APPLE__
39 -#define PX_UNIX_FAMILY (PX_LINUX_FAMILY || PX_APPLE_FAMILY) // shortcut for unix/posix platforms
40 +#define PX_UNIX_FAMILY (PX_LINUX_FAMILY || PX_APPLE_FAMILY || PX_SOLARIS) // shortcut for unix/posix platforms
41 #if defined(__EMSCRIPTEN__)
42 #define PX_EMSCRIPTEN 1
43 #else
44 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/unix/PxUnixIntrinsics.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/unix/PxUnixIntrinsics.h
45 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/unix/PxUnixIntrinsics.h 2022-12-12 20:36:44.000000000 +0000
46 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/pxshared/include/foundation/unix/PxUnixIntrinsics.h 2023-01-12 09:49:38.925791130 +0000
47 @@ -33,7 +33,7 @@
48 #include "foundation/Px.h"
49 #include "foundation/PxSharedAssert.h"
51 -#if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY)
52 +#if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY || PX_SOLARIS)
53 #error "This file should only be included by Unix builds!!"
54 #endif
56 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsAllocator.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsAllocator.h
57 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsAllocator.h 2022-12-12 20:36:44.000000000 +0000
58 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsAllocator.h 2023-01-12 09:53:34.519815438 +0000
59 @@ -118,6 +118,9 @@
60 #elif PX_SWITCH
61 #include <malloc.h>
62 #define PxAlloca(x) alloca(x)
63 +#elif PX_SOLARIS
64 + #include <alloca.h>
65 + #define PxAlloca(x) alloca(x)
66 #endif
68 #define PxAllocaAligned(x, alignment) ((size_t(PxAlloca(x + alignment)) + (alignment - 1)) & ~size_t(alignment - 1))
69 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsFPU.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsFPU.h
70 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsFPU.h 2022-12-12 20:36:44.000000000 +0000
71 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsFPU.h 2023-01-12 09:55:32.586641342 +0000
72 @@ -79,7 +79,7 @@
74 #if PX_WINDOWS_FAMILY || PX_XBOXONE || PX_XBOX_SERIES_X
75 #include "windows/PsWindowsFPU.h"
76 -#elif (PX_LINUX && PX_SSE2) || PX_PS4 || PX_OSX
77 +#elif (PX_LINUX && PX_SSE2) || PX_PS4 || PX_OSX || PX_SOLARIS
78 #include "unix/PsUnixFPU.h"
79 #else
80 PX_INLINE physx::shdfnd::SIMDGuard::SIMDGuard()
81 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsIntrinsics.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsIntrinsics.h
82 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsIntrinsics.h 2022-12-12 20:36:44.000000000 +0000
83 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsIntrinsics.h 2023-01-12 09:56:07.055424800 +0000
84 @@ -34,7 +34,7 @@
86 #if PX_WINDOWS_FAMILY
87 #include "windows/PsWindowsIntrinsics.h"
88 -#elif(PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4)
89 +#elif(PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4 || PX_SOLARIS)
90 #include "unix/PsUnixIntrinsics.h"
91 #elif PX_XBOXONE
92 #include "XboxOne/PsXboxOneIntrinsics.h"
93 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsThread.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsThread.h
94 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsThread.h 2022-12-12 20:36:44.000000000 +0000
95 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsThread.h 2023-01-12 09:54:47.501172410 +0000
96 @@ -41,7 +41,7 @@
98 #if PX_WINDOWS_FAMILY || PX_XBOXONE || PX_XBOX_SERIES_X
99 #define PxSpinLockPause() __asm pause
100 -#elif PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY || PX_SWITCH
101 +#elif PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY || PX_SWITCH || PX_SOLARIS
102 #define PxSpinLockPause() asm("nop")
103 #else
104 #error "Platform not supported!"
105 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsTime.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsTime.h
106 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsTime.h 2022-12-12 20:36:44.000000000 +0000
107 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/PsTime.h 2023-01-12 09:56:59.177171999 +0000
108 @@ -84,7 +84,7 @@
109 Second getLastTime() const;
111 private:
112 -#if PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4
113 +#if PX_LINUX || PX_ANDROID || PX_APPLE_FAMILY || PX_PS4 || PX_SOLARIS
114 Second mLastTime;
115 #else
116 int64_t mTickCount;
117 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixFPU.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixFPU.h
118 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixFPU.h 2022-12-12 20:36:44.000000000 +0000
119 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixFPU.h 2023-01-12 12:14:21.264356558 +0000
120 @@ -32,7 +32,7 @@
122 #include "foundation/PxPreprocessor.h"
124 -#if PX_LINUX || PX_PS4 || PX_OSX
125 +#if PX_LINUX || PX_PS4 || PX_OSX || PX_SOLARIS
127 #if PX_X86 || PX_X64
128 #if PX_EMSCRIPTEN
129 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixIntrinsics.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixIntrinsics.h
130 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixIntrinsics.h 2022-12-12 20:36:44.000000000 +0000
131 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/PsUnixIntrinsics.h 2023-01-12 09:58:21.950222631 +0000
132 @@ -45,7 +45,7 @@
133 // this file is for internal intrinsics - that is, intrinsics that are used in
134 // cross platform code but do not appear in the API
136 -#if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY)
137 +#if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY || PX_SOLARIS)
138 #error "This file should only be included by unix builds!!"
139 #endif
141 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp
142 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp 2022-12-12 20:36:44.000000000 +0000
143 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp 2023-01-12 10:03:41.356389570 +0000
144 @@ -39,7 +39,7 @@
145 namespace
148 -#define SN_NUM_BINARY_PLATFORMS 19
149 +#define SN_NUM_BINARY_PLATFORMS 20
150 const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] =
152 PX_MAKE_FOURCC('W','_','3','2'),
153 @@ -82,6 +82,7 @@
154 "uwparm64",
155 "macarm",
156 "linuxarm",
157 + "solaris64",
158 "unknown",
161 @@ -127,8 +128,10 @@
162 return sBinaryPlatformTags[16];
163 #elif PX_LINUX && PX_ARM
164 return sBinaryPlatformTags[17];
165 +#elif PX_SOLARIS && PX_A64
166 + return sBinaryPlatformTags[18]
167 #else
168 - return sBinaryPlatformTags[18];
169 + return sBinaryPlatformTags[19];
170 #endif
173 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/sse2/PsUnixSse2AoS.h qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/sse2/PsUnixSse2AoS.h
174 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/sse2/PsUnixSse2AoS.h 2022-12-12 20:36:44.000000000 +0000
175 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/include/unix/sse2/PsUnixSse2AoS.h 2023-01-12 10:38:01.826091091 +0000
176 @@ -43,7 +43,7 @@
177 namespace aos
180 -#if PX_EMSCRIPTEN || PX_SSE2
181 +#if PX_EMSCRIPTEN || PX_SSE2 || PX_SOLARIS
182 typedef int8_t __int8_t;
183 typedef int16_t __int16_t;
184 typedef int32_t __int32_t;
185 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixFPU.cpp qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixFPU.cpp
186 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixFPU.cpp 2022-12-12 20:36:44.000000000 +0000
187 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixFPU.cpp 2023-01-12 11:27:56.161455763 +0000
188 @@ -28,7 +28,7 @@
189 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
190 #include "PsFPU.h"
192 -#if !(defined(__CYGWIN__) || PX_ANDROID || PX_PS4)
193 +#if !(defined(__CYGWIN__) || PX_ANDROID || PX_PS4 || PX_SOLARIS)
194 #include <fenv.h>
195 PX_COMPILE_TIME_ASSERT(8 * sizeof(uint32_t) >= sizeof(fenv_t));
196 #endif
197 @@ -42,6 +42,8 @@
199 #if defined(__CYGWIN__)
200 #pragma message "FPUGuard::FPUGuard() is not implemented"
201 +#elif PX_SOLARIS
202 +#pragma message "FPUGuard::FPUGuard() is not implemented"
203 #elif PX_ANDROID
204 // not supported unless ARM_HARD_FLOAT is enabled.
205 #elif PX_PS4
206 @@ -72,6 +74,8 @@
208 #if defined(__CYGWIN__)
209 #pragma message "FPUGuard::~FPUGuard() is not implemented"
210 +#elif PX_SOLARIS
211 +#pragma message "FPUGuard::~FPUGuard() is not implemented"
212 #elif PX_ANDROID
213 // not supported unless ARM_HARD_FLOAT is enabled.
214 #elif PX_PS4
215 diff -Nru qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixThread.cpp qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixThread.cpp
216 --- qt-everywhere-src-6.4.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixThread.cpp 2022-12-12 20:36:44.000000000 +0000
217 +++ qt-everywhere-src-6.4.2/qtquick3dphysics/src/3rdparty/PhysX/source/foundation/src/unix/PsUnixThread.cpp 2023-01-12 11:37:01.207995499 +0000
218 @@ -36,7 +36,7 @@
219 #include "PsThread.h"
221 #include <math.h>
222 -#if !PX_APPLE_FAMILY && !defined(ANDROID) && !defined(__CYGWIN__) && !PX_PS4 && !PX_EMSCRIPTEN && __GLIBC__
223 +#if !PX_APPLE_FAMILY && !defined(ANDROID) && !defined(__CYGWIN__) && !PX_PS4 && !PX_EMSCRIPTEN && !PX_SOLARIS && __GLIBC__
224 #include <bits/local_lim.h> // PTHREAD_STACK_MIN
225 #endif
226 #include <stdio.h>
227 @@ -44,7 +44,7 @@
228 #include <unistd.h>
229 #if !PX_PS4
230 #include <sys/syscall.h>
231 -#if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN
232 +#if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN && !PX_SOLARIS
233 #include <asm/unistd.h>
234 #include <sys/resource.h>
235 #endif
236 @@ -115,7 +115,7 @@
237 // AM: TODO: neither of the below are implemented
238 #elif PX_APPLE_FAMILY
239 threadImpl.tid = syscall(SYS_gettid);
240 -#elif PX_EMSCRIPTEN
241 +#elif PX_EMSCRIPTEN || PX_SOLARIS
242 threadImpl.tid = pthread_self();
243 #else
244 threadImpl.tid = syscall(__NR_gettid);
245 @@ -313,6 +313,8 @@
246 prevMask = setAffinityMaskPS4(getThread(this)->thread, mask);
247 #elif PX_EMSCRIPTEN
248 // not supported
249 +#elif PX_SOLARIS
250 + // not supported
251 #elif !PX_APPLE_FAMILY // Apple doesn't support syscall with getaffinity and setaffinity
252 int32_t errGet = syscall(__NR_sched_getaffinity, getThread(this)->tid, sizeof(prevMask), &prevMask);
253 if(errGet < 0)
254 diff -Nru qt-everywhere-src-6.5.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/pvd/include/PxProfileAllocatorWrapper.h qt-everywhere-src-6.5.2/qtquick3dphysics/src/3rdparty/PhysX/source/pvd/include/PxProfileAllocatorWrapper.h
255 --- qt-everywhere-src-6.5.2.orig/qtquick3dphysics/src/3rdparty/PhysX/source/pvd/include/PxProfileAllocatorWrapper.h 2023-09-19 22:33:53.903393945 +0200
256 +++ qt-everywhere-src-6.5.2/qtquick3dphysics/src/3rdparty/PhysX/source/pvd/include/PxProfileAllocatorWrapper.h 2023-09-19 22:34:06.459406024 +0200
257 @@ -38,6 +38,7 @@
259 #include "PsArray.h"
260 #include "PsHashMap.h"
261 +#include <typeinfo>
263 namespace physx { namespace profile {