From patchwork Sat Apr 29 07:30:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 756664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wFMm96wpzz9s78 for ; Sat, 29 Apr 2017 17:30:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3B36988472; Sat, 29 Apr 2017 07:30:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id il7exbPm7TGp; Sat, 29 Apr 2017 07:30:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0EFBF87E57; Sat, 29 Apr 2017 07:30:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9B5021CE928 for ; Sat, 29 Apr 2017 07:30:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 96EE78A217 for ; Sat, 29 Apr 2017 07:30:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jlhy62nMUvcf for ; Sat, 29 Apr 2017 07:30:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by hemlock.osuosl.org (Postfix) with ESMTPS id 781C08A214 for ; Sat, 29 Apr 2017 07:30:23 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id 6400F10085; Sat, 29 Apr 2017 09:30:19 +0200 (CEST) Date: Sat, 29 Apr 2017 09:30:19 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: <20170429073019.GA22285@waldemar-brodkorb.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [Buildroot] [PATCH] ffmpeg: fix coldfire compile issue X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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