[physx] Fix x86 Linux build errors (#30014)

As per comments in the source, "some GCC compilers need the compiler
flag -malign-double to be set."
a2c0428aca/pxshared/include/foundation/PxPreprocessor.h (L473)
This commit is contained in:
Darryl Pogue 2023-03-20 01:18:05 -07:00 committed by GitHub
parent 7d5f1f3e13
commit e12d82b8eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 2 deletions

View File

@ -56,3 +56,20 @@ index a1ab3596..dbd20fb0 100644
# cache lib type defs
IF(PX_GENERATE_STATIC_LIBRARIES)
diff --git a/physx/source/compiler/cmake/linux/CMakeLists.txt b/physx/source/compiler/cmake/linux/CMakeLists.txt
index 6246e488..7bf0cc30 100644
--- a/physx/source/compiler/cmake/linux/CMakeLists.txt
+++ b/physx/source/compiler/cmake/linux/CMakeLists.txt
@@ -36,6 +36,11 @@ IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -fstrict-aliasing ${CLANG_WARNINGS}" CACHE INTERNAL "PhysX CXX")
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(PHYSX_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions -ffunction-sections -fdata-sections -fno-strict-aliasing ${GCC_WARNINGS}" CACHE INTERNAL "PhysX CXX")
+
+ # Enable SSE2 and fix double alignment for 32-bit x86 builds
+ IF (CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*")
+ STRING(APPEND PHYSX_CXX_FLAGS " -malign-double -msse2")
+ ENDIF()
ENDIF()
# Build debug info for all configurations

View File

@ -1,7 +1,7 @@
{
"name": "physx",
"version": "4.1.2",
"port-version": 5,
"port-version": 6,
"description": "The NVIDIA PhysX SDK is a scalable multi-platform physics solution supporting a wide range of devices, from smartphones to high-end multicore CPUs and GPUs",
"homepage": "https://github.com/NVIDIAGameWorks/PhysX",
"license": null,

View File

@ -6050,7 +6050,7 @@
},
"physx": {
"baseline": "4.1.2",
"port-version": 5
"port-version": 6
},
"picojson": {
"baseline": "1.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "038801f9419a356c7082b1501620bdef60da6d66",
"version": "4.1.2",
"port-version": 6
},
{
"git-tree": "b081926dc46f3fadf1696719e4b708f4cd136f25",
"version": "4.1.2",