Skip to contentSkip to conversation

package/ffmpeg: needs sync_4

PATCH New Bernd Kuhls 3 participants 3 messages May 25, 2017 – May 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ffmpeg: needs sync_4

Fixes
http://autobuild.buildroot.net/results/b3e/b3eaaf6d73cd49f5919143aeaa5cbb4d15a7ccc3/

---
 package/ffmpeg/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/ffmpeg/Config.in +1 -0
index 383374ddb..1326c7b8d 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	# No support for ARMv7-M in the ARM assembly logic
 	# Microblaze build affected by gcc PR71124 (infinite loop)
 	default y if !BR2_nios2 && !BR2_ARM_CPU_ARMV7M && !BR2_microblaze
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 
 menuconfig BR2_PACKAGE_FFMPEG
 	bool "ffmpeg"
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 package/ffmpeg: needs sync_4

Hi Bernd,

Le 25/05/2017 ? 11:31, Bernd Kuhls a ?crit :

Quoted 13 lines

Fixes
http://autobuild.buildroot.net/results/b3e/b3eaaf6d73cd49f5919143aeaa5cbb4d15a7ccc3/

---
 package/ffmpeg/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/ffmpeg/Config.in +0 -0
index 383374ddb..1326c7b8d 100644

package/ffmpeg/Config.in config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS · line 7

Quoted 4 lines
package/ffmpeg/Config.in +1 -0
@@ -4,6 +4,7 @@ config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS
 	# No support for ARMv7-M in the ARM assembly logic
 	# Microblaze build affected by gcc PR71124 (infinite loop)
 	default y if !BR2_nios2 && !BR2_ARM_CPU_ARMV7M && !BR2_microblaze
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4

The code libavutil/buffer.c use atomic_fetch_add_explicit() and ffmpeg should build correctly if you disable BR2_PACKAGE_FFMPEG_FFMPEG with this defconfig.

But with all option enabled except BR2_PACKAGE_FFMPEG_FFMPEG, it fail elsewhere:
ffmpeg-3.3.1/libavdevice/v4l2.c:515: undefined reference to `__sync_fetch_and_add_4

So,

Best regards,
Romain

Quoted 4 lines
package/ffmpeg/Config.in +0 -0
 menuconfig BR2_PACKAGE_FFMPEG
 	bool "ffmpeg"
 
#2 lore raw

PATCH 1/1 package/ffmpeg: needs sync_4

In reply to Bernd Kuhls

Hello,

package/ffmpeg/Config.in config BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS · line 7

Quoted 2 lines · Bernd Kuhls
package/ffmpeg/Config.in +1 -0
 	default y if !BR2_nios2 && !BR2_ARM_CPU_ARMV7M && !BR2_microblaze
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4

This is not correct, because ffmpeg has fallback code on pthreads based atomics, so for example SPARC does not have BR2_TOOLCHAIN_HAS_SYNC_4, but ffmpeg builds fine.

The issue is only with m68k_cf, where ffmpeg thinks it has atomic intrinsics while it has not.

Since we really don't care about ffmpeg on m68k_cf, I've simply excluded this architecture, as I proposed on another patch proposed by Waldemar to fix the same issue:
https://patchwork.ozlabs.org/patch/756664/

Thomas

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