From 235f5bf8ae40241d0967e47efacd4f1ff756c0d4 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 26 Mar 2019 18:40:51 +0000 Subject: [PATCH] Check for auxv.h and hwcap.h before including them. uClibc-ng does not provide , and a non-Linux-kernel-based Unixlike system running on Arm will probably not provide . Now we check for both of those headers at autoconf time, and if either one is absent, we don't do the runtime test for Arm crypto acceleration. This should only make a difference on systems where this module previously failed to compile at all. But obviously it would be nicer to find alternative ways to check for crypto acceleration on such systems; patches welcome. --- configure.ac | 1 + unix/uxutils.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 38b3e8b9..1949ef62 100644 --- a/configure.ac +++ b/configure.ac @@ -175,6 +175,7 @@ AC_CHECK_LIB(X11, XOpenDisplay, AC_CHECK_FUNCS([getaddrinfo posix_openpt ptsname setresuid strsignal updwtmpx fstatat dirfd futimes]) AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include ]]) +AC_CHECK_HEADERS([sys/auxv.h asm/hwcap.h]) AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME],[],[Define if clock_gettime() is available])]) AC_CACHE_CHECK([for SO_PEERCRED and dependencies], [x_cv_linux_so_peercred], [ diff --git a/unix/uxutils.c b/unix/uxutils.c index fcbcc4d4..7b63842e 100644 --- a/unix/uxutils.c +++ b/unix/uxutils.c @@ -1,6 +1,8 @@ +#include "putty.h" #include "ssh.h" -#if defined __linux__ && (defined __arm__ || defined __aarch64__) +#if defined __linux__ && (defined __arm__ || defined __aarch64__) && \ + HAVE_SYS_AUXV_H && HAVE_ASM_HWCAP_H #include #include