From 95d6d9c3f9ee389fffa337e9d73e88d6fa8e0bf9 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Wed, 17 May 2023 02:12:21 +0200 Subject: [PATCH] mumble: Fix 32-bit build 32-bit builds fail due to the following error. Apply a patch from master to fix the issue. [ 25%] Building CXX object plugins/gtav/CMakeFiles/gtav.dir/gtav.cpp.o In file included from /build/source/plugins/gtav/Game.h:9, from /build/source/plugins/gtav/gtav.cpp:6: /build/source/plugins/gtav/structs.h:218:37: error: static assertion failed 218 | static_assert(sizeof(CCameraAngles) == 0x408, ""); | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /build/source/plugins/gtav/structs.h:218:37: note: the comparison reduces to '(1028 == 1032)' Signed-off-by: Felix Singer --- ...udio-Force-8-bytes-alignment-for-CCa.patch | 31 +++++++++++++++++++ .../networking/mumble/default.nix | 1 + 2 files changed, 32 insertions(+) create mode 100644 pkgs/applications/networking/mumble/0002-FIX-positional-audio-Force-8-bytes-alignment-for-CCa.patch diff --git a/pkgs/applications/networking/mumble/0002-FIX-positional-audio-Force-8-bytes-alignment-for-CCa.patch b/pkgs/applications/networking/mumble/0002-FIX-positional-audio-Force-8-bytes-alignment-for-CCa.patch new file mode 100644 index 000000000000..eb8be6512968 --- /dev/null +++ b/pkgs/applications/networking/mumble/0002-FIX-positional-audio-Force-8-bytes-alignment-for-CCa.patch @@ -0,0 +1,31 @@ +From 13c051b36b387356815cff5d685bc628b74ba136 Mon Sep 17 00:00:00 2001 +From: Davide Beatrici +Date: Thu, 1 Sep 2022 23:32:57 +0200 +Subject: [PATCH] FIX(positional-audio): Force 8 bytes alignment for + CCameraAngles in GTAV plugin + +https://en.cppreference.com/w/cpp/language/alignas + +This fixes compilation when the implicit alignment is not 8 bytes. + +It can be the case with 32 bit targets. +--- + plugins/gtav/structs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/gtav/structs.h b/plugins/gtav/structs.h +index 2829dc11e..0e4f76eda 100644 +--- a/plugins/gtav/structs.h ++++ b/plugins/gtav/structs.h +@@ -118,7 +118,7 @@ struct CCameraManagerAngles { + ptr_t cameraAngles; // CCameraAngles * + }; + +-struct CCameraAngles { ++struct alignas(8) CCameraAngles { + uint8_t pad1[960]; + ptr_t playerAngles; // CPlayerAngles * + uint8_t pad2[60]; +-- +2.38.5 + diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index 5a6e511e28a5..d0d679a9eead 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -22,6 +22,7 @@ let patches = [ ./0001-BUILD-crypto-Migrate-to-OpenSSL-3.0-compatible-API.patch + ./0002-FIX-positional-audio-Force-8-bytes-alignment-for-CCa.patch ]; nativeBuildInputs = [ cmake pkg-config python3 qt5.wrapQtAppsHook qt5.qttools ]