From 4b1da8c19b9ea59aa9e2314774552c2fb6fe2579 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Wed, 12 Jan 2022 12:41:04 +0200 Subject: [PATCH] nettle: make Neon detection work, and infer armv6 ARMv6 detection relied on seeing armv6 or armv7 in the toolchain name, which is not the case. And with ARMv6 not detected, the Neon detection wasn't attempted. Always attempt Neon detection for arm, and if found, assume ARMv6 too. This avoids having to think about changing the ARMv6 detection. --- release/src/router/nettle/configure | 16 ++++++++-------- release/src/router/nettle/configure.ac | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/release/src/router/nettle/configure b/release/src/router/nettle/configure index 500bd92552e..0a191ab8ba1 100755 --- a/release/src/router/nettle/configure +++ b/release/src/router/nettle/configure @@ -6564,9 +6564,7 @@ if test "x$enable_assembler" = xyes ; then OPT_NETTLE_SOURCES="fat-arm.c $OPT_NETTLE_SOURCES" FAT_TEST_LIST="arch:5 arch:6,neon" else - case "$host_cpu" in - armv6* | armv7*) - if test "$enable_arm_neon" = auto ; then + if test "$enable_arm_neon" = auto ; then if test "$cross_compiling" = yes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler accepts Neon instructions" >&5 $as_echo_n "checking if assembler accepts Neon instructions... " >&6; } @@ -6613,12 +6611,14 @@ $as_echo "$enable_arm_neon" >&6; } fi fi - - asm_path="arm/v6 arm" - ;; - esac if test "x$enable_arm_neon" = xyes ; then - asm_path="arm/neon $asm_path" + asm_path="arm/neon arm/v6 $asm_path" + else + case "$host_cpu" in + armv678*) + asm_path="arm/v6 arm" + ;; + esac fi fi ;; diff --git a/release/src/router/nettle/configure.ac b/release/src/router/nettle/configure.ac index f4d9e905795..c458fa51321 100644 --- a/release/src/router/nettle/configure.ac +++ b/release/src/router/nettle/configure.ac @@ -447,15 +447,15 @@ if test "x$enable_assembler" = xyes ; then OPT_NETTLE_SOURCES="fat-arm.c $OPT_NETTLE_SOURCES" FAT_TEST_LIST="arch:5 arch:6,neon" else - case "$host_cpu" in - armv6* | armv7*) - NETTLE_CHECK_ARM_NEON - - asm_path="arm/v6 arm" - ;; - esac + NETTLE_CHECK_ARM_NEON if test "x$enable_arm_neon" = xyes ; then - asm_path="arm/neon $asm_path" + asm_path="arm/neon arm/v6 $asm_path" + else + case "$host_cpu" in + armv[678]*) + asm_path="arm/v6 arm" + ;; + esac fi fi ;;