Skip to contentSkip to conversation

package/kodi: needs BR2_TOOLCHAIN_HAS_SYNC_8

PATCH New Bernd Kuhls 2 participants 3 messages Feb 27, 2016 – Mar 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/kodi: needs BR2_TOOLCHAIN_HAS_SYNC_8

Fixes a build error on arm detected by autobuilders:
http://autobuild.buildroot.net/results/439/43939f65e4516adddc4385c6e0a2193abcab0446/
http://autobuild.buildroot.net/results/322/322e3cd3b444106c9b624675c2265d4fdfefe458/
http://autobuild.buildroot.net/results/3c1/3c1a0e35325828c554f49ab9dbeb4b9b16f9b1e5/
http://autobuild.buildroot.net/results/222/222e8f3392a794b693ff0a9617453bdffbce8aef/
http://autobuild.buildroot.net/results/d91/d91efe30996ddbb4706885b48ff6d5d3fa974df8/

and this build error on BR2_x86_i486

xbmc/filesystem/filesystem.a(FileCache.o): In function `std::__atomic_base<long long>::store(long long, std::memory_order)':
/home/bernd/buildroot/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/include/c++/4.9.3/bits/atomic_base.h:478: undefined reference to __atomic_store_8' /home/bernd/buildroot/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/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/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/include/c++/4.9.3/bits/atomic_base.h:500: undefined reference to `__atomic_load_8'

---
 package/kodi/Config.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/kodi/Config.in +3 -1
index 7d28882..1450b6e 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_KODI_ARCH_SUPPORTS
 	bool
-	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS
+	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) \
+		&& BR2_PACKAGE_BOOST_ARCH_SUPPORTS \
+		&& BR2_TOOLCHAIN_HAS_SYNC_8
 
 comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
 	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 package/kodi: needs BR2_TOOLCHAIN_HAS_SYNC_8

Bernd,

Quoted 7 lines · Bernd Kuhls

Fixes a build error on arm detected by autobuilders:
http://autobuild.buildroot.net/results/439/43939f65e4516adddc4385c6e0a2193abcab0446/
http://autobuild.buildroot.net/results/322/322e3cd3b444106c9b624675c2265d4fdfefe458/
http://autobuild.buildroot.net/results/3c1/3c1a0e35325828c554f49ab9dbeb4b9b16f9b1e5/
http://autobuild.buildroot.net/results/222/222e8f3392a794b693ff0a9617453bdffbce8aef/
http://autobuild.buildroot.net/results/d91/d91efe30996ddbb4706885b48ff6d5d3fa974df8/

Quoted 7 lines

and this build error on BR2_x86_i486

xbmc/filesystem/filesystem.a(FileCache.o): In function `std::__atomic_base<long long>::store(long long, std::memory_order)':
/home/bernd/buildroot/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/include/c++/4.9.3/bits/atomic_base.h:478: undefined reference to __atomic_store_8' /home/bernd/buildroot/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/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/br6_kodi_next/output/host/usr/i486-buildroot-linux-uclibc/include/c++/4.9.3/bits/atomic_base.h:500: undefined reference to `__atomic_load_8'

It is not completely true that it will fix this last problem. It will *avoid* it for i486, but by accident. Because i486 doesn't implement the 8-byte variant of __sync_*(), and because you're adding a dependency on BR2_TOOLCHAIN_HAS_SYNC_8, Kodi will no longer be built on i486. Which indeed avoids the second problem, but does not really fix it.

In particular, if there is any architecture that provides the 8-byte __sync_*() atomic intrinsic, but requires linking with libatomic to get access to the 8-byte __atomic_*() intrinsic, then you will again get a compilation failure.

And according to my tests, i586 is such an architecture. Can you attempt a build on i586 ?

package/kodi/Config.in line 3

Quoted 9 lines
package/kodi/Config.in +1 -1
index 7d28882..1450b6e 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_KODI_ARCH_SUPPORTS
 	bool
-	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS
+	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) \

Where is this list of ARM/MIPS/i386/x86-64 coming from? Why isn't the list of support architectures derived just from BR2_PACKAGE_BOOST_ARCH_SUPPORTS ? There is really some architecture specific code in Kodi ?

package/kodi/Config.in line 5

Quoted 2 lines
package/kodi/Config.in +2 -0
+		&& 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. Can you send a follow-up patch to disable MIPS, or alternatively remove the list of architectures completely if appropriate.

I've anyway applied your patch, as the BR2_TOOLCHAIN_HAS_SYNC_8 does make sense.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/kodi: needs BR2_TOOLCHAIN_HAS_SYNC_8

[posted and mailed]

Hi Thomas,

Thomas Petazzoni <[email protected]> wrote in news:20160305152736.05cfcb80 at free-electrons.com:

Quoted 2 lines

And according to my tests, i586 is such an architecture. Can you attempt a build on i586 ?

a Kodi build for i586 using unpatched git master (c6e3511) finished without errors using this defconfig:

$ cat defconfig
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
# BR2_UCLIBC_INSTALL_UTILS is not set
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_INIT_NONE=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_KODI=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_I965=y
BR2_PACKAGE_XORG7=y
$ grep i586 .config
BR2_ARCH="i586"
BR2_GCC_TARGET_ARCH="i586"
BR2_x86_i586=y
Quoted 4 lines

Where is this list of ARM/MIPS/i386/x86-64 coming from? Why isn't the list of support architectures derived just from BR2_PACKAGE_BOOST_ARCH_SUPPORTS ? There is really some architecture specific code in Kodi ?

Yes:
https://github.com/xbmc/xbmc/blob/Jarvis/m4/xbmc_arch.m4
https://github.com/xbmc/xbmc/blob/Jarvis/configure.ac#L554

Quoted 9 lines

package/kodi/Config.in line 5

Quoted 2 lines
package/kodi/Config.in +2 -0
+          && 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. Can you send a follow-up patch to disable MIPS [...]

Done: http://patchwork.ozlabs.org/patch/592530/

Regards, Bernd