summaryrefslogtreecommitdiff
path: root/debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch')
-rw-r--r--debian/patches/0001-bn_mul.h-require-at-least-ARMv6-to-enable-the-ARM-DS.patch33
1 files changed, 33 insertions, 0 deletions
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 <aurelien@aurel32.net>
+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(