Compile error on the aarch64 platform: Missing asm/hwcap.h

From: 高增琦 <pgf00a(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Compile error on the aarch64 platform: Missing asm/hwcap.h
Date: 2025-11-14 04:02:30
Message-ID: CAFmBtr3Av62-jBzdhFkDHXJF9vQmNtSnH2upwODjnRcsgdTytw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)gmail(dot)com
zengqigao(at)gmail(dot)com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-11-14 04:06:49 Re: misleading error message in ProcessUtilitySlow T_CreateStatsStmt
Previous Message Amit Kapila 2025-11-14 03:53:20 Re: DOCS: Missing <structfield> tags for some SEQUENCE fields