Bug 224107 - multimedia/libvpx: broken on armv*, add an armv6-linux-gcc target
Summary: multimedia/libvpx: broken on armv*, add an armv6-linux-gcc target
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-05 10:57 UTC by Mikael Urankar
Modified: 2018-04-10 09:33 UTC (History)
2 users (show)

See Also:
jbeich: maintainer-feedback+


Attachments
patch (3.10 KB, patch)
2017-12-05 10:57 UTC, Mikael Urankar
no flags Details | Diff
patch (5.92 KB, patch)
2017-12-06 09:56 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 Mikael Urankar freebsd_committer freebsd_triage 2017-12-05 10:57:20 UTC
Created attachment 188541 [details]
patch

* the following condition is not correct, we can specify -mcpu=cortex-a7 to build for armv7:
if ${CFLAGS:M-march=armv7*}

 * I would like to add an armv6-linux-gcc target so we can benefit the arm_cpudetect feature on armv6

 * 2 problems (an error and a warning) in patch-vpx__ports_arm__cpudetect.c:

When we have the sys/auxv.h header we miss the getauxval function (sys/auxv.h doesn't provide it)

#if __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
#else
snip
int arm_cpu_caps(void) {
snip
hwcaps = getauxval(AT_HWCAP);
snip

so the build fails:
vpx_ports/arm_cpudetect.c.o: In function `arm_cpu_caps':
vpx_ports/arm_cpudetect.c:(.text+0x50): undefined reference to `getauxval'


the 2nd problem is that we don't provide the prototype for getauxval:

cc  -O -pipe  -fno-strict-aliasing -march=armv6 -DNDEBUG -O3 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement -Wdisabled-optimization -W
float-conversion -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wuninitialized -Wunused -Wextra -Wundef -Wshorten-64-to-32 -I. -I"/usr/ports/multimedia/libvpx/work/libvpx-1.6.1
" -c -o vpx_ports/arm_cpudetect.c.o vpx_ports/arm_cpudetect.c                                                                                                                                                   
vpx_ports/arm_cpudetect.c:198:12: warning: implicit declaration of function 'getauxval' is invalid in C99 [-Wimplicit-function-declaration]                                                                       
  hwcaps = getauxval(AT_HWCAP);


The attached patch addresses the first 2 points, I don't know the code well enough to fix the others problems.
Comment 1 Mikael Urankar freebsd_committer freebsd_triage 2017-12-06 09:56:54 UTC
Created attachment 188579 [details]
patch

The attached patch fixes the build on armv6 and armv7, untested on aarch64.
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-04-10 00:13:26 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:12:43 UTC 2018
New revision: 466919
URL: https://svnweb.freebsd.org/changeset/ports/466919

Log:
  multimedia/libvpx: unbreak on armv7

  vpx_ports/arm_cpudetect.c.o: In function `arm_cpu_caps':
  arm_cpudetect.c:(.text+0x48): undefined reference to `getauxval'
  arm_cpudetect.c:(.text+0x78): undefined reference to `getauxval'
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

  PR:		224107
  Reported by:	pkg-fallout
  Submitted by:	Mika?l Urankar

Changes:
  head/multimedia/libvpx/files/patch-vpx__ports_arm__cpudetect.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-04-10 00:13:28 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:13:03 UTC 2018
New revision: 466920
URL: https://svnweb.freebsd.org/changeset/ports/466920

Log:
  multimedia/libvpx: drop explicit targets

  PR:		224107

Changes:
  head/multimedia/libvpx/Makefile
  head/multimedia/libvpx/files/patch-build_make_configure.sh
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-04-10 00:14:32 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:13:23 UTC 2018
New revision: 466921
URL: https://svnweb.freebsd.org/changeset/ports/466921

Log:
  multimedia/libvpx: merge static post-patch into file

  PR:		224107

Changes:
  head/multimedia/libvpx/Makefile
  head/multimedia/libvpx/files/patch-configure
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-04-10 00:14:34 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:13:43 UTC 2018
New revision: 466922
URL: https://svnweb.freebsd.org/changeset/ports/466922

Log:
  multimedia/libvpx: enable NEON on armv6 with more CPUTYPE values

  PR:		224107
  Submitted by:	Mika?l Urankar

Changes:
  head/multimedia/libvpx/Makefile
  head/multimedia/libvpx/files/patch-build_make_configure.sh
  head/multimedia/libvpx/files/patch-configure
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-04-10 00:17:54 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:16:59 UTC 2018
New revision: 466928
URL: https://svnweb.freebsd.org/changeset/ports/466928

Log:
  MFH: r466919

  multimedia/libvpx: unbreak on armv7

  vpx_ports/arm_cpudetect.c.o: In function `arm_cpu_caps':
  arm_cpudetect.c:(.text+0x48): undefined reference to `getauxval'
  arm_cpudetect.c:(.text+0x78): undefined reference to `getauxval'
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

  PR:		224107
  Reported by:	pkg-fallout
  Submitted by:	Mika?l Urankar
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q2/
  branches/2018Q2/multimedia/libvpx/files/patch-vpx__ports_arm__cpudetect.c
Comment 7 Jan Beich freebsd_committer freebsd_triage 2018-04-10 00:40:16 UTC
Can you check what landed works fine in your environment? If not reopen the bug or file a new one.

Sorry it took so long to review the patch. I hesitated working around <sys/auxv.h> issue. And adding explicit --target= didn't look right given the inline comment.

(In reply to mikael.urankar from comment #0)
> vpx_ports/arm_cpudetect.c:198:12: warning: implicit declaration of function 'getauxval' is invalid in C99 [-Wimplicit-function-declaration]                                                                       
>  hwcaps = getauxval(AT_HWCAP);

I couldn't reproduce this one. Not sure why -Wimplicit-function-declaration can trigger on a static function.
Comment 8 Mikael Urankar freebsd_committer freebsd_triage 2018-04-10 09:33:46 UTC
(In reply to Jan Beich from comment #7)
It builds fine on armv6 and armv7, thanks