From: Waldemar Brodkorb <wbx@openadk.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue
Date: Sat, 29 Apr 2017 09:30:19 +0200 [thread overview]
Message-ID: <20170429073019.GA22285@waldemar-brodkorb.de> (raw)
Fixes:
http://autobuild.buildroot.net/results/7e95ac6d78bc1732127bea084b4f791e52637abd
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
...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
diff --git a/package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch b/package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch
new file mode 100644
index 0000000..9b51da3
--- /dev/null
+++ b/package/ffmpeg/0002-configure-allow-to-directly-use-pthreads-atomics-com.patch
@@ -0,0 +1,65 @@
+From b49d3d570c2512d4972affea2735de6505e7ad4f Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+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 <wbx@openadk.org>
+---
+ 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
+
diff --git a/package/ffmpeg/ffmpeg.mk b/package/ffmpeg/ffmpeg.mk
index 10e4e74..7695507 100644
--- a/package/ffmpeg/ffmpeg.mk
+++ b/package/ffmpeg/ffmpeg.mk
@@ -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
--
2.1.4
next reply other threads:[~2017-04-29 7:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-29 7:30 Waldemar Brodkorb [this message]
2017-04-29 12:03 ` [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue Thomas Petazzoni
2017-05-29 21:39 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170429073019.GA22285@waldemar-brodkorb.de \
--to=wbx@openadk.org \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox