Skip to content

Commit

Permalink
Add a component to all.sh to build with MBEDTLS_SHA*_USE_A64_CRYPTO_ONLY
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Cosgrove <[email protected]>
  • Loading branch information
tom-cosgrove-arm committed Mar 16, 2022
1 parent 2785928 commit 6132fa0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/scripts/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,34 @@ component_test_no_x509_info () {
tests/ssl-opt.sh
}

component_build_neon_intrinsics () {
msg "build: default + MBEDTLS_SHAxxx_USE_A64_CRYPTO_ONLY"
scripts/config.py set MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY
scripts/config.py set MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY
make CFLAGS="-march=armv8.2-a+crypto+sha3" lib
}

support_build_neon_intrinsics () {
case $(uname -m) in
aarch64|arm64) true;;
*) return 1;; # i.e. not supported
esac
CCVER=$(cc --version)
if echo "$CCVER" | grep -q clang; then
# clang supports SHA256 intrinsics and SHA512 instructions from 7.x
MAJ=$(echo "$CCVER" | grep 'clang version' | sed 's/.*clang version \([0-9]\+\).*/\1/')
expr "$MAJ" \> 6 >/dev/null
else
if echo "$CCVER" | grep -q gcc; then
# gcc supports SHA256 and SHA512 intrinsics from 8.x
MAJ=$(cc -dumpversion | sed 's/\..*//')
expr "$MAJ" \> 7 >/dev/null
else
false
fi
fi
}

component_build_arm_none_eabi_gcc () {
msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -O1" # ~ 10s
scripts/config.py baremetal
Expand Down

0 comments on commit 6132fa0

Please sign in to comment.