I'm struggling to build Python lxml package for Kodi. It includes 2 binary modules that need to be compiled for a target platform, in my case it's Raspberry PI 2. For compilation I use Raspbian Jessie. I have followed all instructions and built statically compiled modules. On Raspbian they are imported without issues, but when I try to use those modules on LibreElec, I get the following error:
23:56:44 54.904564 T:1593832352 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: /storage/.kodi/addons/script.module.lxml/libs/lxml/platforms/pi_armv7l/etree.so: undefined symbol: PyFPE_jbuf
Traceback (most recent call last):
File "/storage/.kodi/addons/addon.tester/main.py", line 10, in <module>
from lxml import etree
File "/storage/.kodi/addons/script.module.lxml/libs/lxml/etree.py", line 12, in <module>
from platforms.pi_armv7l.etree import *
ImportError: /storage/.kodi/addons/script.module.lxml/libs/lxml/platforms/pi_armv7l/etree.so: undefined symbol: PyFPE_jbuf
-->End of Python script error report<--
Display More
Quick googling suggests that a probable cause may be Python version mismatch between Python used to build a binary module and Python used to import it, but there should not be any differences between 2.7.9 and 2.7.11. And, as I said, my modules are fully statically linked. ld shows no missing library dependencies.
My guess is that Python in LibreElec may be built with different configuration options than on Raspbian so the symbol in question is disabled. Or maybe there is another reason? Can anybody help me with this?