package/kodi: disable on mips
PATCH 1/1 package/kodi: disable on mips
Due to the addition of the BR2_TOOLCHAIN_HAS_SYNC_8 dependency, then there is no longer a need to have (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC), since MIPS doesn't provide the 8 byte __sync_*() intrinsics, and therefore BR2_TOOLCHAIN_HAS_SYNC_8 is false on MIPS.
--- package/kodi/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/kodi/Config.in +1 -1
@@ -1,6 +1,6 @@ config BR2_PACKAGE_KODI_ARCH_SUPPORTS bool - default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) \ + default y if (BR2_arm || BR2_i386 || BR2_x86_64) \ && BR2_PACKAGE_BOOST_ARCH_SUPPORTS \ && BR2_TOOLCHAIN_HAS_SYNC_8
Signature · 1 line
2.7.0
PATCH 1/1 package/kodi: disable on mips
Bernd,
Quoted 16 lines · Bernd Kuhls
Due to the addition of the
BR2_TOOLCHAIN_HAS_SYNC_8dependency, then there is no longer a need to have (BR2_mipsel&&BR2_TOOLCHAIN_USES_GLIBC), since MIPS doesn't provide the 8 byte __sync_*() intrinsics, and thereforeBR2_TOOLCHAIN_HAS_SYNC_8is false on MIPS.Signed-off-by Bernd Kuhls <[email protected]>--- package/kodi/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/kodi/Config.in +0
-0
package/kodi/Config.in line 5
Quoted 6 lines
package/kodi/Config.in +1
-1@@ -1,6 +1,6 @@ config BR2_PACKAGE_KODI_ARCH_SUPPORTS bool - default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) \ + default y if (BR2_arm || BR2_i386 || BR2_x86_64) \ && BR2_PACKAGE_BOOST_ARCH_SUPPORTS \ && BR2_TOOLCHAIN_HAS_SYNC_8
In fact, I think this is still not good. Why would Kodi have explicit support for MIPS, if in practice you couldn't build it for MIPS ?
I think the answer lies in the fact that Kodi does not always use the __sync*() atomic intrinsics. If you look at xbmc/threads/Atomics.cpp, there are some hand-written atomic operations for various architectures.
So in fact, for some architectures/variants, Kodi is using the compiler __sync and/or __atomic intrinsics, but for some other architectures/variants, it does not use them and use its own implementation instead. This is probably what allows to build on MIPS, for example. And maybe what allows to build on i586.
Bottom line: this BR2_TOOLCHAIN_HAS_SYNC_8 dependency is wrong, and some more investigation is needed to understand the combinations of architectures for which Kodi has its own atomic operations vs. the combinations for which it relies on __sync/__atomic built-ins.
Could you look into this? This will probably require building Kodi on a number of architecture variants, and also an investigation of the atomic code to understand what's going on.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 package/kodi: disable on mips
Hi Thomas,
[posted and mailed]
Thomas Petazzoni <[email protected]> wrote in news:20160306134141.7fedbb85 at free-electrons.com:
Quoted 2 lines
In fact, I think this is still not good. Why would Kodi have explicit support for MIPS, if in practice you couldn't build it for MIPS ?
good question, in January 2015 I could build Kodi for mips:
https://github.com/xbmc/xbmc/pull/5570#issuecomment-72334761
In June 2015 they added some atomic code:
https://github.com/xbmc/xbmc/commit/593f4aa0ba7e572394111a856ec9b54ed7a8351
b#diff-7e982ad80e27d748c5f7d697506c692f which breaks compilation today with Kodi 16.0-Jarvis:
LD kodi.bin
xbmc/filesystem/filesystem.a(FileCache.o): In function `std::__atomic_base<long long>::store(long long, std::memory_order)':/home/bernd/buildroot/br2_kodi16/output/host/usr/mipsel-buildroot-linux-gnu /include/c++/4.9.3/bits/atomic_base.h:478: undefined reference to __atomic_store_8' /home/bernd/buildroot/br2_kodi16/output/host/usr/mipsel-buildroot-linux-gnu /include/c++/4.9.3/bits/atomic_base.h:478: undefined reference to __atomic_store_8' xbmc/filesystem/filesystem.a(FileCache.o): In function `std::__atomic_base<long long>::load(std::memory_order) const':/home/bernd/buildroot/br2_kodi16/output/host/usr/mipsel-buildroot-linux-gnu /include/c++/4.9.3/bits/atomic_base.h:500: undefined reference to `__atomic_load_8' collect2: error: ld returned 1 exit status Makefile:437: recipe for target 'kodi.bin' failed
make[1]: *** [kodi.bin] Error 1
using this defconfig with the BR2_TOOLCHAIN_HAS_SYNC_8 patch reverted:
BR2_mipsel=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
BR2_PACKAGE_XORG7=y
Regards, Bernd