002-tc-fix-xtables-incorrect-usage-of-LDFLAGS.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From 6ddb36c3a9686df1cca2f4d06518395f1eb9d5cc Mon Sep 17 00:00:00 2001
  2. From: Syrone Wong <[email protected]>
  3. Date: Wed, 12 Dec 2018 19:35:08 +0800
  4. Subject: [PATCH] tc: fix xtables incorrect usage of LDFLAGS
  5. The incorrect setting of LDFLAGS causes error below:
  6. > em_ipt.o: In function `em_ipt_print_epot':
  7. > em_ipt.c:(.text.em_ipt_print_epot+0x2e): undefined reference to
  8. > `xtables_init_all'
  9. em_ipt.c gets involved when TC_CONFIG_XT=y, which requires xtables,
  10. while tc/Makefile doesn't pass flags correctly. It adds '-lxtables'
  11. to LDFLAGS instead of LDLIBS.
  12. Fixes: dd296215 ("tc: add em_ipt ematch for calling xtables matches from tc matching context")
  13. Signed-off-by: Syrone Wong <[email protected]>
  14. Acked-by: Eyal Birger <[email protected]>
  15. Signed-off-by: Stephen Hemminger <[email protected]>
  16. ---
  17. tc/Makefile | 2 +-
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19. --- a/tc/Makefile
  20. +++ b/tc/Makefile
  21. @@ -170,7 +170,7 @@ em_ipset.o: CFLAGS += $$($(PKG_CONFIG) x
  22. em_ipt.o: CFLAGS += $$($(PKG_CONFIG) xtables --cflags)
  23. ifeq ($(TC_CONFIG_XT),y)
  24. - LDFLAGS += $$($(PKG_CONFIG) xtables --libs)
  25. + LDLIBS += $$($(PKG_CONFIG) xtables --libs)
  26. endif
  27. %.yacc.c: %.y