From db964f6365f19b0dfe9a5c55c51ec0a5d7d15f2c Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 3 Nov 2018 00:46:06 +0100 Subject: bn_mul.h: require at least ARMv6 to enable the ARM DSP code Commit 16b1bd89326e "bn_mul.h: add ARM DSP optimized MULADDC code" added some ARM DSP instructions that was assumed to always be available when __ARM_FEATURE_DSP is defined to 1. Unfortunately it appears that the ARMv5TE architecture (GCC flag -march=armv5te) supports the DSP instructions, but only in Thumb mode and not in ARM mode, despite defining __ARM_FEATURE_DSP in both cases. This patch fixes the build issue by requiring at least ARMv6 in addition to the DSP feature. [jcowgill: Cherry-picked from upstream PR #2169] --- include/mbedtls/bn_mul.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h index 2f7b72fe..734e30e1 100644 --- a/include/mbedtls/bn_mul.h +++ b/include/mbedtls/bn_mul.h @@ -636,7 +636,8 @@ "r6", "r7", "r8", "r9", "cc" \ ); -#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) +#elif (__ARM_ARCH >= 6) && \ + defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) #define MULADDC_INIT \ asm( -- cgit v1.2.3 From 4b58503d3740b35e1f44213bb3c9846b9ff99220 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Tue, 8 Jan 2019 09:29:34 +0000 Subject: Commit patch queue (exported by git-debrebase) [git-debrebase make-patches: export and commit patches] --- ...quire-at-least-ARMv6-to-enable-the-ARM-DS.patch | 33 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch create mode 100644 debian/patches/series diff --git a/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch b/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch new file mode 100644 index 00000000..541b091e --- /dev/null +++ b/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch @@ -0,0 +1,33 @@ +From: Aurelien Jarno +Date: Sat, 3 Nov 2018 00:46:06 +0100 +Subject: bn_mul.h: require at least ARMv6 to enable the ARM DSP code + +Commit 16b1bd89326e "bn_mul.h: add ARM DSP optimized MULADDC code" +added some ARM DSP instructions that was assumed to always be available +when __ARM_FEATURE_DSP is defined to 1. Unfortunately it appears that +the ARMv5TE architecture (GCC flag -march=armv5te) supports the DSP +instructions, but only in Thumb mode and not in ARM mode, despite +defining __ARM_FEATURE_DSP in both cases. + +This patch fixes the build issue by requiring at least ARMv6 in addition +to the DSP feature. + +[jcowgill: Cherry-picked from upstream PR #2169] +--- + include/mbedtls/bn_mul.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h +index 2f7b72f..734e30e 100644 +--- a/include/mbedtls/bn_mul.h ++++ b/include/mbedtls/bn_mul.h +@@ -636,7 +636,8 @@ + "r6", "r7", "r8", "r9", "cc" \ + ); + +-#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) ++#elif (__ARM_ARCH >= 6) && \ ++ defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) + + #define MULADDC_INIT \ + asm( diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..b663b3fb --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch -- cgit v1.2.3 From 9451d371d1c1fba19dd0cf8c40aeba4f86bf4aa3 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 3 Nov 2018 00:46:06 +0100 Subject: bn_mul.h: require at least ARMv6 to enable the ARM DSP code Commit 16b1bd89326e "bn_mul.h: add ARM DSP optimized MULADDC code" added some ARM DSP instructions that was assumed to always be available when __ARM_FEATURE_DSP is defined to 1. Unfortunately it appears that the ARMv5TE architecture (GCC flag -march=armv5te) supports the DSP instructions, but only in Thumb mode and not in ARM mode, despite defining __ARM_FEATURE_DSP in both cases. This patch fixes the build issue by requiring at least ARMv6 in addition to the DSP feature. [jcowgill: Cherry-picked from upstream PR #2169] --- include/mbedtls/bn_mul.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h index c33bd8d4..748975ea 100644 --- a/include/mbedtls/bn_mul.h +++ b/include/mbedtls/bn_mul.h @@ -642,7 +642,8 @@ "r6", "r7", "r8", "r9", "cc" \ ); -#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) +#elif (__ARM_ARCH >= 6) && \ + defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) #define MULADDC_INIT \ asm( -- cgit v1.2.3 From 6d7e9d9e2c6d90adc5c47ed71cc5e8b4598d2a94 Mon Sep 17 00:00:00 2001 From: James Cowgill Date: Mon, 15 Jul 2019 23:39:28 +0100 Subject: Commit patch queue (exported by git-debrebase) [git-debrebase make-patches: export and commit patches] --- ...quire-at-least-ARMv6-to-enable-the-ARM-DS.patch | 33 ++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch create mode 100644 debian/patches/series diff --git a/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch b/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch new file mode 100644 index 00000000..eb3c13d6 --- /dev/null +++ b/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch @@ -0,0 +1,33 @@ +From: Aurelien Jarno +Date: Sat, 3 Nov 2018 00:46:06 +0100 +Subject: bn_mul.h: require at least ARMv6 to enable the ARM DSP code + +Commit 16b1bd89326e "bn_mul.h: add ARM DSP optimized MULADDC code" +added some ARM DSP instructions that was assumed to always be available +when __ARM_FEATURE_DSP is defined to 1. Unfortunately it appears that +the ARMv5TE architecture (GCC flag -march=armv5te) supports the DSP +instructions, but only in Thumb mode and not in ARM mode, despite +defining __ARM_FEATURE_DSP in both cases. + +This patch fixes the build issue by requiring at least ARMv6 in addition +to the DSP feature. + +[jcowgill: Cherry-picked from upstream PR #2169] +--- + include/mbedtls/bn_mul.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h +index c33bd8d..748975e 100644 +--- a/include/mbedtls/bn_mul.h ++++ b/include/mbedtls/bn_mul.h +@@ -642,7 +642,8 @@ + "r6", "r7", "r8", "r9", "cc" \ + ); + +-#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) ++#elif (__ARM_ARCH >= 6) && \ ++ defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) + + #define MULADDC_INIT \ + asm( diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..b663b3fb --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch -- cgit v1.2.3