From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waldemar Brodkorb Date: Sat, 29 Apr 2017 09:30:19 +0200 Subject: [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue Message-ID: <20170429073019.GA22285@waldemar-brodkorb.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Fixes: http://autobuild.buildroot.net/results/7e95ac6d78bc1732127bea084b4f791e52637abd Signed-off-by: Waldemar Brodkorb --- ...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 +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 +--- + 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