From 4515a5556e60dc66c00895ab06986adcfddbe4c5 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 12 Aug 2020 13:38:14 -0700 Subject: iftop: Fix build with -fno-common Signed-off-by: Khem Raj --- .../iftop/iftop/iftop-1.0-gcc10.patch | 68 ++++++++++++++++++++++ .../recipes-support/iftop/iftop_1.0pre4.bb | 4 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-support/iftop/iftop/iftop-1.0-gcc10.patch diff --git a/meta-networking/recipes-support/iftop/iftop/iftop-1.0-gcc10.patch b/meta-networking/recipes-support/iftop/iftop/iftop-1.0-gcc10.patch new file mode 100644 index 0000000000..28391a57cf --- /dev/null +++ b/meta-networking/recipes-support/iftop/iftop/iftop-1.0-gcc10.patch @@ -0,0 +1,68 @@ +Patch by Robert Scheck for iftop <= 1.0pre4 to avoid a +GCC 10 related build failure due to global variables in a header file with omitted +"extern" declaration, see also: https://gcc.gnu.org/gcc-10/porting_to.html + +Example build failure output: +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: multiple definition of `screen_list'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaktotal'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peakrecv'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaksent'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: multiple definition of `totals'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: multiple definition of `screen_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: first defined here +/usr/bin/ld: ui_common.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: multiple definition of `screen_list'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaksent'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peakrecv'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaktotal'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: multiple definition of `totals'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: multiple definition of `screen_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: first defined here +/usr/bin/ld: ui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: multiple definition of `screen_list'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:36: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: multiple definition of `totals'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:37: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaksent'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peakrecv'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: multiple definition of `peaktotal'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:38: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: multiple definition of `screen_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:40: first defined here +/usr/bin/ld: tui.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash'; iftop.o:/builddir/build/BUILD/iftop-1.0pre4/ui_common.h:41: first defined here +collect2: error: ld returned 1 exit status + +Patch from https://src.fedoraproject.org/rpms/iftop/raw/master/f/iftop-1.0-gcc10.patch + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/ui_common.h ++++ b/ui_common.h +@@ -33,12 +33,12 @@ typedef struct host_pair_line_tag { + + extern options_t options; + +-sorted_list_type screen_list; +-host_pair_line totals; +-int peaksent, peakrecv, peaktotal; ++extern sorted_list_type screen_list; ++extern host_pair_line totals; ++extern int peaksent, peakrecv, peaktotal; + extern history_type history_totals; +-hash_type* screen_hash; +-hash_type* service_hash; ++extern hash_type* screen_hash; ++extern hash_type* service_hash; + + void analyse_data(void); + void screen_list_init(void); +--- a/ui_common.c ++++ b/ui_common.c +@@ -24,6 +24,12 @@ int history_divs[HISTORY_DIVISIONS] = {1 + char* unit_bits[UNIT_DIVISIONS] = { "b", "Kb", "Mb", "Gb"}; + char* unit_bytes[UNIT_DIVISIONS] = { "B", "KB", "MB", "GB"}; + ++sorted_list_type screen_list; ++host_pair_line totals; ++int peaksent, peakrecv, peaktotal; ++hash_type* screen_hash; ++hash_type* service_hash; ++ + extern hash_type* history; + extern int history_pos; + extern int history_len; diff --git a/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb b/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb index 0c8e494c19..c71ecb32e9 100644 --- a/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb +++ b/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb @@ -6,7 +6,9 @@ DEPENDS = "libpcap ncurses" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=76498170798db0f4f0fb685a225f702f" -SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz" +SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz \ + file://iftop-1.0-gcc10.patch \ + " SRC_URI[md5sum] = "7e6decb4958e8a4890cccac335239f24" SRC_URI[sha256sum] = "f733eeea371a7577f8fe353d86dd88d16f5b2a2e702bd96f5ffb2c197d9b4f97" -- cgit 1.2.3-korg