[OpenWrt-Devel] iproute2 4.17.0 build error

Syrone Wong wong.syrone at gmail.com
Sat Jul 14 09:38:46 EDT 2018

> 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.

I added a patch to fix this.

--- a/tc/Makefile
+++ b/tc/Makefile
@@ -168,7 +168,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)

 %.yacc.c: %.y

The original one adds `-lxtables` to LDFLAGS instead of LDLIBS. The
compilation succeeds afterward but the packaging

Package tc is missing dependencies for the following libraries:

I think we'd better exclude em_ipt.c when TC_CONFIG_XT is enabled.

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list