All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/iftop: fix static build
@ 2021-06-02  6:25 Fabrice Fontaine
  2021-06-02 18:04 ` Arnout Vandecappelle
  2021-06-10 20:12 ` Peter Korsgaard
  0 siblings, 2 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2021-06-02  6:25 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/eb53ff6b031c654daec57050dec376b5c9134a81

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ame-pcap_filter-to-iftop_pcap_filter.patch | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch

diff --git a/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch b/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch
new file mode 100644
index 0000000000..92eedccab7
--- /dev/null
+++ b/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch
@@ -0,0 +1,51 @@
+From 64a185ce2017e4523f4bc39a36c7aebd6d68549a Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 2 Jun 2021 08:21:04 +0200
+Subject: [PATCH] Rename pcap_filter to iftop_pcap_filter
+
+Rename pcap_filter to iftop_pcap_filter to fix the following static
+build failure:
+
+/home/buildroot/autobuild/run/instance-3/output-1/host/bin/riscv64-linux-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static   -static -o iftop addr_hash.o edline.o hash.o iftop.o ns_hash.o options.o resolver.o screenfilter.o serv_hash.o sorted_list.o threadprof.o ui_common.o ui.o tui.o util.o addrs_ioctl.o addrs_dlpi.o dlcommon.o stringmap.o cfgfile.o vector.o  -lpcap -lpcap -L/home/buildroot/autobuild/run/instance-3/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/bin/../../../../bin/../riscv64-buildroot-linux-musl/sysroot/usr/lib -lnl-genl-3 -lnl-3 -lpthread   -lcurses
+/home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/riscv64-buildroot-linux-musl/10.2.0/../../../../riscv64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/bin/../../../../bin/../riscv64-buildroot-linux-musl/sysroot/usr/lib/libpcap.a(bpf_filter.o): in function `pcap_filter':
+bpf_filter.c:(.text+0x4a8): multiple definition of `pcap_filter'; iftop.o:iftop.c:(.bss+0x1a8): first defined here
+
+Fixes:
+ - http://autobuild.buildroot.org/results/eb53ff6b031c654daec57050dec376b5c9134a81
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ iftop.c      | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/iftop.c b/iftop.c
+index aaec6aa..f89eee3 100644
+--- a/iftop.c
++++ b/iftop.c
+@@ -74,7 +74,7 @@ int history_len = 1;
+ pthread_mutex_t tick_mutex;
+ 
+ pcap_t* pd; /* pcap descriptor */
+-struct bpf_program pcap_filter;
++struct bpf_program iftop_pcap_filter;
+ pcap_handler packet_handler;
+ 
+ sig_atomic_t foad;
+@@ -679,12 +679,12 @@ char *set_filter_code(const char *filter) {
+         sprintf(x, "(%s) and (ip or ip6)", filter);
+     } else
+         x = xstrdup("ip or ip6");
+-    if (pcap_compile(pd, &pcap_filter, x, 1, 0) == -1) {
++    if (pcap_compile(pd, &iftop_pcap_filter, x, 1, 0) == -1) {
+         xfree(x);
+         return pcap_geterr(pd);
+     }
+     xfree(x);
+-    if (pcap_setfilter(pd, &pcap_filter) == -1)
++    if (pcap_setfilter(pd, &iftop_pcap_filter) == -1)
+         return pcap_geterr(pd);
+     else
+         return NULL;
+-- 
+2.30.2
+
-- 
2.30.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/iftop: fix static build
  2021-06-02  6:25 [Buildroot] [PATCH 1/1] package/iftop: fix static build Fabrice Fontaine
@ 2021-06-02 18:04 ` Arnout Vandecappelle
  2021-06-10 20:12 ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2021-06-02 18:04 UTC (permalink / raw)
  To: buildroot



On 02/06/2021 08:25, Fabrice Fontaine wrote:
> Fixes:
>  - http://autobuild.buildroot.org/results/eb53ff6b031c654daec57050dec376b5c9134a81
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 Applied to master, thanks.

 You apparently didn't send the patch upstream, but the last upstream commit is
three years old and the mailing list had no upstream reactions to the last few
patches, so I guess that wouldn't be very useful anyway.

 Regards,
 Arnout

> ---
>  ...ame-pcap_filter-to-iftop_pcap_filter.patch | 51 +++++++++++++++++++
>  1 file changed, 51 insertions(+)
>  create mode 100644 package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch
> 
> diff --git a/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch b/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch
> new file mode 100644
> index 0000000000..92eedccab7
> --- /dev/null
> +++ b/package/iftop/0002-Rename-pcap_filter-to-iftop_pcap_filter.patch
> @@ -0,0 +1,51 @@
> +From 64a185ce2017e4523f4bc39a36c7aebd6d68549a Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 2 Jun 2021 08:21:04 +0200
> +Subject: [PATCH] Rename pcap_filter to iftop_pcap_filter
> +
> +Rename pcap_filter to iftop_pcap_filter to fix the following static
> +build failure:
> +
> +/home/buildroot/autobuild/run/instance-3/output-1/host/bin/riscv64-linux-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -static   -static -o iftop addr_hash.o edline.o hash.o iftop.o ns_hash.o options.o resolver.o screenfilter.o serv_hash.o sorted_list.o threadprof.o ui_common.o ui.o tui.o util.o addrs_ioctl.o addrs_dlpi.o dlcommon.o stringmap.o cfgfile.o vector.o  -lpcap -lpcap -L/home/buildroot/autobuild/run/instance-3/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/bin/../../../../bin/../riscv64-buildroot-linux-musl/sysroot/usr/lib -lnl-genl-3 -lnl-3 -lpthread   -lcurses
> +/home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/riscv64-buildroot-linux-musl/10.2.0/../../../../riscv64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/riscv64-buildroot-linux-musl/sysroot/usr/bin/../../../../bin/../riscv64-buildroot-linux-musl/sysroot/usr/lib/libpcap.a(bpf_filter.o): in function `pcap_filter':
> +bpf_filter.c:(.text+0x4a8): multiple definition of `pcap_filter'; iftop.o:iftop.c:(.bss+0x1a8): first defined here
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/eb53ff6b031c654daec57050dec376b5c9134a81
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + iftop.c      | 6 +++---
> + 1 files changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/iftop.c b/iftop.c
> +index aaec6aa..f89eee3 100644
> +--- a/iftop.c
> ++++ b/iftop.c
> +@@ -74,7 +74,7 @@ int history_len = 1;
> + pthread_mutex_t tick_mutex;
> + 
> + pcap_t* pd; /* pcap descriptor */
> +-struct bpf_program pcap_filter;
> ++struct bpf_program iftop_pcap_filter;
> + pcap_handler packet_handler;
> + 
> + sig_atomic_t foad;
> +@@ -679,12 +679,12 @@ char *set_filter_code(const char *filter) {
> +         sprintf(x, "(%s) and (ip or ip6)", filter);
> +     } else
> +         x = xstrdup("ip or ip6");
> +-    if (pcap_compile(pd, &pcap_filter, x, 1, 0) == -1) {
> ++    if (pcap_compile(pd, &iftop_pcap_filter, x, 1, 0) == -1) {
> +         xfree(x);
> +         return pcap_geterr(pd);
> +     }
> +     xfree(x);
> +-    if (pcap_setfilter(pd, &pcap_filter) == -1)
> ++    if (pcap_setfilter(pd, &iftop_pcap_filter) == -1)
> +         return pcap_geterr(pd);
> +     else
> +         return NULL;
> +-- 
> +2.30.2
> +
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/iftop: fix static build
  2021-06-02  6:25 [Buildroot] [PATCH 1/1] package/iftop: fix static build Fabrice Fontaine
  2021-06-02 18:04 ` Arnout Vandecappelle
@ 2021-06-10 20:12 ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-06-10 20:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fixes:
 >  - http://autobuild.buildroot.org/results/eb53ff6b031c654daec57050dec376b5c9134a81

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2021.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/iftop: fix static build
  2014-08-07 18:56 Bernd Kuhls
@ 2014-08-15 22:52 ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2014-08-15 22:52 UTC (permalink / raw)
  To: buildroot

>>>>> "Bernd" == Bernd Kuhls <bernd.kuhls@t-online.de> writes:

 > Use pcap-config to list optional libpcap dependencies that we need to list
 > when building statically.

 > Inspired by Baruch Siach
 > http://git.buildroot.net/buildroot/commit/package/dhcpdump/dhcpdump.mk?id=429f4415cd153c6809394a8b3245d4d15bba3ec3

 > Fixes
 > http://autobuild.buildroot.net/results/c7e/c7e3b2897a9cb9ab55dc7b1a2cd1961235d2d1a4/
 > http://autobuild.buildroot.net/results/60f/60f82bedae255f6b69c9a5ac22686c76c6276301/
 > http://autobuild.buildroot.net/results/1b7/1b771af04a95a78144141a5d555c97bbb5a7e13f/
 > http://autobuild.buildroot.net/results/1f4/1f45e2adcc80c4a209aa5895260985460933575c/

 > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/1] package/iftop: fix static build
@ 2014-08-07 18:56 Bernd Kuhls
  2014-08-15 22:52 ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Bernd Kuhls @ 2014-08-07 18:56 UTC (permalink / raw)
  To: buildroot

Use pcap-config to list optional libpcap dependencies that we need to list
when building statically.

Inspired by Baruch Siach
http://git.buildroot.net/buildroot/commit/package/dhcpdump/dhcpdump.mk?id=429f4415cd153c6809394a8b3245d4d15bba3ec3

Fixes
http://autobuild.buildroot.net/results/c7e/c7e3b2897a9cb9ab55dc7b1a2cd1961235d2d1a4/
http://autobuild.buildroot.net/results/60f/60f82bedae255f6b69c9a5ac22686c76c6276301/
http://autobuild.buildroot.net/results/1b7/1b771af04a95a78144141a5d555c97bbb5a7e13f/
http://autobuild.buildroot.net/results/1f4/1f45e2adcc80c4a209aa5895260985460933575c/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/iftop/iftop.mk |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/iftop/iftop.mk b/package/iftop/iftop.mk
index 24f8b53..ef162a8 100644
--- a/package/iftop/iftop.mk
+++ b/package/iftop/iftop.mk
@@ -10,4 +10,10 @@ IFTOP_DEPENDENCIES = ncurses libpcap
 IFTOP_LICENSE = GPLv2+
 IFTOP_LICENSE_FILES = COPYING
 
+IFTOP_LIBS = -lpcap
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+IFTOP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
+endif
+IFTOP_CONF_ENV += LIBS+="$(IFTOP_LIBS)"
+
 $(eval $(autotools-package))
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-10 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  6:25 [Buildroot] [PATCH 1/1] package/iftop: fix static build Fabrice Fontaine
2021-06-02 18:04 ` Arnout Vandecappelle
2021-06-10 20:12 ` Peter Korsgaard
  -- strict thread matches above, loose matches on Subject: below --
2014-08-07 18:56 Bernd Kuhls
2014-08-15 22:52 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.