[packages/gtk4] - patch for x32 compatibility

qboosh qboosh at pld-linux.org
Wed Sep 17 19:54:52 CEST 2025


commit aed160243c517cb931e08c7abe7cc927e5d82641
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Sep 17 19:57:48 2025 +0200

    - patch for x32 compatibility

 gtk4-x32.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gtk4.spec      |  2 ++
 2 files changed, 58 insertions(+)
---
diff --git a/gtk4.spec b/gtk4.spec
index 231c22a..7963f5a 100644
--- a/gtk4.spec
+++ b/gtk4.spec
@@ -29,6 +29,7 @@ Group:		X11/Libraries
 Source0:	https://download.gnome.org/sources/gtk/4.20/gtk-%{version}.tar.xz
 # Source0-md5:	865e4e4e592d2e166406508d0324a146
 Patch0:		%{name}-print-backends.patch
+Patch1:		%{name}-x32.patch
 URL:		https://www.gtk.org/
 %{?with_vulkan:BuildRequires:	Vulkan-Loader-devel >= 1.3}
 %{?with_accesskit:BuildRequires:	accesskit-c-devel >= 0.17}
@@ -339,6 +340,7 @@ GTK - przykładowe programy.
 %prep
 %setup -q -n gtk-%{version}
 %patch -P0 -p1
+%patch -P1 -p1
 
 %{__sed} -i -e '1s,/usr/bin/env python3,%{__python3},' demos/gtk-demo/geninclude.py
 %{__sed} -i -e '1s,/usr/bin/env .* gjs,/usr/bin/gjs,' examples/labels.js
diff --git a/gtk4-x32.patch b/gtk4-x32.patch
new file mode 100644
index 0000000..cfcca3a
--- /dev/null
+++ b/gtk4-x32.patch
@@ -0,0 +1,56 @@
+--- gtk-4.20.1/gtk/roaring/roaring.c.orig	2025-09-08 22:57:32.000000000 +0200
++++ gtk-4.20.1/gtk/roaring/roaring.c	2025-09-17 19:31:50.649239755 +0200
+@@ -12882,15 +12882,15 @@ static inline uint64_t _asm_bitset_set_l
+                                                      uint64_t card,
+                                                      const uint16_t *list,
+                                                      uint64_t length) {
+-    uint64_t offset, load, pos;
+-    uint64_t shift = 6;
++    uintptr_t offset, load, pos;
++    uintptr_t shift = 6;
+     const uint16_t *end = list + length;
+     if (!length) return card;
+     // TODO: could unroll for performance, see bitset_set_list
+     // bts is not available as an intrinsic in GCC
+     __asm volatile(
+         "1:\n"
+-        "movzwq (%[list]), %[pos]\n"
++        "movzw (%[list]), %[pos]\n"
+         "shrx %[shift], %[pos], %[offset]\n"
+         "mov (%[words],%[offset],8), %[load]\n"
+         "bts %[pos], %[load]\n"
+@@ -12907,12 +12907,12 @@ static inline uint64_t _asm_bitset_set_l
+ 
+ static inline void _asm_bitset_set_list(uint64_t *words, const uint16_t *list,
+                                         uint64_t length) {
+-    uint64_t pos;
++    uintptr_t pos;
+     const uint16_t *end = list + length;
+ 
+-    uint64_t shift = 6;
+-    uint64_t offset;
+-    uint64_t load;
++    uintptr_t shift = 6;
++    uintptr_t offset;
++    uintptr_t load;
+     for (; list + 3 < end; list += 4) {
+         pos = list[0];
+         __asm volatile(
+@@ -12964,14 +12964,14 @@ static inline void _asm_bitset_set_list(
+ static inline uint64_t _asm_bitset_clear_list(uint64_t *words, uint64_t card,
+                                               const uint16_t *list,
+                                               uint64_t length) {
+-    uint64_t offset, load, pos;
+-    uint64_t shift = 6;
++    uintptr_t offset, load, pos;
++    uintptr_t shift = 6;
+     const uint16_t *end = list + length;
+     if (!length) return card;
+     // btr is not available as an intrinsic in GCC
+     __asm volatile(
+         "1:\n"
+-        "movzwq (%[list]), %[pos]\n"
++        "movzw (%[list]), %[pos]\n"
+         "shrx %[shift], %[pos], %[offset]\n"
+         "mov (%[words],%[offset],8), %[load]\n"
+         "btr %[pos], %[load]\n"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gtk4.git/commitdiff/aed160243c517cb931e08c7abe7cc927e5d82641



More information about the pld-cvs-commit mailing list