* [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue
@ 2017-04-29 7:30 Waldemar Brodkorb
2017-04-29 12:03 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Waldemar Brodkorb @ 2017-04-29 7:30 UTC (permalink / raw)
To: buildroot
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue
2017-04-29 7:30 [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue Waldemar Brodkorb
@ 2017-04-29 12:03 ` Thomas Petazzoni
2017-05-29 21:39 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2017-04-29 12:03 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 29 Apr 2017 09:30:19 +0200, Waldemar Brodkorb wrote:
> 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
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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue
2017-04-29 12:03 ` Thomas Petazzoni
@ 2017-05-29 21:39 ` Thomas Petazzoni
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2017-05-29 21:39 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 29 Apr 2017 14:03:03 +0200, Thomas Petazzoni wrote:
> Hello,
>
> On Sat, 29 Apr 2017 09:30:19 +0200, Waldemar Brodkorb wrote:
> > 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
>
> 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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-29 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-29 7:30 [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue Waldemar Brodkorb
2017-04-29 12:03 ` Thomas Petazzoni
2017-05-29 21:39 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox