From e1aee98a97217b2cc02f524412b32b858f8132ae Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 3 Mar 2023 22:30:33 -0800 Subject: [PATCH] [physx] Fix x86 Linux build errors As per comments in the source, "some GCC compilers need the compiler flag -malign-double to be set." https://github.com/NVIDIAGameWorks/PhysX/blob/a2c0428acab643e60618c681b501e86f7fd558cc/pxshared/include/foundation/PxPreprocessor.h#L473 --- ports/physx/fix-compiler-flag.patch | 17 +++++++++++++++++ ports/physx/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/p-/physx.json | 5 +++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ports/physx/fix-compiler-flag.patch b/ports/physx/fix-compiler-flag.patch index cfb253e7e1c6e3..a389673579119d 100644 --- a/ports/physx/fix-compiler-flag.patch +++ b/ports/physx/fix-compiler-flag.patch @@ -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 + diff --git a/ports/physx/vcpkg.json b/ports/physx/vcpkg.json index 1ac0619f91f95e..1a6f52f45381c1 100644 --- a/ports/physx/vcpkg.json +++ b/ports/physx/vcpkg.json @@ -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, diff --git a/versions/baseline.json b/versions/baseline.json index ea4472b03a92a7..4a280940460537 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6017,7 +6017,7 @@ }, "physx": { "baseline": "4.1.2", - "port-version": 5 + "port-version": 6 }, "picojson": { "baseline": "1.3.0", diff --git a/versions/p-/physx.json b/versions/p-/physx.json index 74f728e8abbac5..1dd96b9c2ac178 100644 --- a/versions/p-/physx.json +++ b/versions/p-/physx.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "038801f9419a356c7082b1501620bdef60da6d66", + "version": "4.1.2", + "port-version": 6 + }, { "git-tree": "b081926dc46f3fadf1696719e4b708f4cd136f25", "version": "4.1.2",