Remove dependency on asm/hwcap.h

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-10-23 15:12:32 +01:00
parent f2ea08ae50
commit 66d5512571
2 changed files with 8 additions and 5 deletions

View file

@ -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>

View file

@ -4344,10 +4344,7 @@ support_build_sha_armce() {
# 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