From 67b0e435f36a51b256d72490bc569fcce00913df Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 4 Jun 2021 19:29:27 +0100 Subject: [PATCH] crc32 feature detection from auxiliary vectors on FreeBSD --- ext/standard/crc32.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index a41eb560a73..293fab43bbc 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -26,6 +26,15 @@ # include # elif defined(__APPLE__) # include +# elif defined(__FreeBSD__) +# include + +static unsigned long getauxval(unsigned long key) { + unsigned long ret = 0; + if (elf_aux_info(key, &ret, sizeof(ret)) != 0) + return 0; + return ret; +} # endif static inline int has_crc32_insn() {