From 455250d7e9b61bd7ee74d43b802fdd4990814cc4 Mon Sep 17 00:00:00 2001 From: Hailiang Date: Mon, 3 Nov 2025 11:11:13 +0800 Subject: [PATCH] add sw_64 support (cherry picked from commit 5a5a404e740104b4e0fa380bd54bc8321b8954e0) --- physx-sw64.patch | 83 +++++++++++++++++++++++++++++++++++++++ qt6-qtquick3dphysics.spec | 6 ++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 physx-sw64.patch diff --git a/physx-sw64.patch b/physx-sw64.patch new file mode 100644 index 0000000..3f8bec2 --- /dev/null +++ b/physx-sw64.patch @@ -0,0 +1,83 @@ +From 6c0783dfdb5d03c8889feb512f467ed894d997ec Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 3 Nov 2025 10:45:49 +0800 +Subject: [PATCH] physx sw64 + +--- + .../PhysX/pxshared/include/foundation/PxPreprocessor.h | 6 ++++-- + .../physxextensions/src/serialization/SnSerialUtils.cpp | 6 +++++- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h b/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h +index 55b9340..eb07e58 100644 +--- a/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h ++++ b/src/3rdparty/PhysX/pxshared/include/foundation/PxPreprocessor.h +@@ -131,6 +131,8 @@ Architecture defines, see http://sourceforge.net/p/predef/wiki/Architectures/ + #define PX_RV64 1 + #elif defined(__loongarch__) && __loongarch_grlen == 64 + #define PX_LN64 1 ++#elif defined(__sw_64__) ++#define PX_SW64 1 + #else + #error "Unknown architecture" + #endif +@@ -151,7 +153,7 @@ SIMD defines + #endif + + /** Disable SIMD for webassembly, mips and arm64 */ +-#if defined(__EMSCRIPTEN__) || defined(__mips__) || defined(_M_ARM64) || defined(_M_ARM) || defined(__riscv) || defined(__loongarch__) ++#if defined(__EMSCRIPTEN__) || defined(__mips__) || defined(_M_ARM64) || defined(_M_ARM) || defined(__riscv) || defined(__loongarch__) || defined(__sw_64__) + #define PX_SIMD_DISABLED 1 + #endif + +@@ -266,7 +268,7 @@ family shortcuts + // architecture + #define PX_INTEL_FAMILY (PX_X64 || PX_X86) + #define PX_ARM_FAMILY (PX_ARM || PX_A64) +-#define PX_P64_FAMILY (PX_X64 || PX_A64 || PX_RV64 || PX_LN64) // shortcut for 64-bit architectures ++#define PX_P64_FAMILY (PX_X64 || PX_A64 || PX_RV64 || PX_LN64 || PX_SW64) // shortcut for 64-bit architectures + + /** + C++ standard library defines +diff --git a/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp b/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp +index 3bc0ff5..b23114a 100644 +--- a/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp ++++ b/src/3rdparty/PhysX/source/physxextensions/src/serialization/SnSerialUtils.cpp +@@ -39,7 +39,7 @@ using namespace physx; + namespace + { + +-#define SN_NUM_BINARY_PLATFORMS 21 ++#define SN_NUM_BINARY_PLATFORMS 22 + const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = + { + PX_MAKE_FOURCC('W','_','3','2'), +@@ -61,6 +61,7 @@ const PxU32 sBinaryPlatformTags[SN_NUM_BINARY_PLATFORMS] = + PX_MAKE_FOURCC('L','A','3','2'), + PX_MAKE_FOURCC('L','V','6','4'), + PX_MAKE_FOURCC('L','N','6','4'), ++ PX_MAKE_FOURCC('L','W','6','4'), + PX_MAKE_FOURCC('U','N','K','_'), + }; + +@@ -86,6 +87,7 @@ const char* sBinaryPlatformNames[SN_NUM_BINARY_PLATFORMS] = + "linuxarm", + "linuxrv64", + "linuxln64", ++ "linuxsw64", + "unknown", + }; + +@@ -135,6 +137,8 @@ PxU32 getBinaryPlatformTag() + return sBinaryPlatformTags[18]; + #elif PX_LINUX && PX_LN64 + return sBinaryPlatformTags[19]; ++#elif PX_LINUX && PX_SW64 ++ return sBinaryPlatformTags[20]; + #else + return sBinaryPlatformTags[20]; + #endif +-- +2.43.5 + + diff --git a/qt6-qtquick3dphysics.spec b/qt6-qtquick3dphysics.spec index a39c6de..bc55bfe 100644 --- a/qt6-qtquick3dphysics.spec +++ b/qt6-qtquick3dphysics.spec @@ -7,7 +7,7 @@ Name: qt6-%{qt_module} Version: 6.5.2 -Release: 2 +Release: 3 Summary: Qt 6 Quick3D Physics Extensions License: GPL-3.0-only URL: https://www.qt.io @@ -19,6 +19,7 @@ Source0: https://download.qt.io/official_releases/qt/%{short_version}/%{version} # https://github.com/felixonmars/archriscv-packages/pull/1821 Patch0: physx-rv64.patch Patch1: physx-loongarch64.patch +Patch2: physx-sw64.patch BuildRequires: cmake BuildRequires: gcc-c++ @@ -115,6 +116,9 @@ popd %endif %changelog +* Mon Nov 03 2025 mahailiang - 6.5.2-3 +- add sw_64 support + * Thu June 27 2024 shaojiansong - 6.5.2-2 - Add support for loongarch64. - Fix lack of patch files in src.rpm package which build from any platform. -- Gitee