Bug#980515: dump1090-mutability: FTBFS with GCC 10
Source: dump1090-mutability
Version: 1.15~20180310.4a16df3+dfsg-6
Severity: serious
Tags: patch ftbfs
Justification: fails to build from source (but built successfully in the past)
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu hirsute ubuntu-patch
Hi,
dump1090-mutability FTBFS with GCC 10. [1] This is due to multiple
defintions of a variable (GCC 10 enables -fno-common by default).
In Ubuntu, the attached patch was applied to achieve the following:
* d/p/05-gcc-10.patch: Cherrypick upstream Git commit to fix FTBFS with GCC
10.
Thanks for considering the patch.
Logan
[1] https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/dump1090-mutability.html
diff -Nru dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/05-gcc-10.patch dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/05-gcc-10.patch
--- dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/05-gcc-10.patch 1969-12-31 19:00:00.000000000 -0500
+++ dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/05-gcc-10.patch 2021-01-19 22:36:11.000000000 -0500
@@ -0,0 +1,72 @@
+From 0793c64ee8ebbcea86b7a9dc71c7e28ec08db618 Mon Sep 17 00:00:00 2001
+From: Oliver Jowett <oliver.jowett@flightaware.com>
+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(-)
+
+--- a/dump1090.c
++++ b/dump1090.c
+@@ -55,6 +55,8 @@
+
+ static int verbose_device_search(char *s);
+
++struct _Modes Modes;
++
+ //
+ // ============================= Utility functions ==========================
+ //
+--- a/dump1090.h
++++ b/dump1090.h
+@@ -263,7 +263,7 @@
+ };
+
+ // Program global state
+-struct { // Internal state
++struct _Modes { // Internal state
+ pthread_t reader_thread;
+
+ pthread_mutex_t data_mutex; // Mutex to synchronize buffer access
+@@ -378,7 +378,9 @@
+ 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 {
+--- a/faup1090.c
++++ b/faup1090.c
+@@ -49,6 +49,8 @@
+
+ #include "dump1090.h"
+
++struct _Modes Modes;
++
+ #include <stdarg.h>
+
+ //
+--- 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 ==========================
+ //
diff -Nru dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/series dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/series
--- dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/series 2018-12-21 04:34:58.000000000 -0500
+++ dump1090-mutability-1.15~20180310.4a16df3+dfsg/debian/patches/series 2021-01-19 22:36:06.000000000 -0500
@@ -2,3 +2,4 @@
02-excanvas.patch
03-gcc7.patch
04-link-order.patch
+05-gcc-10.patch
Reply to: