diff options
author | Peter Seiderer <ps.report@gmx.net> | 2020-03-09 15:36:48 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-10 16:53:57 +0100 |
commit | f73528f0e0d59ac744ccb4a94a3a9d7b9f0fba1b (patch) | |
tree | b44a85ce1c7e50dc7f3854676278c93a42c64ef5 | |
parent | fea2994ff83ac75dcb5b186964f20a21b1df3ec0 (diff) | |
download | php-git-f73528f0e0d59ac744ccb4a94a3a9d7b9f0fba1b.tar.gz |
Check for sys/auxv.h before using it.
Fixes aarch64 compile with uclibc-ng (does not provide
sys/auxv.h header file).
Closes GH-5248.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | ext/standard/crc32.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 12e130902b..fd025d37c7 100644 --- a/configure.ac +++ b/configure.ac @@ -440,6 +440,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 c3ca59036c..765135a142 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -20,7 +20,7 @@ #include "basic_functions.h" #include "crc32.h" -#if defined(__aarch64__) +#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H) # include <arm_acle.h> # if defined(__linux__) # include <sys/auxv.h> @@ -85,7 +85,7 @@ PHP_NAMED_FUNCTION(php_if_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); |