Remove dependency on asm/hwcap.h
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/sha256.c b/library/sha256.c
index a6d0a7a..596b2c5 100644
--- a/library/sha256.c
+++ b/library/sha256.c
@@ -126,7 +126,13 @@
# if defined(__linux__)
/* Our preferred method of detection is getauxval() */
# include <sys/auxv.h>
-# include <asm/hwcap.h>
+/* These are not always defined via sys/auxv.h */
+# if !defined(HWCAP_SHA2)
+# define HWCAP_SHA2 (1 << 6)
+# endif
+# if !defined(HWCAP2_SHA2)
+# define HWCAP2_SHA2 (1 << 3)
+# endif
# endif
/* Use SIGILL on Unix, and fall back to it on Linux */
# include <signal.h>
diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh
index 28767eb..114f271 100755
--- a/tests/scripts/all.sh
+++ b/tests/scripts/all.sh
@@ -4344,10 +4344,7 @@
# clang >= 4 is required to build with SHA extensions
clang_ver="$(clang --version|grep version|sed -E 's#.*version ([0-9]+).*#\1#')"
- # we need asm/hwcap.h available for runtime detection
- echo '#include <asm/hwcap.h>' | clang -E - >/dev/null 2>&1 && have_hwcap=1 || have_hwcap=0
-
- [[ "${clang_ver}" -ge 4 && "${have_hwcap}" -eq 1 ]]
+ [[ "${clang_ver}" -ge 4 ]]
else
# clang not available
false