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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: 高增琦 <pgf00a(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Compile error on the aarch64 platform: Missing asm/hwcap.h
Date: 2025-11-14 19:37:48
Message-ID: 3225796.1763149068@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Tkachenko 2025-11-14 19:43:31 [BUG] pg_basebackup produces wrong incremental files after relation truncation in segmented tables
Previous Message Nathan Bossart 2025-11-14 19:01:08 Re: Uncommented GUC in postgresql.conf.sample