Bug 194186 - [arm] multimedia/gstreamer-ffmpeg generates unsupported ASM
Summary: [arm] multimedia/gstreamer-ffmpeg generates unsupported ASM
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Many People
Assignee: freebsd-multimedia (Nobody)
URL: http://chips.ysv.freebsd.org/data/11a...
Depends on:
Reported: 2014-10-06 13:51 UTC by Sean Bruno
Modified: 2014-12-05 18:13 UTC (History)
3 users (show)

See Also:
kwm: maintainer-feedback+

replace movw instruction in ac3dsp_armv6.S (525 bytes, patch)
2014-10-07 15:25 UTC, Mikael Urankar
no flags Details | Diff
replace movw instruction in ac3dsp_armv6.S (1.07 KB, patch)
2014-11-28 15:01 UTC, Mikael Urankar
no flags Details | Diff
patch-gst-libs_ext_libav_libavcodec_arm_asm.S (284 bytes, patch)
2014-11-28 15:03 UTC, Mikael Urankar
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer 2014-10-06 13:51:21 UTC
When building for ARMv6, output generates unsupported ASM:

CC	libavcodec/ansi.o
libavcodec/ansi.c:203:14: warning: variable 'width' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
        case 7: //set line wrapping
libavcodec/ansi.c:220:13: note: uninitialized use occurs here
        if (width != avctx->width || height != avctx->height) {
libavcodec/ansi.c:217:9: warning: variable 'width' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
libavcodec/ansi.c:220:13: note: uninitialized use occurs here
        if (width != avctx->width || height != avctx->height) {
libavcodec/ansi.c:161:22: note: initialize the variable 'width' to silence this warning
    int ret, i, width, height;
                      = 0
2 warnings generated.
CC	libavcodec/apedec.o
AS	libavcodec/arm/ac3dsp_arm.o
AS	libavcodec/arm/ac3dsp_armv6.o
libavcodec/arm/ac3dsp_armv6.S: Assembler messages:
libavcodec/arm/ac3dsp_armv6.S:40: Error: selected processor does not support `movw r8,#0x1fe0'
cc: error: assembler command failed with exit code 1 (use -v to see invocation)
gmake[6]: *** [libavcodec/arm/ac3dsp_armv6.o] Error 1
gmake[6]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13/gst-libs/ext/libav'
gmake[5]: *** [all-local] Error 2
gmake[5]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13/gst-libs/ext'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13/gst-libs/ext'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13/gst-libs'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/wrkdirs/usr/ports/multimedia/gstreamer-ffmpeg/work/gst-ffmpeg-0.10.13'
*** Error code 1
Comment 1 Bugzilla Automation freebsd_committer 2014-10-06 13:51:21 UTC
Auto-assigned to maintainer multimedia@FreeBSD.org
Comment 2 Mikael Urankar freebsd_committer 2014-10-07 15:25:22 UTC
Created attachment 148067 [details]
replace movw instruction in ac3dsp_armv6.S
Comment 3 Mikael Urankar freebsd_committer 2014-10-07 15:26:34 UTC
The error can be fixed with the attached patch (see http://git.videolan.org/gitweb.cgi/ffmpeg.git/?p=ffmpeg.git;a=commitdiff;h=05c062e9da370c60f48e433308cccbf7e7aea7fe;hp=a2beabc231f0d0c509e5c8f09fdab0ccb46eca10)

We will get another error:
libavcodec/arm/dsputil_vfp.S:45: Error: selected processor does not support `vpush {d8-d15}'

this error can be workaround with this configure args: --disable-armvfp

I can make a proper patch for this workaround if needed
Comment 4 Sean Bruno freebsd_committer 2014-10-07 17:37:10 UTC
Can you try the patch in https://reviews.freebsd.org/D872 and see if that makes any difference for you on head?
Comment 5 Mikael Urankar freebsd_committer 2014-10-07 19:16:27 UTC
Only the "patch-gst-libs__ext__libav__libavcodec__arm__ac3dsp_armv6.S" patch is needed with the patch from your link.

Thanks !
Comment 6 Sean Bruno freebsd_committer 2014-10-11 20:23:46 UTC
I'm holding this patch pending the float updates for the arm eabi.
Comment 7 Sean Bruno freebsd_committer 2014-10-15 15:18:02 UTC

The fix upstream for this, is actually different.

Mikael, can you try this one instead of yours?  I think this is more proper.
Comment 8 Mikael Urankar freebsd_committer 2014-10-16 12:31:52 UTC
I've made a mistake in my previous test: I have 2 arm jails on my system, one with gcc-4.2.1 from base and the other with clang, the ports compiles fine with gcc and your patch but doesn't with clang (I still need --disable-armvfp)
Comment 9 Mikael Urankar freebsd_committer 2014-11-28 15:01:07 UTC
Created attachment 149964 [details]
replace movw instruction in ac3dsp_armv6.S
Comment 10 Mikael Urankar freebsd_committer 2014-11-28 15:03:35 UTC
Created attachment 149965 [details]

I've attached a patch that fixes the build with clang, I'm not sure it is correct though.

build log:
Comment 12 Sean Bruno freebsd_committer 2014-12-04 21:57:33 UTC
Any objections from the peanut gallery?
Comment 13 Koop Mast freebsd_committer 2014-12-04 22:16:41 UTC
go for it.
Comment 14 commit-hook freebsd_committer 2014-12-05 18:13:33 UTC
A commit references this bug:

Author: sbruno
Date: Fri Dec  5 18:13:23 UTC 2014
New revision: 374072
URL: https://svnweb.freebsd.org/changeset/ports/374072

  Fixup some asm code to support ARM. Fixes build on ARM platforms.

  Bump portrevision to indicate this.

  PR:		194186
  Submitted by:	mikael.urankar@gmail.com
  Reviewed by:	kwm
  Approved by:	mentors (implicit)