Skip to contentSkip to conversation

ffmpeg: fix coldfire compile issue

PATCH New Waldemar Brodkorb 2 participants 3 messages Apr 29, 2017 – May 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ffmpeg: fix coldfire compile issue

Fixes:
http://autobuild.buildroot.net/results/7e95ac6d78bc1732127bea084b4f791e52637abd

---
 ...llow-to-directly-use-pthreads-atomics-com.patch | 65 ++++++++++++++++++++++
 package/ffmpeg/ffmpeg.mk                           |  6 ++
 2 files changed, 71 insertions(+)
 create mode 100644 package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch
package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch new file +65 -0
new file mode 100644
index 0000000..9b51da3
@@ -0,0 +1,65 @@
+From b49d3d570c2512d4972affea2735de6505e7ad4f Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Sat, 29 Apr 2017 09:04:31 +0200
+Subject: [PATCH] configure: allow to directly use pthreads atomics compat code
+
+For some architectures (like m68k coldfire) the check for gcc
+atomics (atomic_store) succeeds, but other atomic operations
+are broken and generate an internal compiler error.
+ffmpeg can be successfully compiled when the compatibility
+code with pthread_mutex_* is used.
+
+Add a new configure argument for this case.
+
+GCC bug:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+---
+ configure | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index b3cb5b0..ae4b80d 100755
+--- a/configure
++++ b/configure
+@@ -135,6 +135,7 @@ Component options:
+   --disable-avfilter       disable libavfilter build
+   --enable-avresample      enable libavresample build [no]
+   --disable-pthreads       disable pthreads [autodetect]
++  --enable-pthreads-atomics enable pthreads atomics compat code [no]
+   --disable-w32threads     disable Win32 threads [autodetect]
+   --disable-os2threads     disable OS/2 threads [autodetect]
+   --disable-network        disable network support [no]
+@@ -1684,6 +1685,7 @@ CONFIG_LIST="
+     neon_clobber_test
+     ossfuzz
+     pic
++    pthreads_atomics
+     raise_major
+     thumb
+     valgrind_backtrace
+@@ -6423,7 +6425,11 @@ for thread in $THREADS_LIST; do
+     fi
+ done
+ 
+-if disabled stdatomic_h; then
++if enabled pthreads_atomics; then
++  add_compat atomics/pthread/stdatomic.o
++  add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
++else
++  if disabled stdatomic_h; then
+     if enabled atomics_gcc; then
+         add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
+     elif enabled atomics_win32; then
+@@ -6437,6 +6443,7 @@ if disabled stdatomic_h; then
+         enabled threads && die "Threading is enabled, but no atomics are available"
+         add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
+     fi
++  fi
+ fi
+ 
+ # Check if requested libraries were found.
+-- 
+2.1.4
+
package/ffmpeg/ffmpeg.mk +6 -0
index 10e4e74..7695507 100644
@@ -473,6 +473,12 @@ else ifneq ($(call qstrip,$(BR2_GCC_TARGET_ARCH)),)
 FFMPEG_CONF_OPTS += --cpu=$(BR2_GCC_TARGET_ARCH)
 endif
 
+# Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68467 by
+# directly using atomics compat code
+ifeq ($(BR2_m68k_cf),y)
+FFMPEG_CONF_OPTS += --enable-pthreads-atomics
+endif
+
 FFMPEG_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_FFMPEG_EXTRACONF))
 
 # Override FFMPEG_CONFIGURE_CMDS: FFmpeg does not support --target and others
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 ffmpeg: fix coldfire compile issue

Hello,

Quoted 9 lines · Waldemar Brodkorb

Fixes:
http://autobuild.buildroot.net/results/7e95ac6d78bc1732127bea084b4f791e52637abd

---
 ...llow-to-directly-use-pthreads-atomics-com.patch | 65 ++++++++++++++++++++++
 package/ffmpeg/ffmpeg.mk                           |  6 ++
 2 files changed, 71 insertions(+)
 create mode 100644 package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch

I'm hesitating: do we apply this fix, or simply adjust BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS do disallow using ffmpeg on BR2_m68k_cf ? After all, who is realistically going to use ffmpeg on m68k_cf ?

Best regards,

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 ffmpeg: fix coldfire compile issue

Hello,

Quoted 13 lines · Thomas Petazzoni

Hello,

Quoted 9 lines · Waldemar Brodkorb

Fixes:
http://autobuild.buildroot.net/results/7e95ac6d78bc1732127bea084b4f791e52637abd

---
 ...llow-to-directly-use-pthreads-atomics-com.patch | 65 ++++++++++++++++++++++
 package/ffmpeg/ffmpeg.mk                           |  6 ++
 2 files changed, 71 insertions(+)
 create mode 100644 package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch  
Quoted 4 lines

I'm hesitating: do we apply this fix, or simply adjust BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS do disallow using ffmpeg on BR2_m68k_cf ? After all, who is realistically going to use ffmpeg on m68k_cf ?

I've excluded m68k_cf, see
https://git.buildroot.org/buildroot/commit/?id=2d9f199061fa0629847b63e6b6317a7b12a9d99f.

Thanks!

Thomas

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