[OpenWrt-Devel] python ctypes.util.find_library cannot find libc

Andrew McConachie andrew at depht.com
Thu Jan 12 11:43:11 EST 2017


Hi OpenWRT Devs,

I'm building an OpenWRT package for python-iptables for a project I'm 
working on and getting this error message when attempting to use it.

     import iptc
   File "/usr/lib/python2.7/site-packages/iptc/__init__.py", line 10, in 
<module>
     from ip4tc import (is_table_available, Table, Chain, Rule, Match, 
Target,
   File "/usr/lib/python2.7/site-packages/iptc/ip4tc.py", line 13, in 
<module>
     from xtables import (XT_INV_PROTO, NFPROTO_IPV4, XTablesError, xtables,
   File "/usr/lib/python2.7/site-packages/iptc/xtables.py", line 677, in 
<module>
     _optind = ct.c_long.in_dll(_libc, "optind")
AttributeError: 'NoneType' object has no attribute '_handle'

You can view xtables.py here if you're curious.
https://github.com/ldx/python-iptables/blob/master/iptc/xtables.py

The problem is that my python-iptables package cannot find libc 
functions using ctypes.util.find_library(). I've tried building OpenWRT 
using both musl and eglibc but neither work. I've also tried building 
OpenWRT with objdump and ldconfig. When I include ldconfig via 'make 
menuconfig' it doesn't actually populate my OpenWRT image with an 
ldconfig binary. Maybe this is the problem?

This bug report looks similar to my problem, but it's about MIPS and 
marked as closed.
https://dev.openwrt.org/ticket/20123

Any help or pointers would be much appreciated.

Thanks,
Andrew
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list