tc: fix xtables incorrect usage of LDFLAGS
Subsystems (2)
The incorrect setting of LDFLAGS causes error below:
Quoted 3 lines
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.
--- tc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tc/Makefile +1 -1
@@ -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
Signature · 1 line
2.20.0
Eyal Birger
Acked-byQuoted 6 lines · On Wed, 12 Dec 2018 19:35:08 +0800 Syrone Wong <[email protected]> wrote:
The incorrect setting of LDFLAGS causes error below:
Quoted 3 lines
em_ipt.o: In function `em_ipt_print_epot':
em_ipt.c:(.text.em_ipt_print_epot+0x2e): undefined reference to `xtables_init_all'
Quoted 8 lines
em_ipt.cgets 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 matchesfrom tc matching context")
Signed-off-by Syrone Wong <[email protected]>
Thanks!
So iiuc there's some other LDFLAG coming after -lxtables on some platform? sorry about that..
You can add my:
Eyal.
Quoted 2 lines
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/[email protected]/msg42783.html
Syrone Wong
Stephen Hemminger
AppliedQuoted 8 lines · On Wed, 12 Dec 2018 20:04:07 +0800 Syrone Wong <[email protected]> wrote:
Quoted 2 lines
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/[email protected]/msg42783.html
Syrone Wong
Applied, thanks.