From 2b58f2cac799c4eca511b12d068bd043c7f8b014 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 17 Dec 2017 14:43:28 +0100 Subject: [PATCH] dropbear: fix libtommath for GCC 7 This adds a workaround needef for GCC 7 into the libtommath. With this workaorund dropbear is able to generate a RSA key, otherwise not. Size before: ipk: 86.469 dropbear: 172.405 Size with this cahnge on MIPS BE 24KEc ipk: 87.660 dropbear: 172.405 Signed-off-by: Hauke Mehrtens --- .../patches/700-use-unroll-loops-for-gcc7.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package/network/services/dropbear/patches/700-use-unroll-loops-for-gcc7.patch diff --git a/package/network/services/dropbear/patches/700-use-unroll-loops-for-gcc7.patch b/package/network/services/dropbear/patches/700-use-unroll-loops-for-gcc7.patch new file mode 100644 index 0000000000..7d30f10db9 --- /dev/null +++ b/package/network/services/dropbear/patches/700-use-unroll-loops-for-gcc7.patch @@ -0,0 +1,18 @@ +When we compile the libtommath math library without -funroll-loops for +MIPS BE 24KEc with GCC 7.2 the math library will not work correctly. +This was not seen on older gcc versions. +You can test it with "/usr/bin/dropbearkey -t rsa -f /tmp/rsa-key" on a +MIPS BE 24KEc CPU, if it returns in about 1 minute it is ok otherwise +you hit the bug. The If C is too low check in the mp_invmod_slow() +function will never finish. + +--- a/libtommath/Makefile.in ++++ b/libtommath/Makefile.in +@@ -11,6 +11,7 @@ srcdir=@srcdir@ + # So that libtommath can include Dropbear headers for options and m_burn() + CFLAGS += -I. -I$(srcdir) -I../libtomcrypt/src/headers/ -I$(srcdir)/../libtomcrypt/src/headers/ -I../ -I$(srcdir)/../ + ++CFLAGS += -funroll-loops -Wall + ifndef IGNORE_SPEED + + #for speed -- 2.11.0