Bug 212798 - multimedia/transcode: Fix build with clang 3.9.0
Summary: multimedia/transcode: Fix build with clang 3.9.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 212343
  Show dependency treegraph
 
Reported: 2016-09-18 17:07 UTC by Dimitry Andric
Modified: 2020-04-12 01:23 UTC (History)
1 user (show)

See Also:
cyberbotx: maintainer-feedback+


Attachments
Add newlines to inline asm (6.04 KB, patch)
2016-09-18 17:07 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-09-18 17:07:05 UTC
Created attachment 174922 [details]
Add newlines to inline asm

In bug 212343, for the exp-run with clang 3.9.0, we encountered this error in multimedia/transcode [1]:

motion.c:353:4: error: no matching '.endr' in definition
          " pxor         %%mm0 , %%mm0;          /* clear mm0                                          */"
          ^
<inline asm>:1:466: note: instantiated into assembly here
         pxor         %mm0 , %mm0;          /* clear mm0                                          */ pcmpeqw      %mm6 , %mm6;          /* Build 7f7f7f7f7f7f7f in a register                 */ psrlw        $9    , %mm6;          /*                                                    */ packuswb     %mm6 , %mm6;          /*                                                    */                           ;          /*                                                    */ .rept 8                   ;          /*                                                    */ movq        (%esi), %mm1;          /* 8 Pixels from filtered frame to mm1                */ movq        (%edi), %mm2;          /* 8 Pixels from filtered frame to mm2 (displaced)    */ movq        (%eax), %mm3;          /* reference to mm3                                   */ psrlq        $1    , %mm1;          /* average source pixels                              */ psrlq        $1    , %mm2;          /* shift right by one (divide by two)                 */ pand         %mm6 , %mm1;          /* kill downshifted bits                              */ pand         %mm6 , %mm2;          /* kill downshifted bits                              */ paddusw      %mm2 , %mm1;          /* add up ...                                         */ movq         %mm3 , %mm4;          /* copy reference to mm4                              */ psubusb      %mm1 , %mm3;          /* positive differences between mm2 and mm1 */ psubusb      %mm4 , %mm1;          /* positive differences between mm1 and mm3 */ paddusb      %mm3 , %mm1;          /* mm1 now contains abs(mm1-mm2) */ paddusw      %mm1 , %mm0;          /* add result to mm0                                  */ addl         %ecx , %esi;          /* add framewidth to frameaddress                     */ addl         %ecx , %edi;          /* add framewidth to frameaddress                     */ addl         %ecx , %ecx;          /* add framewidth to frameaddress                     */ .endr                     ;          /*                                                    */                                      /*                                                    */ movq         %mm0 , calc_SAD_half_mmx.a@GOTOFF(%edx)   ;          /* make mm0 available to gcc ...                      */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
1 error generated.

For some reason, that particular inline assembly block does not have embedded newlines, and this trips up the .rept .endr processing.  Fix it by adding newlines.

[1] http://package18.nyi.freebsd.org/data/headi386PR212343-default/2016-09-11_07h04m19s/logs/errors/transcode-1.1.7_26.log
Comment 1 Naram Qashat 2016-09-18 17:14:50 UTC
Sounds good to me.
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-09-18 17:20:43 UTC
A commit references this bug:

Author: dim
Date: Sun Sep 18 17:20:05 UTC 2016
New revision: 422400
URL: https://svnweb.freebsd.org/changeset/ports/422400

Log:
  Add newlines to the inline assembly in calc_SAD_half_mmx().  Otherwise
  the .rept/.endr parsing logic in clang's inline assembler gets tripped
  up.

  Approved by:	cyberbotx@cyberbotx.com (maintainer)
  PR:		212798
  MFH:		2016Q3

Changes:
  head/multimedia/transcode/files/patch-filter_yuvdenoise_motion.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2020-04-12 01:23:09 UTC
A commit references this bug:

Author: sbz
Date: Sun Apr 12 01:22:10 UTC 2020
New revision: 531469
URL: https://svnweb.freebsd.org/changeset/ports/531469

Log:
  - Unbreak package build on ARM arch

  PR:	212798
  Submitted by:	mikael

Changes:
  head/archivers/py-lzma/Makefile