Failure building libpq v18.0 on old aarch64

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Failure building libpq v18.0 on old aarch64
Date: 2025-10-13 01:06:49
Message-ID: CA+mi_8ZiG9ZNwE2J3Ei5SXhzhrff9=B3KKdmcXk19JJWG2snbQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

libpq v18 fails to build on aarch64 on rather old Centos versions. The error is:

pg_crc32c_armv8_choose.c: In function ‘pg_crc32c_armv8_available’:
pg_crc32c_armv8_choose.c:58:32: error: ‘HWCAP_CRC32’ undeclared
(first use in this function)
58 | return (getauxval(AT_HWCAP) & HWCAP_CRC32) != 0;
| ^~~~~~~~~~~

and is related to the change in aac831cafa6f3106dfcbd3298757801c299351fc.

The error affects the "manylinux2014" image, running Centos 7, used to
build Python packages with glibc 2.17 ABI compatibility. Centos 7 was
EOL'd in 2024, therefore, if your decision is to not support it
anymore, it is understandable; this is a FYI in case the breakage was
unexpected and a workaround is possible.

In Psycopg CI, where I have found the breakage, I have updated the
build image to manylinux_2_28 (AlmaLinux 8, glibc 2.28 ABI
compatibility), which took some effort [1] but now it's done, so the
issue should not be a blocker.

More info about the manylinux build images is at
<https://github.com/pypa/manylinux>.

The image where build fails contains:

$ docker run --rm quay.io/pypa/manylinux2014_aarch64 sh -c "cat
/etc/centos-release && grep -r HWCAP_CRC32 /usr/include"
CentOS Linux release 7.9.2009 (AltArch)
/usr/include/asm/hwcap.h:#define HWCAP_CRC32 (1 << 7)

Build succeeds on the following image:

$ docker run --rm quay.io/pypa/manylinux_2_28_aarch64 sh -c "cat
/etc/centos-release && grep -r HWCAP_CRC32 /usr/include"
AlmaLinux release 8.10 (Cerulean Leopard)
/usr/include/asm/hwcap.h:#define HWCAP_CRC32 (1 << 7)
/usr/include/bits/hwcap.h:#define HWCAP_CRC32 (1 << 7)

Cheers

-- Daniele

[1] https://fosstodon.org/@psycopg/115353111198001859

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-10-13 01:07:39 Core dumps from recovery/017_shm
Previous Message Peter Smith 2025-10-13 00:59:21 Re: Logical Replication of sequences