All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] dhcpdump: fix static build
@ 2014-04-23 19:59 Baruch Siach
  2014-04-23 20:52 ` [Buildroot] About static linking Thomas Petazzoni
  2014-05-07 20:48 ` [Buildroot] [PATCH] dhcpdump: fix static build Peter Korsgaard
  0 siblings, 2 replies; 7+ messages in thread
From: Baruch Siach @ 2014-04-23 19:59 UTC (permalink / raw)
  To: buildroot

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

Fixes:
http://autobuild.buildroot.net/results/110/1107c21cdf656763bf7048c6c5c7899369724f5f/

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 package/dhcpdump/dhcpdump.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/dhcpdump/dhcpdump.mk b/package/dhcpdump/dhcpdump.mk
index cb2daa973177..ded7c295c3ae 100644
--- a/package/dhcpdump/dhcpdump.mk
+++ b/package/dhcpdump/dhcpdump.mk
@@ -10,8 +10,13 @@ DHCPDUMP_DEPENDENCIES = libpcap
 DHCPDUMP_LICENSE = BSD-2c
 DHCPDUMP_LICENSE_FILES = LICENSE
 
+DHCPDUMP_LIBS = -lpcap
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+DHCPDUMP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
+endif
+
 define DHCPDUMP_BUILD_CMDS
-	$(MAKE) -C $(@D) CC="$(TARGET_CC) $(TARGET_CFLAGS)"
+	$(MAKE) -C $(@D) CC="$(TARGET_CC) $(TARGET_CFLAGS)" LIBS="$(DHCPDUMP_LIBS)"
 endef
 
 define DHCPDUMP_INSTALL_TARGET_CMDS
-- 
1.9.2

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

* [Buildroot] About static linking
  2014-04-23 19:59 [Buildroot] [PATCH] dhcpdump: fix static build Baruch Siach
@ 2014-04-23 20:52 ` Thomas Petazzoni
  2014-04-24  4:29   ` Baruch Siach
  2014-04-24 15:23   ` Peter Korsgaard
  2014-05-07 20:48 ` [Buildroot] [PATCH] dhcpdump: fix static build Peter Korsgaard
  1 sibling, 2 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2014-04-23 20:52 UTC (permalink / raw)
  To: buildroot

Dear Baruch Siach,

On Wed, 23 Apr 2014 22:59:59 +0300, Baruch Siach wrote:

> +DHCPDUMP_LIBS = -lpcap
> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> +DHCPDUMP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
> +endif

This is not at all against your patch specifically, but I'm a bit
worried about all the static linking related kludges we add all over
the place. Is this normal? Shouldn't we fix the packages themselves and
submit patches upstream?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] About static linking
  2014-04-23 20:52 ` [Buildroot] About static linking Thomas Petazzoni
@ 2014-04-24  4:29   ` Baruch Siach
  2014-04-24  7:16     ` Thomas Petazzoni
  2014-04-24 15:23   ` Peter Korsgaard
  1 sibling, 1 reply; 7+ messages in thread
From: Baruch Siach @ 2014-04-24  4:29 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Wed, Apr 23, 2014 at 10:52:43PM +0200, Thomas Petazzoni wrote:
> On Wed, 23 Apr 2014 22:59:59 +0300, Baruch Siach wrote:
> > +DHCPDUMP_LIBS = -lpcap
> > +ifeq ($(BR2_PREFER_STATIC_LIB),y)
> > +DHCPDUMP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
> > +endif
> 
> This is not at all against your patch specifically, but I'm a bit
> worried about all the static linking related kludges we add all over
> the place. Is this normal? Shouldn't we fix the packages themselves and
> submit patches upstream?

Upstream submission is of course preferable. In this case upstream does not 
appear to be very active. The current release is from 2008, while development 
started at 2007.

Do you prefer a Makefile patch that could theoretically be upstreamed?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] About static linking
  2014-04-24  4:29   ` Baruch Siach
@ 2014-04-24  7:16     ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2014-04-24  7:16 UTC (permalink / raw)
  To: buildroot

Dear Baruch Siach,

On Thu, 24 Apr 2014 07:29:11 +0300, Baruch Siach wrote:

> > This is not at all against your patch specifically, but I'm a bit
> > worried about all the static linking related kludges we add all over
> > the place. Is this normal? Shouldn't we fix the packages themselves and
> > submit patches upstream?
> 
> Upstream submission is of course preferable. In this case upstream does not 
> appear to be very active. The current release is from 2008, while development 
> started at 2007.
> 
> Do you prefer a Makefile patch that could theoretically be upstreamed?

I must say I don't know. In fact, I was not necessarily speaking
specifically of this particular change, but more generally about all
the LIBS='-lfoo' we're adding all over the place to fix static linking
problems. This seems a bit fragile to me.

And the point of raising this question was specifically to get a
discussion started, and see the opinion of others (Gustavo, Peter,
Arnout, Yann, etc.).

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] About static linking
  2014-04-23 20:52 ` [Buildroot] About static linking Thomas Petazzoni
  2014-04-24  4:29   ` Baruch Siach
@ 2014-04-24 15:23   ` Peter Korsgaard
  2014-04-24 22:01     ` Arnout Vandecappelle
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2014-04-24 15:23 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Dear Baruch Siach,
 > On Wed, 23 Apr 2014 22:59:59 +0300, Baruch Siach wrote:

 >> +DHCPDUMP_LIBS = -lpcap
 >> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
 >> +DHCPDUMP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
 >> +endif

 > This is not at all against your patch specifically, but I'm a bit
 > worried about all the static linking related kludges we add all over
 > the place. Is this normal? Shouldn't we fix the packages themselves and
 > submit patches upstream?

It would certainly be nice to get these things handled upstream, but
it's similar to the special-archs/nommu/uClibc stuff, E.G. not something
"normal" people gets affected by (and something we have decided to
support), so I don't think there's much else we can do.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] About static linking
  2014-04-24 15:23   ` Peter Korsgaard
@ 2014-04-24 22:01     ` Arnout Vandecappelle
  0 siblings, 0 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2014-04-24 22:01 UTC (permalink / raw)
  To: buildroot

On 24/04/14 17:23, Peter Korsgaard wrote:
>>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> 
>  > Dear Baruch Siach,
>  > On Wed, 23 Apr 2014 22:59:59 +0300, Baruch Siach wrote:
> 
>  >> +DHCPDUMP_LIBS = -lpcap
>  >> +ifeq ($(BR2_PREFER_STATIC_LIB),y)
>  >> +DHCPDUMP_LIBS += $(shell $(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)
>  >> +endif
> 
>  > This is not at all against your patch specifically, but I'm a bit
>  > worried about all the static linking related kludges we add all over
>  > the place. Is this normal? Shouldn't we fix the packages themselves and
>  > submit patches upstream?
> 
> It would certainly be nice to get these things handled upstream, but
> it's similar to the special-archs/nommu/uClibc stuff, E.G. not something
> "normal" people gets affected by (and something we have decided to
> support), so I don't think there's much else we can do.

 Still, I expect that upstreams are more likely to be willing to accept
patches for linking against a static library than patches for exotic
systems. Especially since the former is usually only a config patch,
while the special-archs/nommu/uClibc stuff is more likely to affect the
code itself.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH] dhcpdump: fix static build
  2014-04-23 19:59 [Buildroot] [PATCH] dhcpdump: fix static build Baruch Siach
  2014-04-23 20:52 ` [Buildroot] About static linking Thomas Petazzoni
@ 2014-05-07 20:48 ` Peter Korsgaard
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2014-05-07 20:48 UTC (permalink / raw)
  To: buildroot

On Wed, Apr 23, 2014 at 9:59 PM, Baruch Siach <baruch@tkos.co.il> wrote:
> Use pcap-config to list optional libpcap dependencies that we need to list
> when building statically.
>
> Fixes:
> http://autobuild.buildroot.net/results/110/1107c21cdf656763bf7048c6c5c7899369724f5f/
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2014-05-07 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 19:59 [Buildroot] [PATCH] dhcpdump: fix static build Baruch Siach
2014-04-23 20:52 ` [Buildroot] About static linking Thomas Petazzoni
2014-04-24  4:29   ` Baruch Siach
2014-04-24  7:16     ` Thomas Petazzoni
2014-04-24 15:23   ` Peter Korsgaard
2014-04-24 22:01     ` Arnout Vandecappelle
2014-05-07 20:48 ` [Buildroot] [PATCH] dhcpdump: fix static build 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.