Optware / Optware-ng

279 stars 52 forks source link

Python - Can't resolve symbol 'libintl_gettext' when importing posix1e (from pylibacl) #190

Closed xeyownt closed 7 years ago

xeyownt commented 7 years ago
cat /opt/etc/ipkg/ipkg.conf 
# src/gz optware-ng http://ipkg.nslu2-linux.org/optware-ng/buildroot-armv5eabi-ng-legacy
# dest /opt/ /
ipkg install gettext libacl attr libintl
ipkg install python27 py27-pip
pip2.7 install pylibacl
echo "import posix1e;" > libintl_issue.py
python2.7 libintl_issue.py
# 
# /opt/bin/python2.7: symbol 'libintl_gettext': can't resolve symbol
# Traceback (most recent call last):
#   File "libintl_issue.py", line 1, in <module>
#     import posix1e;
# ImportError: unknown dlopen() error

Strangely it seems python does not find the libintl.so library when it is in fact present. Running strace shows that it's looking for it apparently:

strace python2.7 libintl_issue.py 2> strace.txt; grep libintl.so strace.txt
# open("/opt/lib/libintl.so.8", O_RDONLY) = 6
# open("/opt/lib/libintl.so.8", O_RDONLY) = 4

I can fix the issue with the LD_PRELOAD trick

LD_PRELOAD=/opt/lib/libintl.so python2.7 libintl_issue.py

Any idea about what is happening and how I can fix this problem without using the LD_PRELOAD trick?

alllexx88 commented 7 years ago

Fixed by adding -lintl build flag to python27. Thanks for the report