From 44fe2bdf5fa83b0cfe7eb2762964b28f46362d5c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 20 Feb 2021 19:57:48 -0800 Subject: [PATCH] readsb: update to 3.9.0 Remove upstreamed patches. Use autorelease to avoid bumping the release manually. Fix bad linker variable on glibc. Signed-off-by: Rosen Penev --- utils/readsb/Makefile | 8 +- ...twork-avoid-segfault-in-freeaddrinfo.patch | 80 ------------------- utils/readsb/patches/010-gcc10.patch | 55 ------------- 3 files changed, 4 insertions(+), 139 deletions(-) delete mode 100644 utils/readsb/patches/001-network-avoid-segfault-in-freeaddrinfo.patch delete mode 100644 utils/readsb/patches/010-gcc10.patch diff --git a/utils/readsb/Makefile b/utils/readsb/Makefile index dc46e98cf..e9ed05bde 100644 --- a/utils/readsb/Makefile +++ b/utils/readsb/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=readsb -PKG_VERSION:=3.8.3 -PKG_RELEASE:=2 +PKG_VERSION:=3.9.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/Mictronics/readsb/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=bf59b8ecd0ff66945b210c55a5b824aa63ff8cbb1704249528d30a4902e716b2 +PKG_HASH:=234e2f5f45d69d8be376272e9a08be54bdc48ed5ad7ebad2c4374bbd754d9426 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING LICENSE @@ -50,7 +50,7 @@ MAKE_FLAGS += \ TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto TARGET_LDFLAGS += \ - $(if $(CONFIG_LIBC_USE_GLIBC),,-largp) \ + $(if $(CONFIG_USE_GLIBC),,-largp) \ -Wl,--gc-sections,--as-needed define Package/readsb/conffiles diff --git a/utils/readsb/patches/001-network-avoid-segfault-in-freeaddrinfo.patch b/utils/readsb/patches/001-network-avoid-segfault-in-freeaddrinfo.patch deleted file mode 100644 index a389475c8..000000000 --- a/utils/readsb/patches/001-network-avoid-segfault-in-freeaddrinfo.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 82014a5fa9930b0875e57869265acf011772277c Mon Sep 17 00:00:00 2001 -From: Stijn Tintel -Date: Sun, 3 May 2020 20:56:58 +0300 -Subject: [PATCH] network: avoid segfault in freeaddrinfo - -Calling freeaddrinfo(NULL) when using musl libc causes a segfault. - -Signed-off-by: Stijn Tintel ---- - anet.c | 15 ++++++++++++--- - net_io.c | 5 ++++- - viewadsb.c | 5 ++++- - 3 files changed, 20 insertions(+), 5 deletions(-) - ---- a/anet.c -+++ b/anet.c -@@ -212,7 +212,10 @@ static int anetTcpGenericConnect(char *e - if (ss) { - memcpy(ss, p->ai_addr, sizeof(*ss)); - } -- freeaddrinfo(gai_result); -+ if (gai_result) { -+ freeaddrinfo(gai_result); -+ gai_result = NULL; -+ } - return s; - } - -@@ -220,7 +223,10 @@ static int anetTcpGenericConnect(char *e - anetCloseSocket(s); - } - -- freeaddrinfo(gai_result); -+ if (gai_result) { -+ freeaddrinfo(gai_result); -+ gai_result = NULL; -+ } - return ANET_ERR; - } - -@@ -368,7 +374,10 @@ int anetTcpServer(char *err, char *servi - fds[i++] = s; - } - -- freeaddrinfo(gai_result); -+ if (gai_result) { -+ freeaddrinfo(gai_result); -+ gai_result = NULL; -+ } - return (i > 0 ? i : ANET_ERR); - } - ---- a/net_io.c -+++ b/net_io.c -@@ -3285,7 +3285,10 @@ void cleanupNetwork(void) { - for (int i = 0; i < Modes.net_connectors_count; i++) { - struct net_connector *con = Modes.net_connectors[i]; - free(con->address); -- freeaddrinfo(con->addr_info); -+ if (con->addr_info) { -+ freeaddrinfo(con->addr_info); -+ con->addr_info = NULL; -+ } - if (con->mutex) { - pthread_mutex_unlock(con->mutex); - pthread_mutex_destroy(con->mutex); ---- a/viewadsb.c -+++ b/viewadsb.c -@@ -308,7 +308,10 @@ int main(int argc, char **argv) { - } - // Free local service and client - if (s) free(s); -- freeaddrinfo(con->addr_info); -+ if (con->addr_info) { -+ freeaddrinfo(con->addr_info); -+ con->addr_info = NULL; -+ } - pthread_mutex_unlock(con->mutex); - pthread_mutex_destroy(con->mutex); - free(con->mutex); diff --git a/utils/readsb/patches/010-gcc10.patch b/utils/readsb/patches/010-gcc10.patch deleted file mode 100644 index ffa7a3754..000000000 --- a/utils/readsb/patches/010-gcc10.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 5119c21ae56f1c7fd0b10250d1beca9634bf74af Mon Sep 17 00:00:00 2001 -From: Mictronics -Date: Sun, 14 Jun 2020 18:06:22 +0200 -Subject: [PATCH] Clean up linkage of struct Modes. - ---- - readsb.c | 2 ++ - readsb.h | 6 ++++-- - viewadsb.c | 2 ++ - 3 files changed, 8 insertions(+), 2 deletions(-) - ---- a/readsb.c -+++ b/readsb.c -@@ -57,6 +57,8 @@ - - #include - -+struct _Modes Modes; -+ - // - // ============================= Program options help ========================== - // ---- a/readsb.h -+++ b/readsb.h -@@ -312,7 +312,7 @@ struct mag_buf - - // Program global state - --struct -+struct _Modes - { // Internal state - pthread_cond_t data_cond; // Conditional variable associated - pthread_t reader_thread; -@@ -412,7 +412,9 @@ struct - struct stats stats_15min; - struct timespec reader_cpu_accumulator; // CPU time used by the reader thread, copied out and reset by the main thread under the mutex - struct mag_buf mag_buffers[MODES_MAG_BUFFERS]; // Converted magnitude buffers from RTL or file input --} Modes; -+}; -+ -+extern struct _Modes Modes; - - // The struct we use to store information about a decoded message. - ---- a/viewadsb.c -+++ b/viewadsb.c -@@ -54,6 +54,8 @@ - #include "readsb.h" - #include "help.h" - -+struct _Modes Modes; -+ - #define _stringize(x) x - #define verstring(x) _stringize(x) -