diff --git a/package/sysprof/0001-contrib-eggbitset-disable-x64-code-paths-on-32-bit-x86.patch b/package/sysprof/0001-contrib-eggbitset-disable-x64-code-paths-on-32-bit-x86.patch new file mode 100644 index 0000000000..2b2c6cb6cb --- /dev/null +++ b/package/sysprof/0001-contrib-eggbitset-disable-x64-code-paths-on-32-bit-x86.patch @@ -0,0 +1,53 @@ +From 22c10f0dbd3c357e96f83f430ebe05d24a25c536 Mon Sep 17 00:00:00 2001 +From: Yegor Yefremov +Date: Sat, 17 Oct 2026 22:47:15 +0200 +Subject: [PATCH] contrib/eggbitset: disable x64 code paths on 32-bit x86 + +roaring.h enables USEAVX (and thus IS_X64) whenever __AVX2__ is defined, +and USESSE4 whenever __POPCNT__ and __SSE4_2__ are defined. This also +happens on 32-bit x86 targets such as i686 built with -march=haswell, +where 64-bit only intrinsics like _mm_popcnt_u64() and +_mm256_extract_epi64() are not available, so the build fails with: + + roaring.h:260:18: error: implicit declaration of function + '_mm_popcnt_u64'; did you mean '_mm_popcnt_u32'? + [-Wimplicit-function-declaration] + roaring.h:1011:23: error: implicit declaration of function + '_mm256_extract_epi64'; did you mean '_mm256_extract_epi8'? + [-Wimplicit-function-declaration] + +Define DISABLE_X64 from the build system when building for 32-bit x86 so +that the portable implementation is used instead. This keeps the bundled +CRoaring sources unmodified, making future updates a plain copy. +DISABLE_X64 is only set for x86, as it also guards the NEON detection +used on ARM. + +Upstream: https://gitlab.gnome.org/GNOME/sysprof/-/commit/22c10f0dbd3c357e96f83f430ebe05d24a25c536 +Signed-off-by: Yegor Yefremov +--- + contrib/eggbitset/meson.build | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/contrib/eggbitset/meson.build b/contrib/eggbitset/meson.build +index 82cd8a40..f2f81685 100644 +--- a/contrib/eggbitset/meson.build ++++ b/contrib/eggbitset/meson.build +@@ -6,9 +6,18 @@ libeggbitset_deps = [ + gio_dep, + ] + ++libeggbitset_c_args = [] ++ ++# roaring.h enables its x64 code paths based on __AVX2__/__SSE4_2__ alone, ++# but they rely on intrinsics only available on 64-bit x86. ++if host_machine.cpu_family() == 'x86' ++ libeggbitset_c_args += ['-DDISABLE_X64'] ++endif ++ + libeggbitset_static = static_library('eggbitset', libeggbitset_sources, + gnu_symbol_visibility: 'hidden', + dependencies: libeggbitset_deps, ++ c_args: libeggbitset_c_args, + ) + + libeggbitset_static_dep = declare_dependency(