[PATCH] dropbear: fix compilation with uClibc-ng

Rosen Penev rosenp at gmail.com
Wed Jun 24 19:49:13 EDT 2020


Backported two upstream patches.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/network/services/dropbear/Makefile    |  2 +-
 .../patches/020-backport-gnu-source.patch     | 22 +++++++++++++
 .../patches/030-backport-gnu-source2.patch    | 31 +++++++++++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 package/network/services/dropbear/patches/020-backport-gnu-source.patch
 create mode 100644 package/network/services/dropbear/patches/030-backport-gnu-source2.patch

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 8031a0c62a..b938399023 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
 PKG_VERSION:=2020.79
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
diff --git a/package/network/services/dropbear/patches/020-backport-gnu-source.patch b/package/network/services/dropbear/patches/020-backport-gnu-source.patch
new file mode 100644
index 0000000000..66696df26a
--- /dev/null
+++ b/package/network/services/dropbear/patches/020-backport-gnu-source.patch
@@ -0,0 +1,22 @@
+From 3f5c106a880a02b21739f2022746e6aa7672474c Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 23 Jun 2020 21:38:46 +0800
+Subject: [PATCH] _GNU_SOURCE for random
+
+---
+ includes.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/includes.h b/includes.h
+index e8c3e189..2789f23d 100644
+--- a/includes.h
++++ b/includes.h
+@@ -125,6 +125,8 @@
+ #endif
+ 
+ #ifdef HAVE_SYS_RANDOM_H
++/* uclibc needs _GNU_SOURCE */
++#define _GNU_SOURCE
+ #include <sys/random.h>
+ #endif
+ 
diff --git a/package/network/services/dropbear/patches/030-backport-gnu-source2.patch b/package/network/services/dropbear/patches/030-backport-gnu-source2.patch
new file mode 100644
index 0000000000..e64cf7e4c2
--- /dev/null
+++ b/package/network/services/dropbear/patches/030-backport-gnu-source2.patch
@@ -0,0 +1,31 @@
+From a7a67585cbc3fe5df85c641618b347a51a943356 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt at ucc.asn.au>
+Date: Tue, 23 Jun 2020 22:24:58 +0800
+Subject: [PATCH] move GNU_SOURCE earlier
+
+---
+ includes.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/includes.h b/includes.h
+index 2789f23d..884ebf71 100644
+--- a/includes.h
++++ b/includes.h
+@@ -25,6 +25,8 @@
+ #ifndef DROPBEAR_INCLUDES_H_
+ #define DROPBEAR_INCLUDES_H_
+ 
++/* uclibc needs _GNU_SOURCE, maybe other things? */
++#define _GNU_SOURCE
+ 
+ #include "options.h"
+ #include "debug.h"
+@@ -125,8 +127,6 @@
+ #endif
+ 
+ #ifdef HAVE_SYS_RANDOM_H
+-/* uclibc needs _GNU_SOURCE */
+-#define _GNU_SOURCE
+ #include <sys/random.h>
+ #endif
+ 
-- 
2.26.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
http://lists.infradead.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list