aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fabrice Fontaine <fontaine.fabrice@gmail.com>2020-08-16 11:01:32 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2020-08-16 11:27:33 +0200
commit1396b06a1ee9a86055488de593be93ae2585ceb1 (patch)
tree732eb87d97dd0acda9ffbf2507c8c3782b4c53ab
parentc6c381c483712bd193b621e70fc2e14579f91231 (diff)
downloadbuildroot-1396b06a1ee9a86055488de593be93ae2585ceb1.tar.gz
buildroot-1396b06a1ee9a86055488de593be93ae2585ceb1.tar.bz2
package/bandwidthd: fix build with gcc 10
Fixes: - http://autobuild.buildroot.org/results/6308c8ee38b6017215038d47c009b238113bd36f Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-rw-r--r--package/bandwidthd/0001-src-bandwidthd.h-fix-build-with-gcc-10.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/package/bandwidthd/0001-src-bandwidthd.h-fix-build-with-gcc-10.patch b/package/bandwidthd/0001-src-bandwidthd.h-fix-build-with-gcc-10.patch
new file mode 100644
index 0000000000..e7d0dec8d6
--- /dev/null
+++ b/package/bandwidthd/0001-src-bandwidthd.h-fix-build-with-gcc-10.patch
@@ -0,0 +1,60 @@
+From dde68ed77114d7b19bfed3068edefc9dc0644445 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 16 Aug 2020 10:21:46 +0200
+Subject: [PATCH] src/bandwidthd.h: fix build with gcc 10
+
+Remove SubnetTable[SUBNET_NUM] and IpTable[IP_NUM] from bandwidthd.h as
+they are already in bandwidthd.c otherwise the build with gcc 10 will
+fail on:
+
+/home/buildroot/autobuild/instance-2/output-1/host/bin/arm-buildroot-linux-gnueabihf-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -o bandwidthd bandwidthd.o graph.o extensions.o sqlight.o parser.o lexer.o pgsql.o -lpcap -lgd -lm -lresolv -L/home/buildroot/autobuild/instance-2/output-1/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lpng16 -lz -L/home/buildroot/autobuild/instance-2/output-1/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/../../../../arm-buildroot-linux-gnueabihf/sysroot/usr/lib/.libs -lnl-genl-3 -lnl-3
+/home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: graph.o:(.bss+0x4b0): multiple definition of `IpTable'; bandwidthd.o:(.bss+0x3e0): first defined here
+/home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: graph.o:(.bss+0x18c): multiple definition of `SubnetTable'; bandwidthd.o:(.bss+0x88): first defined here
+
+Fixes:
+ - http://autobuild.buildroot.org/results/6308c8ee38b6017215038d47c009b238113bd36f
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/nroach44/bandwidthd/pull/1]
+---
+ src/bandwidthd.h | 4 ++--
+ src/graph.c | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/bandwidthd.h b/src/bandwidthd.h
+index 870fdf7..eb4c830 100644
+--- a/src/bandwidthd.h
++++ b/src/bandwidthd.h
+@@ -134,7 +134,7 @@ struct SubnetData
+ {
+ uint32_t ip;
+ uint32_t mask;
+-} SubnetTable[SUBNET_NUM];
++};
+
+ struct Statistics
+ {
+@@ -157,7 +157,7 @@ struct IPData
+ uint32_t ip; // Host byte order
+ struct Statistics Send;
+ struct Statistics Receive;
+-} IpTable[IP_NUM];
++};
+
+ struct SummaryData
+ {
+diff --git a/src/graph.c b/src/graph.c
+index b4b68f0..058e8c7 100644
+--- a/src/graph.c
++++ b/src/graph.c
+@@ -18,6 +18,7 @@
+ #include <resolv.h>
+ #endif
+
++extern struct SubnetData SubnetTable[SUBNET_NUM];
+ extern unsigned int SubnetCount;
+ extern struct config config;
+
+--
+2.27.0
+