aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/iproute2/patches/002-tc-fix-xtables-incorrect-usage-of-LDFLAGS.patch
blob: d5981360a918e9c8a0ffd644787a850f0abf24de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 6ddb36c3a9686df1cca2f4d06518395f1eb9d5cc Mon Sep 17 00:00:00 2001
From: Syrone Wong <wong.syrone@gmail.com>
Date: Wed, 12 Dec 2018 19:35:08 +0800
Subject: [PATCH] tc: fix xtables incorrect usage of LDFLAGS

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>
Acked-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 tc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tc/Makefile
+++ b/tc/Makefile
@@ -170,7 +170,7 @@ em_ipset.o: CFLAGS += $$($(PKG_CONFIG) x
 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