From 59d7475aa643b3e86b9e5abe57ea302650c4794d Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 29 Jun 2020 16:34:20 -0700 Subject: [PATCH] dump1900: fix compilation with GCC10 Upstream backport. Signed-off-by: Rosen Penev --- utils/dump1090/Makefile | 2 +- utils/dump1090/patches/010-gcc10.patch | 80 ++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 utils/dump1090/patches/010-gcc10.patch diff --git a/utils/dump1090/Makefile b/utils/dump1090/Makefile index 16a2f8de4..30f088faf 100644 --- a/utils/dump1090/Makefile +++ b/utils/dump1090/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dump1090 PKG_VERSION:=3.8.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/flightaware/dump1090/tar.gz/v${PKG_VERSION}? diff --git a/utils/dump1090/patches/010-gcc10.patch b/utils/dump1090/patches/010-gcc10.patch new file mode 100644 index 000000000..97420775a --- /dev/null +++ b/utils/dump1090/patches/010-gcc10.patch @@ -0,0 +1,80 @@ +From 0793c64ee8ebbcea86b7a9dc71c7e28ec08db618 Mon Sep 17 00:00:00 2001 +From: Oliver Jowett +Date: Sat, 6 Jun 2020 21:52:04 +0800 +Subject: [PATCH] Clean up linkage of struct Modes to actually make sense. + +(how did this work before? But it's been unchanged since at least +2013..) + +Maybe fixes #65 +--- + dump1090.c | 2 ++ + dump1090.h | 6 ++++-- + faup1090.c | 2 ++ + view1090.c | 3 +++ + 4 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/dump1090.c b/dump1090.c +index 2b5c4dce..bc1a7bb9 100644 +--- a/dump1090.c ++++ b/dump1090.c +@@ -51,6 +51,8 @@ + + #include + ++struct _Modes Modes; ++ + // + // ============================= Utility functions ========================== + // +diff --git a/dump1090.h b/dump1090.h +index 5c7cf73e..1afc3d35 100644 +--- a/dump1090.h ++++ b/dump1090.h +@@ -295,7 +295,7 @@ struct mag_buf { + }; + + // Program global state +-struct { // Internal state ++struct _Modes { // Internal state + pthread_t reader_thread; + + pthread_mutex_t data_mutex; // Mutex to synchronize buffer access +@@ -397,7 +397,9 @@ struct { // Internal state + int stats_latest_1min; + struct stats stats_5min; + struct stats stats_15min; +-} Modes; ++}; ++ ++extern struct _Modes Modes; + + // The struct we use to store information about a decoded message. + struct modesMessage { +diff --git a/faup1090.c b/faup1090.c +index cd2be929..cf83db9d 100644 +--- a/faup1090.c ++++ b/faup1090.c +@@ -49,6 +49,8 @@ + + #include "dump1090.h" + ++struct _Modes Modes; ++ + #include + + void receiverPositionChanged(float lat, float lon, float alt) +diff --git a/view1090.c b/view1090.c +index ae925f5e..a8797bb8 100644 +--- a/view1090.c ++++ b/view1090.c +@@ -28,6 +28,9 @@ + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + // + #include "dump1090.h" ++ ++struct _Modes Modes; ++ + // + // ============================= Utility functions ========================== + //