abseil-cpp: fix 32-bit x86 build of hash.cc

The x86 AES SIMD path in absl/hash/internal/hash.cc uses the 64-bit-only
_mm_cvtsi128_si64 and _mm_extract_epi64 intrinsics but is gated only on
__SSE4_2__ && __AES__, so the 32-bit multilib build fails to compile.

Add a patch that requires __x86_64__/_M_X64 for that path, matching the
existing guard in absl/crc/internal/crc32_x86_arm_combined_simd.h.

Upstream-Bug: https://github.com/abseil/abseil-cpp/issues/2176

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
Jaipaul Cheernam authored and Anuj Mittal committed 2026-10-06 09:50:56 +05:30
1 parent 2cb0b25af3
commit b92e727cf3
2 files changed
+35

No files matched your search

@@ -0,0 +1,34 @@
From be307ee0aa505709f1fe8fc0563c8326ef2bf7a3 Mon Sep 17 00:00:00 2001
From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Date: Thu, 24 Sep 2026 14:59:26 +0000
Subject: [PATCH] Fix 32-bit x86 build of hash.cc
The x86 AES SIMD path in absl/hash/internal/hash.cc uses the 64-bit-only
_mm_cvtsi128_si64 and _mm_extract_epi64 intrinsics but is gated only on
__SSE4_2__ && __AES__, so 32-bit x86 builds fail to compile.
Require __x86_64__/_M_X64 for that path, matching the existing guard in
absl/crc/internal/crc32_x86_arm_combined_simd.h.
Fixes: https://github.com/abseil/abseil-cpp/issues/2176
Upstream-Status: Submitted [https://github.com/abseil/abseil-cpp/pull/2177]
Upstream-Bug: https://github.com/abseil/abseil-cpp/issues/2176
---
absl/hash/internal/hash.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/absl/hash/internal/hash.cc b/absl/hash/internal/hash.cc
index 43cb561b..ef856254 100644
--- a/absl/hash/internal/hash.cc
+++ b/absl/hash/internal/hash.cc
@@ -28,7 +28,8 @@
#ifdef ABSL_AES_INTERNAL_HAVE_X86_SIMD
#error ABSL_AES_INTERNAL_HAVE_X86_SIMD cannot be directly set
-#elif defined(__SSE4_2__) && defined(__AES__)
+#elif defined(__SSE4_2__) && defined(__AES__) && \
+ (defined(__x86_64__) || defined(_M_X64))
#define ABSL_AES_INTERNAL_HAVE_X86_SIMD
#endif
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
SRC_URI = "https://github.com/abseil/${BPN}/releases/download/${PV}/${BP}.tar.gz \
file://0001-absl-always-use-asm-sgidefs.h.patch \
file://0002-abseil-ppc-fixes.patch \
file://0003-hash-restrict-x86-AES-SIMD-path-to-64-bit-targets.patch \
"
SRC_URI[sha256sum] = "4314e2a7cbac89cac25a2f2322870f343d81579756ceff7f431803c2c9090195"