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.
Created attachment 188579 [details] patch The attached patch fixes the build on armv6 and armv7, untested on aarch64.
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
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
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
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
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
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.
(In reply to Jan Beich from comment #7) It builds fine on armv6 and armv7, thanks