Re: Compile error on the aarch64 platform: Missing asm/hwcap.h
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Naylor <johncnaylorls@gmail.com>
Cc: 高增琦 <pgf00a@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-14T19:37:48Z
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
I wrote: > I wonder if the "&& !defined(__aarch64__)" bit needs to be removed. No, that idea is off-track. Looking at the following code, the HWCAP2_CRC32 flag is only relevant on ARM32, so we don't need to worry about obtaining a definition for it on aarch64 (and we'd likely not find one anyway). The OP is seemingly building on ARM32, else it shouldn't try to reference this symbol. I checked an old ARM32 Red Hat installation (Fedora 30, so it's not as old as RHEL7, but it's the oldest image I've got) and verified that <asm/hwcap.h> exists, and it defines HWCAP2_CRC32, and our current code builds fine on it. > But yeah, the real question is what is the difference between the > OP's machine and everyplace else where this code works fine ... After staring at the code for awhile, it appears to me that the only way to explain this report is that "defined(__linux__)" isn't true on the OP's machine. Which is quite hard to believe, and if it's the case then it's not something to fix on our side. regards, tom lane