0001-src-bandwidthd.h-fix-build-with-gcc-10.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From dde68ed77114d7b19bfed3068edefc9dc0644445 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 16 Aug 2020 10:21:46 +0200
  4. Subject: [PATCH] src/bandwidthd.h: fix build with gcc 10
  5. Remove SubnetTable[SUBNET_NUM] and IpTable[IP_NUM] from bandwidthd.h as
  6. they are already in bandwidthd.c otherwise the build with gcc 10 will
  7. fail on:
  8. /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
  9. /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
  10. /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
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/6308c8ee38b6017215038d47c009b238113bd36f
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/nroach44/bandwidthd/pull/1]
  15. ---
  16. src/bandwidthd.h | 4 ++--
  17. src/graph.c | 1 +
  18. 2 files changed, 3 insertions(+), 2 deletions(-)
  19. diff --git a/src/bandwidthd.h b/src/bandwidthd.h
  20. index 870fdf7..eb4c830 100644
  21. --- a/src/bandwidthd.h
  22. +++ b/src/bandwidthd.h
  23. @@ -134,7 +134,7 @@ struct SubnetData
  24. {
  25. uint32_t ip;
  26. uint32_t mask;
  27. -} SubnetTable[SUBNET_NUM];
  28. +};
  29. struct Statistics
  30. {
  31. @@ -157,7 +157,7 @@ struct IPData
  32. uint32_t ip; // Host byte order
  33. struct Statistics Send;
  34. struct Statistics Receive;
  35. -} IpTable[IP_NUM];
  36. +};
  37. struct SummaryData
  38. {
  39. diff --git a/src/graph.c b/src/graph.c
  40. index b4b68f0..058e8c7 100644
  41. --- a/src/graph.c
  42. +++ b/src/graph.c
  43. @@ -18,6 +18,7 @@
  44. #include <resolv.h>
  45. #endif
  46. +extern struct SubnetData SubnetTable[SUBNET_NUM];
  47. extern unsigned int SubnetCount;
  48. extern struct config config;
  49. --
  50. 2.27.0