diff options
| author | Tom Lane | 2025-11-17 20:24:34 +0000 |
|---|---|---|
| committer | Tom Lane | 2025-11-17 20:24:34 +0000 |
| commit | 6d969ca687b4b2d4387d318c3fbcf3fc606ea55b (patch) | |
| tree | 986614004388defcca54901454f317f322f0a2f0 | |
| parent | ed931377abc0403ce137d9a7f7ded67cb9355c8d (diff) | |
If you go back as far as the RHEL7 era, <sys/auxv.h> does not provide
the HWCAPxxx macros needed with elf_aux_info or getauxval, so you need
to get those from the kernel header <asm/hwcap.h> instead. We knew
that for the 32-bit case but failed to extrapolate to the 64-bit case.
Oversight in commit aac831caf.
Reported-by: GaoZengqi <[email protected]>
Author: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/CAFmBtr3Av62-jBzdhFkDHXJF9vQmNtSnH2upwODjnRcsgdTytw@mail.gmail.com
Backpatch-through: 18
| -rw-r--r-- | src/port/pg_crc32c_armv8_choose.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/port/pg_crc32c_armv8_choose.c b/src/port/pg_crc32c_armv8_choose.c index ec12be1bbc3..c0001cfe2dc 100644 --- a/src/port/pg_crc32c_armv8_choose.c +++ b/src/port/pg_crc32c_armv8_choose.c @@ -26,7 +26,8 @@ #if defined(HAVE_ELF_AUX_INFO) || defined(HAVE_GETAUXVAL) #include <sys/auxv.h> -#if defined(__linux__) && !defined(__aarch64__) && !defined(HWCAP2_CRC32) +/* Ancient glibc releases don't include the HWCAPxxx macros in sys/auxv.h */ +#if defined(__linux__) && (defined(__aarch64__) ? !defined(HWCAP_CRC32) : !defined(HWCAP2_CRC32)) #include <asm/hwcap.h> #endif #endif |
