From c097b2794963d8203bc09d72fc4678fc1c1174bd Mon Sep 17 00:00:00 2001 From: Peter Seiderer Date: Mon, 9 Mar 2020 15:36:48 +0100 Subject: [PATCH] Check for sys/auxv.h before using it. Fixes aarch64 compile with uclibc-ng (does not provide sys/auxv.h header file). Signed-off-by: Peter Seiderer --- configure.ac | 1 + ext/standard/crc32.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 651fc9c194fb0..d1d483447f74f 100644 --- a/configure.ac +++ b/configure.ac @@ -397,6 +397,7 @@ resolv.h \ strings.h \ syslog.h \ sysexits.h \ +sys/auxv.h \ sys/ioctl.h \ sys/file.h \ sys/mman.h \ diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index a0e5d6d816091..ee8ef685d6aff 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -18,7 +18,7 @@ #include "basic_functions.h" #include "crc32.h" -#if defined(__aarch64__) +#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H) # include # if defined(__linux__) # include @@ -83,7 +83,7 @@ PHP_FUNCTION(crc32) crc = crcinit^0xFFFFFFFF; -#if defined(__aarch64__) +#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H) if (has_crc32_insn()) { crc = crc32_aarch64(crc, p, nr); RETURN_LONG(crc^0xFFFFFFFF);