Detection of hadware feature => please do not use signal

From: Bastien Roucariès <rouca(at)debian(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Detection of hadware feature => please do not use signal
Date: 2024-10-31 15:41:24
Message-ID: 4496616.iHFcN1HehY@portable-bastien
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On debian side we will like to avoid use of sigill to detect feature.

https://sources.debian.org/src/postgresql-17/17.0-1/src/port/pg_crc32c_armv8_choose.c/#L55

is really bad.

Could you use the canonical way under linux

#include <sys/auxv.h>
#include <asm/hwcap.h>

#if defined(__aarch64__)
return !(getauxval(AT_HWCAP) & HWCAP_CRC32);
#else
return !(getauxval(AT_HWCAP2) & HWCAP2_CRC32);
#endif

Thanks

Rouca

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2024-10-31 17:29:45 Re: Detection of hadware feature => please do not use signal
Previous Message Daniel Gustafsson 2024-10-31 13:53:21 Re: BUG #18675: Postgres is not realasing memory causing OOM