Simplify aesni support test

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-06-19 11:51:33 +01:00
parent f8986e3147
commit 6a08b68c90

View File

@ -3503,22 +3503,19 @@ component_test_malloc_0_null () {
tests/ssl-opt.sh -e 'proxy' tests/ssl-opt.sh -e 'proxy'
} }
support_build_aesni() { support_test_aesni() {
# Check that gcc targets x86_64 # Check that gcc targets x86_64 (we can build AESNI), and check for
gcc -v 2>&1 | grep Target | grep -q x86_64 # AESNI support on the host (we can run AESNI).
} #
# The name of this function is possibly slightly misleading, but needs to align
support_run_aesni() { # with the name of the corresponding test, component_test_aesni.
# Check for AESNI support on the host.
# #
# In principle 32-bit x86 can support AESNI, but our implementation does not # In principle 32-bit x86 can support AESNI, but our implementation does not
# support 32-bit x86, so we check for x86-64. # support 32-bit x86, so we check for x86-64.
# We can only grep /proc/cpuinfo on Linux, so this also checks for Linux # We can only grep /proc/cpuinfo on Linux, so this also checks for Linux
[[ "$HOSTTYPE" == "x86_64" && "$OSTYPE" == "linux-gnu" ]] && </proc/cpuinfo grep '^flags' | grep -w aes (gcc -v 2>&1 | grep Target | grep -q x86_64) &&
} [[ "$HOSTTYPE" == "x86_64" && "$OSTYPE" == "linux-gnu" ]] &&
(grep '^flags' /proc/cpuinfo | grep -w aes)
support_test_aesni () {
support_build_aesni && support_run_aesni
} }
component_test_aesni () { # ~ 60s component_test_aesni () { # ~ 60s