[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Kodi is finally cross-build ready!

Hi Johannes!

After three days I finally managed to properly cross-compile Kodi!
And it would be much harder to achieve without your thorough advices :)

I am going to wrap it all together so the readers of debian-cross or random searchers can learn from it.

The first issue we solved was the incorrectly pulled groovy:all and libcommons-lang-java:all.
Since they are architecture-independent, I verified against the table in https://wiki.ubuntu.com/MultiarchCross
and ended up marking them both as groovy:native and libcommons-lang-java:native.
Same applies to default-jre:native for the same reason.

Next issue was python3-dev clash between host and build architectures.
It pulled libpython3.9-minimal:armhf which tried to execute a post-installation script which caused "Exec format error".
As you advised, I replaced python3-dev with libpython3-dev + python3-dev:any, but that was not enough:
something still added apt scores to libpython3-dev:armhf.

I had to run apt-get build-dep in full debug mode:

apt-get build-dep -s --no-install-recommends \
-o Debug::pkgDepCache::Marker=yes \
-o Debug::pkgDepCache::AutoInstall=yes \
-o Debug::pkgProblemResolver=yes \

and found that the troublemaker was samba-libs:any / multi-arch:same that contains python compiled plugins (python3-*.so).
Furthermore, samba-libs depends on python3-talloc:any and python3-ldb:any, and that was the reason
the python runtime of foreign architecture was chosen over the correct native one.

I had to rebuild samba for both amd64 and armhf with samba-libs marked as Multi-Arch: foreign.
This helped to resolve the dependency issues.

Next I had to work around CMake limitation enforcing one toolchain per project.
I needed to build a couple of helper dependencies executed during the build process, and I used autotools
from debian/rules in override_dh_autoconfigure step (before Kodi's CMake project starts configuring).

I needed four more native build-dependencies installed along the host architecture ones: libgif-dev,
libjpeg-dev, liblzo2-dev and libpng-dev. I declared each dependency as libgif-dev, libgif-dev:native,
(because they are all Multi-Arch:same), started the build aaaand… it failed again!

Inspecting the debug output from apt-get, I noticed that libgif-dev is not marked as Multi-Arch:same, unlike the other three packages.
I marked libgif-dev as Multi-Arch:same, added pkgconfig script and rebuilt the packages for amd64 and armhf.

Finally I started the build of Kodi amd voila - I won! :)

As a result I filed #998128 against giflib and will file another bug against samba-libs.
I wonder if marking samba-libs as Multi-Arch:foreign is proper solution here.

Vasyl Gello
Certified SolidWorks Expert

Mob.:+380 (98) 465 66 77

E-Mail: vasek.gello@gmail.com

Skype: vasek.gello
호랑이는 죽어서 가죽을 남기고 사람은 죽어서 이름을 남긴다

Reply to: