Skip to content

Commit f73528f

Browse files
pseiderernikic
authored andcommitted
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>
1 parent fea2994 commit f73528f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ resolv.h \
440440
strings.h \
441441
syslog.h \
442442
sysexits.h \
443+
sys/auxv.h \
443444
sys/ioctl.h \
444445
sys/file.h \
445446
sys/mman.h \

ext/standard/crc32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "basic_functions.h"
2121
#include "crc32.h"
2222

23-
#if defined(__aarch64__)
23+
#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
2424
# include <arm_acle.h>
2525
# if defined(__linux__)
2626
# include <sys/auxv.h>
@@ -85,7 +85,7 @@ PHP_NAMED_FUNCTION(php_if_crc32)
8585

8686
crc = crcinit^0xFFFFFFFF;
8787

88-
#if defined(__aarch64__)
88+
#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
8989
if (has_crc32_insn()) {
9090
crc = crc32_aarch64(crc, p, nr);
9191
RETURN_LONG(crc^0xFFFFFFFF);

0 commit comments

Comments
 (0)