netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS
@ 2018-12-12 11:35 Syrone Wong
  2018-12-12 12:01 ` Eyal Birger
  0 siblings, 1 reply; 4+ messages in thread
From: Syrone Wong @ 2018-12-12 11:35 UTC (permalink / raw)
  To: netdev; +Cc: eyal.birger, Syrone Wong

The incorrect setting of LDFLAGS causes error below:

> em_ipt.o: In function `em_ipt_print_epot':
> em_ipt.c:(.text.em_ipt_print_epot+0x2e): undefined reference to
> `xtables_init_all'

em_ipt.c gets involved when TC_CONFIG_XT=y, which requires xtables,
while tc/Makefile doesn't pass flags correctly. It adds '-lxtables'
to LDFLAGS instead of LDLIBS.

Fixes: dd296215 ("tc: add em_ipt ematch for calling xtables matches from tc matching context")

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
---
 tc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/Makefile b/tc/Makefile
index f8010d3c..2edaf2c8 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -171,7 +171,7 @@ em_ipset.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
 em_ipt.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
 
 ifeq ($(TC_CONFIG_XT),y)
-  LDFLAGS += $$($(PKG_CONFIG) xtables --libs)
+  LDLIBS += $$($(PKG_CONFIG) xtables --libs)
 endif
 
 %.yacc.c: %.y
-- 
2.20.0

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

* Re: [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS
  2018-12-12 11:35 [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS Syrone Wong
@ 2018-12-12 12:01 ` Eyal Birger
  2018-12-12 12:04   ` Syrone Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Eyal Birger @ 2018-12-12 12:01 UTC (permalink / raw)
  To: Syrone Wong; +Cc: netdev

On Wed, 12 Dec 2018 19:35:08 +0800
Syrone Wong <wong.syrone@gmail.com> wrote:

> The incorrect setting of LDFLAGS causes error below:
> 
> > em_ipt.o: In function `em_ipt_print_epot':
> > em_ipt.c:(.text.em_ipt_print_epot+0x2e): undefined reference to
> > `xtables_init_all'  
> 
> em_ipt.c gets involved when TC_CONFIG_XT=y, which requires xtables,
> while tc/Makefile doesn't pass flags correctly. It adds '-lxtables'
> to LDFLAGS instead of LDLIBS.
> 
> Fixes: dd296215 ("tc: add em_ipt ematch for calling xtables matches
> from tc matching context")
> 
> Signed-off-by: Syrone Wong <wong.syrone@gmail.com>

Thanks!

So iiuc there's some other LDFLAG coming after -lxtables on some
platform? sorry about that..

You can add my:

Acked-by: Eyal Birger <eyal.birger@gmail.com>

Eyal.

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

* Re: [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS
  2018-12-12 12:01 ` Eyal Birger
@ 2018-12-12 12:04   ` Syrone Wong
  2018-12-13 21:15     ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Syrone Wong @ 2018-12-12 12:04 UTC (permalink / raw)
  To: Eyal Birger; +Cc: netdev

> So iiuc there's some other LDFLAG coming after -lxtables on some
> platform? sorry about that..

Issue found when compiling iproute2 4.17 for OpenWrt

https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg42783.html

Syrone Wong

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

* Re: [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS
  2018-12-12 12:04   ` Syrone Wong
@ 2018-12-13 21:15     ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-12-13 21:15 UTC (permalink / raw)
  To: Syrone Wong; +Cc: Eyal Birger, netdev

On Wed, 12 Dec 2018 20:04:07 +0800
Syrone Wong <wong.syrone@gmail.com> wrote:

> > So iiuc there's some other LDFLAG coming after -lxtables on some
> > platform? sorry about that..  
> 
> Issue found when compiling iproute2 4.17 for OpenWrt
> 
> https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg42783.html
> 
> Syrone Wong

Applied, thanks.

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

end of thread, other threads:[~2018-12-13 21:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12 11:35 [iproute2-next] tc: fix xtables incorrect usage of LDFLAGS Syrone Wong
2018-12-12 12:01 ` Eyal Birger
2018-12-12 12:04   ` Syrone Wong
2018-12-13 21:15     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).