Bug 213443 - multimedia/libx264: fails to build on armv6 and mips after r422672 (update to 0.148.2708)
Summary: multimedia/libx264: fails to build on armv6 and mips after r422672 (update to...
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: Jan Beich
URL: http://beefy8.nyi.freebsd.org/data/he...
Keywords: needs-qa
Depends on: 196033
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-13 10:57 UTC by Mikael Urankar
Modified: 2016-10-29 06:54 UTC (History)
0 users

See Also:


Attachments
armv6 fix (352 bytes, patch)
2016-10-13 10:57 UTC, Mikael Urankar
no flags Details | Diff
build log (25.31 KB, text/x-log)
2016-10-13 11:42 UTC, Mikael Urankar
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Urankar freebsd_committer freebsd_triage 2016-10-13 10:57:18 UTC
Created attachment 175695 [details]
armv6 fix

Hi,

build error:
/nxb-bin/usr/bin/cc -I. -I. -c -DSTACK_ALIGNMENT=4 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/quant-a.o common/arm/quant-a.S
<instantiation>:29:5: error: instruction requires: armv6t2
    rbit r1, r1

libx264 requires thumb2 now and we don't support that, we need to disable asm on armv6.
See attached patch (for multimedia/x264)
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2016-10-13 11:35:40 UTC
Thank you for the report and patch Mikael
Comment 2 Mikael Urankar freebsd_committer freebsd_triage 2016-10-13 11:42:14 UTC
Created attachment 175699 [details]
build log
Comment 3 Jan Beich freebsd_committer freebsd_triage 2016-10-17 11:59:31 UTC
multimedia/x264/Makefile adds -mcpu=arm1136jf-s. Why is it still required for a build without ASM ? In ARMv6 case the new code can probably be ifdef'd out, so even older boards have at least some optimizations. MIPS can probably just disable it for O32 targets, similar to ARMv4.

For reference, bustages and their regressing commits:
http://beefy8.nyi.freebsd.org/data/head-armv6-default/p423739_s307008/logs/libx264-0.148.2708.log
https://git.videolan.org/?p=x264.git;a=commitdiff;h=5c13589be828

http://beefy7.nyi.freebsd.org/data/head-mips-default/p423899_s307159/logs/libx264-0.148.2708.log
https://git.videolan.org/?p=x264.git;a=commitdiff;h=ce0757d9d277
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-10-28 23:39:55 UTC
A commit references this bug:

Author: jbeich
Date: Fri Oct 28 23:39:01 UTC 2016
New revision: 424887
URL: https://svnweb.freebsd.org/changeset/ports/424887

Log:
  multimedia/libx264: unbreak ASM on armv6 after r422672

  /nxb-bin/usr/bin/cc -I. -I. -c -DSTACK_ALIGNMENT=4 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/quant-a.o common/arm/quant-a.S
  <instantiation>:29:5: error: instruction requires: armv6t2
      rbit r1, r1
      ^
  common/arm/quant-a.S:362:1: note: while in macro instantiation
  decimate_score_1x 15
  ^
  <instantiation>:29:5: error: instruction requires: armv6t2
      rbit r1, r1
      ^
  /tmp/quant-a-8aad5d.s:515:1: note: while in macro instantiation
  decimate_score_1x 16
  ^

  PR:		213443
  Reported by:	pkg-fallout, Bernd Walter, Mikael Urankar
  Approved by:	portmgr blanket

Changes:
  head/multimedia/x264/Makefile
  head/multimedia/x264/files/patch-armv6
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-10-28 23:39:56 UTC
A commit references this bug:

Author: jbeich
Date: Fri Oct 28 23:39:12 UTC 2016
New revision: 424888
URL: https://svnweb.freebsd.org/changeset/ports/424888

Log:
  multimedia/{lib,}x264: unbreak ASM on mips* after r422672

  ASM=on is nop on many Tier2 and Tier3 architectures: arm + armeb, mips +
  mipsel, ia64, sparc64. mips64 may be able to use MSA optimizations but the
  ancient GCC in base doesn't support -msa flag and lang/gcc* are broken.

  arm (aka armv4t) failed as:
    You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS.
    If you really want to run on such a CPU, configure with --disable-asm.

  mips (o32) failed as: [1]
    You specified a pre-MSA CPU in your CFLAGS.
    If you really want to run on such a CPU, configure with --disable-asm.

  PR:		213443
  Reported by:	pkg-fallout [1]
  Obtained from:	PkgSrc
  Approved by:	portmgr blanket

Changes:
  head/multimedia/x264/files/patch-configure
Comment 6 Jan Beich freebsd_committer freebsd_triage 2016-10-29 00:18:01 UTC
-mcpu=arm1136jf-s is same as -mcpu=generic with |clang -target armv6--freebsd|. However, FreeBSD armv6 optimizes to ARMv6KZ by default, not a generic CPU.

I've only tested on aarch64, armv6, mips, mips64 via qemu-user-static. If something doesn't work as intended file a new bug, blocking this one.
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-10-29 00:22:01 UTC
A commit references this bug:

Author: jbeich
Date: Sat Oct 29 00:21:52 UTC 2016
New revision: 424889
URL: https://svnweb.freebsd.org/changeset/ports/424889

Log:
  MFH: r424888

  multimedia/{lib,}x264: unbreak ASM on mips* after r422672

  ASM=on is nop on many Tier2 and Tier3 architectures: arm + armeb, mips +
  mipsel, ia64, sparc64. mips64 may be able to use MSA optimizations but the
  ancient GCC in base doesn't support -msa flag and lang/gcc* are broken.

  arm (aka armv4t) failed as:
    You specified a pre-ARMv6 or Thumb-1 CPU in your CFLAGS.
    If you really want to run on such a CPU, configure with --disable-asm.

  mips (o32) failed as: [1]
    You specified a pre-MSA CPU in your CFLAGS.
    If you really want to run on such a CPU, configure with --disable-asm.

  PR:		213443
  Reported by:	pkg-fallout [1]
  Obtained from:	PkgSrc
  Approved by:	portmgr blanket
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2016Q4/
  branches/2016Q4/multimedia/x264/files/patch-configure
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-10-29 00:24:03 UTC
A commit references this bug:

Author: jbeich
Date: Sat Oct 29 00:23:58 UTC 2016
New revision: 424890
URL: https://svnweb.freebsd.org/changeset/ports/424890

Log:
  MFH: r424887

  multimedia/libx264: unbreak ASM on armv6 after r422672

  /nxb-bin/usr/bin/cc -I. -I. -c -DSTACK_ALIGNMENT=4 -DPIC -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/quant-a.o common/arm/quant-a.S
  <instantiation>:29:5: error: instruction requires: armv6t2
      rbit r1, r1
      ^
  common/arm/quant-a.S:362:1: note: while in macro instantiation
  decimate_score_1x 15
  ^
  <instantiation>:29:5: error: instruction requires: armv6t2
      rbit r1, r1
      ^
  /tmp/quant-a-8aad5d.s:515:1: note: while in macro instantiation
  decimate_score_1x 16
  ^

  PR:		213443
  Reported by:	pkg-fallout, Bernd Walter, Mikael Urankar
  Approved by:	portmgr blanket
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2016Q4/
  branches/2016Q4/multimedia/x264/Makefile
  branches/2016Q4/multimedia/x264/files/patch-armv6
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2016-10-29 06:54:30 UTC
Thanks for taking care of this Jan.