Compile error on the aarch64 platform: Missing asm/hwcap.h
高增琦 <pgf00a@gmail.com>
From: 高增琦 <pgf00a@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-14T04:02:30Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix pg_popcount_aarch64.c to build with ancient glibc releases.
- 6a5170755127 18.2 landed
- 3e83bdd35a5f 19 (unreleased) landed
-
Fix pg_crc32c_armv8_choose.c to build with ancient glibc releases.
- db4eba15266e 18.2 landed
- 6d969ca687b4 19 (unreleased) landed
Hi, Compile error on CentOS Linux release 7.6.1810 (AltArch) with the message “‘HWCAP_CRC32’ undeclared”. Relevant code from discussion: https://www.postgresql.org/message-id/4496616.iHFcN1HehY%40portable-bastien It mentions: "It doesn't look like I need to include <asm/hwcap.h> from Bastien's original message, because <sys/auxv.h> pulls in <bits/hwcap.h> already." However, the bits/hwcap.h file included with glibc in CentOS 7.6 lacks these symbol definitions (the file is nearly empty). This file appears to be an internal glibc dependency, so it's preferable to directly use asm/hwcap.h for the required symbol definitions. After modifying the code to add `include <asm/hwcap.h>`, the compilation succeeded. -- GaoZengqi pgf00a@gmail.com zengqigao@gmail.com