y500 / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

Python bindings import error on armv5 #697

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compiled natively latest libtorrent from RC-1.0* branch using standard gnu 
tools and gcc 4.9.2:
./autotool.sh
./configure \
        --prefix=/ffp \
        --exec-prefix=/ffp \
        --enable-shared \
        --disable-static \
        --with-libgeoip \
        --with-libiconv \
        --enable-python-binding \
        --with-boost=/ffp \
        --with-openssl=/ffp
make
make check
make install
Compilation and install proccess-everything is OK.
2. Tried to import libtorrent python module:
python -c "import libtorrent as lt"

python: symbol '_ZN5boost4asio5error16get_ssl_categoryEv': can't resolve symbol
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: unknown dlopen() error

What is the expected output? What do you see instead?
Successfully imported obviously.

What version of the product are you using? On what operating system?
Linux NSA310 2.6.31.8 armv5tel GNU/Linux
libtorrent-1.0.3 (svn revision-10497) boost-1.57.0 

Am I missing something? Any help is appreciated.

Original issue reported on code.google.com by ffp0.7...@gmail.com on 17 Nov 2014 at 1:36

GoogleCodeExporter commented 8 years ago
please make sure -DTORRENT_USE_OPENSSL was passed in as a compile argument when 
libtorrent was built. It looks like it should have, but that's one thing that 
can rule out build issues.

You could also look at what symbols are exported from the library. I take it 
this is when you're loading the python module. The python module presumably is 
trying to load libtorrent itself (from another .so). This main .so file is 
where I would have expected this symbol to be.

You may want to make sure it was installed properly. dump its symbols with nm 
to see if it appears to export anything.

Original comment by arvid.no...@gmail.com on 18 Nov 2014 at 8:13

GoogleCodeExporter commented 8 years ago
-DTORRENT_USE_OPENSSL was used and passed.
I have pasted build log to http://pastebin.com/YsAGjESF, in case you wanna look 
at it.
Regarding dumping, I not sure, that I am doing rightly:
root@NSA310:~# nm /ffp/lib/python2.7/site-packages/libtorrent.so | grep 
'_ZN5boost4asio5error16get_ssl_categoryEv'
         U _ZN5boost4asio5error16get_ssl_categoryEv
root@NSA310:~# ldd /ffp/lib/python2.7/site-packages/libtorrent.so
checking sub-depends for '/ffp/lib/libpthread.so.0'
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
        libdl.so.0 => /ffp/lib/libdl.so.0 (0x4002a000)
        libc.so.0 => /ffp/lib/libc.so.0 (0x40035000)
checking sub-depends for '/ffp/lib/libtorrent-rasterbar.so.8'
checking sub-depends for '/ffp/lib/libiconv.so.2'
checking sub-depends for '/ffp/lib/libGeoIP.so.1'
checking sub-depends for '/ffp/lib/libboost_system.so.1.57.0'
checking sub-depends for '/ffp/lib/libboost_python.so.1.57.0'
checking sub-depends for '/ffp/lib/libssl.so.1.0.0'
checking sub-depends for '/ffp/lib/libcrypto.so.1.0.0'
checking sub-depends for '/ffp/lib/libpython2.7.so.1.0'
checking sub-depends for '/ffp/lib/libstdc++.so.6'
checking sub-depends for '/ffp/lib/libm.so.0'
        libc.so.0 => /ffp/lib/libc.so.0 (0x40029000)
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
checking sub-depends for '/ffp/lib/libgcc_s.so.1'
checking sub-depends for '/ffp/lib/libc.so.0'
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
checking sub-depends for '/ffp/lib/librt.so.0'
        libc.so.0 => /ffp/lib/libc.so.0 (0x4001a000)
        libdl.so.0 => /ffp/lib/libdl.so.0 (0x40084000)
        libpthread.so.0 => /ffp/lib/libpthread.so.0 (0x4008f000)
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
checking sub-depends for '/ffp/lib/libutil.so.0'
        libc.so.0 => /ffp/lib/libc.so.0 (0x40018000)
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
checking sub-depends for '/ffp/lib/libdl.so.0'
        libc.so.0 => /ffp/lib/libc.so.0 (0x4001a000)
        ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x2a000000)
        libpthread.so.0 => /ffp/lib/libpthread.so.0 (0x00000000)
        libtorrent-rasterbar.so.8 => /ffp/lib/libtorrent-rasterbar.so.8 (0x00000000)
        libiconv.so.2 => /ffp/lib/libiconv.so.2 (0x00000000)
        libGeoIP.so.1 => /ffp/lib/libGeoIP.so.1 (0x00000000)
        libboost_system.so.1.57.0 => /ffp/lib/libboost_system.so.1.57.0 (0x00000000)
        libboost_python.so.1.57.0 => /ffp/lib/libboost_python.so.1.57.0 (0x00000000)
        libssl.so.1.0.0 => /ffp/lib/libssl.so.1.0.0 (0x00000000)
        libcrypto.so.1.0.0 => /ffp/lib/libcrypto.so.1.0.0 (0x00000000)
        libpython2.7.so.1.0 => /ffp/lib/libpython2.7.so.1.0 (0x00000000)
        libstdc++.so.6 => /ffp/lib/libstdc++.so.6 (0x00000000)
        libm.so.0 => /ffp/lib/libm.so.0 (0x00000000)
        libgcc_s.so.1 => /ffp/lib/libgcc_s.so.1 (0x00000000)
        libc.so.0 => /ffp/lib/libc.so.0 (0x00000000)
        librt.so.0 => /ffp/lib/librt.so.0 (0x00000000)
        libutil.so.0 => /ffp/lib/libutil.so.0 (0x00000000)
        libdl.so.0 => /ffp/lib/libdl.so.0 (0x00000000)
        /ffp/lib/ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x00000000)
        /ffp/lib/ld-uClibc.so.0 => /ffp/lib/ld-uClibc.so.0 (0x00000000)
root@NSA310:~# nm /ffp/lib/libtorrent-rasterbar.so.8.0.0 | grep 
'_ZN5boost4asio5error16get_ssl_categoryEv'
0029dcec t _ZN5boost4asio5error16get_ssl_categoryEv

Original comment by ffp0.7...@gmail.com on 18 Nov 2014 at 8:59

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Should the _ZN5boost4asio5error16get_ssl_categoryEv be t instead T?
Sorry for noob questions :)

Original comment by ffp0.7...@gmail.com on 18 Nov 2014 at 10:16

GoogleCodeExporter commented 8 years ago
If I revert changes done by r10294 (fix -fvisibility=hidden in makefile) of Sep 
12, 2014, then I can successfully build and import python bindings using latest 
r10500 source code. Seems like, these additional flags was a culprit of 
libraries linking issue. 
Please consider look at r10294 changes again.

Original comment by ffp0.7...@gmail.com on 19 Nov 2014 at 5:49

GoogleCodeExporter commented 8 years ago
which version of boost are you using?

Original comment by arvid.no...@gmail.com on 19 Nov 2014 at 6:38

GoogleCodeExporter commented 8 years ago
actually, I believe this is because of a bug in asio. please see this pull 
request:

https://github.com/boostorg/asio/pull/1

there's a work-around option to the configure script to disable 
-fvisibility=hidden.

./configure --enable-export-all

Original comment by arvid.no...@gmail.com on 19 Nov 2014 at 6:49

GoogleCodeExporter commented 8 years ago
I am using latest boost-1.57.0 as I stated in first post. One last noob 
question.
What is the best choice?
1. Apply your proposed patch for boost 1.57.0 and compile it. Then build 
libtorrent as it is.
2. Or just use ./configure --enable-export-all for building libtorrent.  
Which of them is better for low powered device?  

Original comment by ffp0.7...@gmail.com on 19 Nov 2014 at 10:45

GoogleCodeExporter commented 8 years ago
applying the patch will make the libtorrent.so file a lot smaller, because it's 
not exporting every symbol.

Original comment by arvid.no...@gmail.com on 19 Nov 2014 at 4:00

GoogleCodeExporter commented 8 years ago
Thank you very much Arvid for assistance and helping me. I will try to follow 
your advise. 

Original comment by ffp0.7...@gmail.com on 19 Nov 2014 at 6:49

GoogleCodeExporter commented 8 years ago

Original comment by arvid.no...@gmail.com on 19 Nov 2014 at 9:03