Skip to content

Commit 98d8e5c

Browse files
committed
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 <[email protected]>
1 parent b2f7be7 commit 98d8e5c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ resolv.h \
397397
strings.h \
398398
syslog.h \
399399
sysexits.h \
400+
sys/auxv.h \
400401
sys/ioctl.h \
401402
sys/file.h \
402403
sys/mman.h \

ext/standard/crc32.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
*/
1616

1717
#include "php.h"
18+
#ifdef PHP_WIN32
19+
#include "config.w32.h"
20+
#else
21+
#include <php_config.h>
22+
#endif
1823
#include "basic_functions.h"
1924
#include "crc32.h"
2025

21-
#if defined(__aarch64__)
26+
#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
2227
# include <arm_acle.h>
2328
# if defined(__linux__)
2429
# include <sys/auxv.h>
@@ -83,7 +88,7 @@ PHP_FUNCTION(crc32)
8388

8489
crc = crcinit^0xFFFFFFFF;
8590

86-
#if defined(__aarch64__)
91+
#if defined(__aarch64__) && defined(HAVE_SYS_AUXV_H)
8792
if (has_crc32_insn()) {
8893
crc = crc32_aarch64(crc, p, nr);
8994
RETURN_LONG(crc^0xFFFFFFFF);

0 commit comments

Comments
 (0)