Bug 200714

Summary: multimedia/ffmpeg: Fails to build with gcc
Product: Ports & Packages Reporter: Randy Westlund <rwestlun>
Component: Individual Port(s)Assignee: Thomas Zander <riggs>
Status: Closed FIXED    
Severity: Affects Many People CC: riggs
Priority: --- Flags: bugzilla: maintainer-feedback? (multimedia)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
ffmpeg configure log none

Description Randy Westlund 2015-06-08 19:22:36 UTC
Created attachment 157543 [details]
ffmpeg configure log

I'm running 10.1-RELEASE on an beaglebone black (armv6).  Trying to build ffmpeg with gcc49 fails:

root@beaglebone:/usr/ports/multimedia/ffmpeg # make USE_GCC=4.9
===>  License GPLv2 LGPL21 accepted by the user
===>  Found saved configuration for ffmpeg-2.3.6_2,1
===>   ffmpeg-2.3.6_2,1 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by ffmpeg-2.3.6_2,1 for building
===>  Extracting for ffmpeg-2.3.6_2,1
=> SHA256 Checksum OK for ffmpeg-2.3.6.tar.bz2.
===>  Patching for ffmpeg-2.3.6_2,1
===>  Applying FreeBSD patches for ffmpeg-2.3.6_2,1
===>   ffmpeg-2.3.6_2,1 depends on executable: yasm - found
===>   ffmpeg-2.3.6_2,1 depends on file: /usr/local/bin/as - found
===>   ffmpeg-2.3.6_2,1 depends on package: v4l_compat>0 - found
===>   ffmpeg-2.3.6_2,1 depends on executable: gmake - found
===>   ffmpeg-2.3.6_2,1 depends on executable: pkgconf - found
===>   ffmpeg-2.3.6_2,1 depends on package: libiconv>=1.14_8 - found
===>   ffmpeg-2.3.6_2,1 depends on executable: texi2html - found
===>   ffmpeg-2.3.6_2,1 depends on executable: gcc49 - found
===>   ffmpeg-2.3.6_2,1 depends on file: /usr/local/bin/as - found
===>   ffmpeg-2.3.6_2,1 depends on file: /usr/local/bin/perl5.20.2 - found
===>   ffmpeg-2.3.6_2,1 depends on shared library: libfontconfig.so - found (/usr/local/lib/libfontconfig.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libfreetype.so - found (/usr/local/lib/libfreetype.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libv4l2.so - found (/usr/local/lib/libv4l2.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libschroedinger-1.0.so - found (/usr/local/lib/libschroedinger-1.0.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libtheora.so - found (/usr/local/lib/libtheora.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libvorbisenc.so - found (/usr/local/lib/libvorbisenc.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libx264.so - found (/usr/local/lib/libx264.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libxvidcore.so - found (/usr/local/lib/libxvidcore.so)
===>   ffmpeg-2.3.6_2,1 depends on shared library: libgnutls.so - found (/usr/local/lib/libgnutls.so)
===>  Configuring for ffmpeg-2.3.6_2,1
GNU assembler not found, install gas-preprocessor
If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.
===>  Script "configure" failed unexpectedly.
Please report the problem to multimedia@FreeBSD.org [maintainer] and attach
the "/usr/ports/multimedia/ffmpeg/work/ffmpeg-2.3.6/config.err" including the
output of the failure of your make command. Also, it might be a good idea to
provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/multimedia/ffmpeg
*** Error code 1
Stop.
make: stopped in /usr/ports/multimedia/ffmpeg



From the configure log:

gcc49 -DLIBICONV_PLUG -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -no-integrated-as -I/usr/local/include/vorbis -I/usr/local/include -march=armv6zk -c -o /tmp/ffconf.Yyv4yupD.o /tmp/ffconf.EA1WOOx5.S
gcc49: error: unrecognized command line option '-no-integrated-as'
GNU assembler not found, install gas-preprocessor

As far as I know, -no-integrated-as doesn't exist in gcc.  Full configure log attached.
Comment 1 Thomas Zander freebsd_committer freebsd_triage 2015-06-14 11:59:11 UTC
(In reply to Randy Westlund from comment #0)

You could remove the lines in the port Makefile:
.if ${ARCH} == "armv6"
CONFIGURE_ENV+= ASFLAGS=-no-integrated-as
.endif
to get rid of this compiler option.

What are you trying to accomplish by compiling it with gcc instead clang?
Comment 2 Randy Westlund 2015-06-14 12:59:59 UTC
(In reply to Thomas Zander from comment #1)
I can test that out this week.  I'm trying GCC because ffmpeg crashes with SIGBUS when built with Clang for arm:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200609
Comment 3 Randy Westlund 2015-06-16 11:59:03 UTC
Removing those lines lets it successfully compile with GCC 4.9, although I get the same SIGBUS crash as with Clang.

I suppose the fix for this PR would be to make that option conditional on both armv6 and clang.
Comment 4 Thomas Zander freebsd_committer freebsd_triage 2015-07-11 14:14:31 UTC
Is this SIGBUS crash still occurring? If not, can this issue be closed?
Comment 5 Randy Westlund 2015-07-11 15:19:47 UTC
(In reply to Thomas Zander from comment #4)

The patch from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200609 is still needed to make ffmpeg build with GCC.  That patch also fixes the SIGBUS.
Comment 6 Thomas Zander freebsd_committer freebsd_triage 2015-07-11 19:00:56 UTC
(In reply to Randy Westlund from comment #5)

But now there is the illegal instruction crash when using fmuls that you mention in bug 200609, correct? If so, let's deal with and discuss the issue there.

This bug report is about the build failure when using gcc which is still fixed when adding --disable-fast-unaligned, correct?
Comment 7 Randy Westlund 2015-07-12 00:42:15 UTC
(In reply to Thomas Zander from comment #6)

Yes and no.  --disable-fast-unaligned fixes the SIGBUS from bug 200609 that occurs regardless of the compiler.  That same patch adds -no-integrated-as, which fixes the build with GCC (and would resolve this PR).
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-07-12 16:36:19 UTC
A commit references this bug:

Author: riggs
Date: Sun Jul 12 16:35:59 UTC 2015
New revision: 391821
URL: https://svnweb.freebsd.org/changeset/ports/391821

Log:
  Fix build break when compiling with gcc

  PR:		200714
  Submitted by:	rwestlun@gmail.com

Changes:
  head/multimedia/ffmpeg/Makefile
Comment 9 Thomas Zander freebsd_committer freebsd_triage 2015-07-12 16:37:29 UTC
Committed the build fix. Let's address the illegal instruction issue via the other PR once you get back to testing.