Message ID | 1457255845-20770-1-git-send-email-bernd.kuhls@t-online.de |
---|---|
State | Changes Requested |
Headers | show |
Bernd, On Sun, 6 Mar 2016 10:17:25 +0100, Bernd Kuhls wrote: > 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. > > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> > --- > package/kodi/Config.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/kodi/Config.in b/package/kodi/Config.in > index bd40ac3..950d5f9 100644 > --- a/package/kodi/Config.in > +++ b/package/kodi/Config.in > @@ -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
Hi Thomas, [posted and mailed] Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote in news:20160306134141.7fedbb85@free-electrons.com: > 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
diff --git a/package/kodi/Config.in b/package/kodi/Config.in index bd40ac3..950d5f9 100644 --- a/package/kodi/Config.in +++ b/package/kodi/Config.in @@ -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
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. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> --- package/kodi/Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)