On 2017/09/05 10:41, Stuart Henderson wrote:
> ----- Forwarded message from Stuart Henderson <st...@openbsd.org> -----
> 
> From: Stuart Henderson <st...@openbsd.org>
> Date: Mon, 4 Sep 2017 13:27:56 -0600 (MDT)
> To: ports-chan...@openbsd.org
> Subject: CVS: cvs.openbsd.org: ports
> 
> CVSROOT:      /cvs
> Module name:  ports
> Changes by:   st...@cvs.openbsd.org   2017/09/04 13:27:56
> 
> Modified files:
>       graphics/ffmpeg: Makefile 
> 
> Log message:
> Use ports clang to build ffmpeg on amd64. The AAC encoder hangs on amd64 when
> compiled with clang 4.0.x (either 4.0.0 in base or the older ports 4.0.1).
> Based on a diff from Brad.
> 
> Add a comment explaining this and note that there is another issue where the
> H264 decoder segfaults in ff_deblock_v_luma_8_sse2 on i386, but this isn't
> helped by the newer ports clang.
> 
> 
> ----- End forwarded message -----
> 
> So this works around the recently-reported hangs seen on amd64 but we
> still have a segfault issue on i386 (I've only seen this so far when
> decoding H264, though given the function other things may use it too).
> 
> I've tried a few things:
> 
> - clang (ports or base): segfault
> 
> - ports gcc: works, but needs -march=i686 to build, otherwise build fails
> "libpostproc/postprocess_template.c:3184:5: error: 'asm' operand has 
> impossible constraints"
> 
> - CC=/usr/bin/gcc: works, no extra flags
> 
> - I haven't tried a --disable-inline-asm build yet, I suspect that
> this would also work but likely kill performance.
> 
> Any thoughts on how to proceed? As far as getting things ship-shape
> for release goes, setting CC=/usr/bin/gcc for i386 seems the least
> worst option to me.
> 
> Brad points out we had runtime problems in the past with clang-built
> FFmpeg on i386 (ports/graphics/ffmpeg/Makefile r1.119, r1.120) though
> I can't find the ports@ posts referred to in the commit log any more.
> 

So in the absence of better ideas, this is what I'm suggesting.

It's a fairly dirty "fix" but this problem breaks much of the common
use of ffmpeg and its dependent packages on i386 (and the alternative
of -march=i686 will mean SIGILL on older machines).

Any comments, objections or OKs?

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.164
diff -u -p -r1.164 Makefile
--- Makefile    4 Sep 2017 19:27:56 -0000       1.164
+++ Makefile    6 Sep 2017 14:24:47 -0000
@@ -5,7 +5,7 @@ COMMENT=        audio/video converter and strea
 V=             20170825
 DISTNAME=      ffmpeg-git-${V}
 PKGNAME=       ffmpeg-${V}
-REVISION=      0
+REVISION=      1
 CATEGORIES=    graphics multimedia
 MASTER_SITES=  http://comstyle.com/source/
 EXTRACT_SUFX=  .tar.xz
@@ -35,10 +35,15 @@ WANTLIB=    SDL X11 Xext Xv ass bz2 c crypt
 
 # AAC encoder hangs on amd64 when built with clang 4.0.0 or 4.0.1 but
 # succeeds with ports clang 5.0.0rc4.
-# XXX h264 decoder segfaults in ff_deblock_v_luma_8_sse2 on i386
 COMPILER=      base-gcc ports-clang base-clang
 COMPILER_LANGS=        c
 MODCLANG_ARCHS=        amd64
+# ff_deblock_v_luma_8_sse2 segfaults on i386/clang (e.g. in H264 decode)
+# works with ports gcc, but requires -march=i686 to build
+# works with base gcc
+.if ${MACHINE_ARCH} == "i386"
+CC=            /usr/bin/gcc
+.endif
 
 BUILD_DEPENDS= textproc/texi2html
 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"

Reply via email to