Fix pg_popcount_aarch64.c to build with ancient glibc releases.
authorTom Lane <[email protected]>
Tue, 18 Nov 2025 21:16:51 +0000 (16:16 -0500)
committerTom Lane <[email protected]>
Tue, 18 Nov 2025 21:16:51 +0000 (16:16 -0500)
Like commit 6d969ca68, except here we are mopping up after 519338ace.
(There are no other uses of <sys/auxv.h> in the tree, so we should
be done now.)

Reported-by: GaoZengqi <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CAFmBtr3Av62-jBzdhFkDHXJF9vQmNtSnH2upwODjnRcsgdTytw@mail.gmail.com
Backpatch-through: 18

src/port/pg_popcount_aarch64.c

index e515e4d45b8c444326f7f0a7dd833d314d150eef..0b6b86de4d0bcfeb182c3fddca8d127639245749 100644 (file)
 
 #if defined(HAVE_ELF_AUX_INFO) || defined(HAVE_GETAUXVAL)
 #include <sys/auxv.h>
+/* Ancient glibc releases don't include the HWCAPxxx macros in sys/auxv.h */
+#if defined(__linux__) && !defined(HWCAP_SVE)
+#include <asm/hwcap.h>
+#endif
 #endif
 #endif