wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
529 stars 75 forks source link

_plyvel.cpython-37m-arm-linux-gnueabihf.so: unexpected reloc type 0x03 #82

Closed Talkless closed 5 years ago

Talkless commented 6 years ago

Hi,

I have ARM SBM (Odroid-HC1) running Debian Stretch:

# uname -a
Linux odroid-hc1 4.9.0-7-armmp-lpae #1 SMP Debian 4.9.110-1 (2018-07-05) armv7l GNU/Linux

I've tried to install latest plyvel 1.0.5 based on locally built leveldb 1.20. The reason to build with local leveldb is that plyvel 0.9, that would work with Debian Stretch libleveldb-dev, does not seem to support Python 3.7 due to errors like this:

plyvel/_plyvel.cpp: In function ‘void __Pyx_ExceptionSave(PyObject**, PyObject**, PyObject**)’:                                                               plyvel/_plyvel.cpp:18038:21: 
error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’? 

So, I've built leveldb 1.20:

# file /root/code/leveldb/leveldb-1.20/out-shared/libleveldb.so.1.20
/root/code/leveldb/leveldb-1.20/out-shared/libleveldb.so.1.20: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=49e1692ef33cb4e86c0df79864b86a39c343e850, not stripped

And install plyvel like this:

CFLAGS=-I$LEVELDB/include LFLAGS=-L$LEVELDB/out-shared LDFLAGS=-L$LEVELDB/out-shared pip install plyvel

But when I launch application that uses plyvel, I get this:

Jul 29 14:21:09 odroid-hc1 electrumx_server[4804]:     import plyvel
Jul 29 14:21:09 odroid-hc1 electrumx_server[4804]:   File "/opt/python3.7-venv-electrumx/lib/python3.7/site-packages/plyvel/__init__.py", line 6, in <module>
Jul 29 14:21:09 odroid-hc1 electrumx_server[4804]:     from ._plyvel import (  # noqa
Jul 29 14:21:09 odroid-hc1 electrumx_server[4804]: ImportError: /opt/python3.7-venv-electrumx/lib/python3.7/site-packages/plyvel/_plyvel.cpython-37m-arm-linux-gnueabihf.so: unexpected reloc type 0x03
wbolster commented 6 years ago

hmm, never seen anything like this.

quick googling indicates this can be caused by (missing) -fPIC: https://stackoverflow.com/questions/33474070/unexpected-reloc-type-0x03