Skip to contentSkip to conversation

package/mplayer: needs BR2_TOOLCHAIN_HAS_SYNC_4

PATCH New Bernd Kuhls 2 participants 4 messages Jul 2, 2016 – Jul 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mplayer: needs BR2_TOOLCHAIN_HAS_SYNC_4

Also propagate as reverse dependency to libplayer & tovid.

Fixes
http://autobuild.buildroot.net/results/630/6306757da3be9bb7e3cdcbfc8abb4e64a3fb7913/

---
 package/libplayer/Config.in | 1 +
 package/mplayer/Config.in   | 2 ++
 package/tovid/Config.in     | 2 ++
 3 files changed, 5 insertions(+)
package/libplayer/Config.in +1 -0
index 665b947..37fbb26 100644
@@ -12,6 +12,7 @@ if BR2_PACKAGE_LIBPLAYER
 config BR2_PACKAGE_LIBPLAYER_MPLAYER
 	bool "mplayer backend"
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # mplayer
 	select BR2_PACKAGE_MPLAYER
 
 config BR2_PACKAGE_LIBPLAYER_GSTREAMER
package/mplayer/Config.in +2 -0
index 97b1f38..76bb6f0 100644
@@ -10,6 +10,7 @@ config BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
 config BR2_PACKAGE_MPLAYER
 	bool "mplayer"
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  MPlayer is a movie player which runs on many systems and supports
@@ -19,6 +20,7 @@ config BR2_PACKAGE_MPLAYER
 
 comment "mplayer needs a toolchain w/ threads"
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 if BR2_PACKAGE_MPLAYER
package/tovid/Config.in +2 -0
index 1288f84..d8052ea 100644
@@ -7,6 +7,7 @@ config BR2_PACKAGE_TOVID
 	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
 	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # mplayer
 	# The below dependencies are runtime dependencies only
 	select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # procps_ng
 	select BR2_PACKAGE_DVDAUTHOR
@@ -30,6 +31,7 @@ comment "tovid needs a toolchain w/ threads, C++, wchar"
 	depends on BR2_USE_MMU
 	depends on BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_MPLAYER_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS \
 		|| !BR2_INSTALL_LIBSTDCPP \
 		|| !BR2_USE_WCHAR
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 package/mplayer: needs BR2_TOOLCHAIN_HAS_SYNC_4

Hello,

Quoted 4 lines · Bernd Kuhls

Also propagate as reverse dependency to libplayer & tovid.

Fixes
http://autobuild.buildroot.net/results/630/6306757da3be9bb7e3cdcbfc8abb4e64a3fb7913/

According to this build failure:

ffmpeg/libavcodec/libavcodec.a(utils.o): In function `default_lockmgr_cb':
utils.c:(.text+0x3f8): undefined reference to __sync_val_compare_and_swap_4' utils.c:(.text+0x48c): undefined reference to __sync_val_compare_and_swap_4'

So it's the internal copy of ffmpeg that mplayer carries that uses those atomic operations.

In this case, why doesn't the standalone ffmpeg package also use atomic operations ? Is the ffmpeg code base different ?

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/mplayer: needs BR2_TOOLCHAIN_HAS_SYNC_4

Hi Thomas,

[posted and mailed]

Thomas Petazzoni <thomas.petazzoni- wi1+55ScJUtKEb57/[email protected]> wrote in news:20160702185004.34235606 at free-electrons.com:

Quoted 5 lines

So it's the internal copy of ffmpeg that mplayer carries that uses those atomic operations.

In this case, why doesn't the standalone ffmpeg package also use atomic operations ? Is the ffmpeg code base different ?

no, but the build system is different. While ffmpeg uses its own configure script to determine the capabilities of the arch target used for compilation mplayer provides a hard-coded config.h file...

The difference on sparc, the arch I am trying to fix, looks like this:

ffmpeg-2.8.7$ grep "ATOMIC\|_SYNC" config.h
#define HAVE_ATOMICS_GCC 0
#define HAVE_ATOMICS_SUNCC 0
#define HAVE_ATOMICS_WIN32 0
#define HAVE_ATOMIC_CAS_PTR 0
#define HAVE_ATOMIC_COMPARE_EXCHANGE 0
#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 0
#define HAVE_ATOMICS_NATIVE 0

mplayer-1.3.0$ grep "ATOMIC\|_SYNC" config.h
#define HAVE_ATOMICS_GCC 1
#define HAVE_SYNC_VAL_COMPARE_AND_SWAP 1
#define HAVE_ATOMICS_NATIVE 1
#define HAVE_SYNC_SYNCHRONIZE 1

Have a look at mplayer configure script at line 9260 for details.

Of course we could try to use sed to change config.h in a _POST_CONFIGURE_HOOK, but getting the details right could result in a pita, I tried already and gave up after ~30 minutes.

Unless someone comes up with a better solution my patch should be applied as obviously the mplayer build system has no support for archs lacking _sync4.

Regards, Bernd

#3 lore raw

PATCH 1/1 package/mplayer: needs BR2_TOOLCHAIN_HAS_SYNC_4

In reply to Bernd Kuhls

Hello,

Quoted 11 lines · Bernd Kuhls

Also propagate as reverse dependency to libplayer & tovid.

Fixes
http://autobuild.buildroot.net/results/630/6306757da3be9bb7e3cdcbfc8abb4e64a3fb7913/

---
 package/libplayer/Config.in | 1 +
 package/mplayer/Config.in   | 2 ++
 package/tovid/Config.in     | 2 ++
 3 files changed, 5 insertions(+)

Applied with an improved commit log, using the explanations you have provided in our discussion. Thanks!

Thomas

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