You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. From 0fc37619574e697ae1ec6d1040f8a07670605f12 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <hauke@hauke-m.de>
  3. Date: Mon, 15 Aug 2022 15:19:34 +0200
  4. Subject: [PATCH] libxt_coova: Use constructor instead of _init()
  5. The _init() function collides with a _init() function in crti.o.
  6. This results in the following error in OpenWrt:
  7. arc-openwrt-linux-gnu/bin/ld: libxt_coova.o: in function `_init':
  8. /lib/gcc/arc-openwrt-linux-gnu/11.3.0/crti.o:(.init+0x4): first defined here
  9. collect2: error: ld returned 1 exit status
  10. make[7]: *** [Makefile:22: libxt_coova.so] Error 1
  11. Fix this by suing a constructor attribute instead. This function will
  12. still be called after the shared library was loaded.
  13. Fixes: #553
  14. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  15. ---
  16. src/linux/libxt_coova.c | 2 +-
  17. 1 file changed, 1 insertion(+), 1 deletion(-)
  18. --- a/src/linux/libxt_coova.c
  19. +++ b/src/linux/libxt_coova.c
  20. @@ -126,7 +126,7 @@ static struct xtables_match coova_mt6_re
  21. .extra_opts = coova_opts,
  22. };
  23. -void _init(void)
  24. +void __attribute__ ((constructor)) xtables_init(void)
  25. {
  26. xtables_register_match(&coova_mt_reg);
  27. xtables_register_match(&coova_mt6_reg);