git: d70b8439932e - main - multimedia/ringrtc: Fix build on aarch64

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Mon, 24 Mar 2025 17:12:18 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d70b8439932ef9b3d2dd36888621f397418e970c

commit d70b8439932ef9b3d2dd36888621f397418e970c
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2025-03-24 17:12:03 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2025-03-24 17:12:03 +0000

    multimedia/ringrtc: Fix build on aarch64
---
 ...x_source_libvpx_vpx__ports_aarch64__cpudetect.c | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_third_party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c b/multimedia/ringrtc/files/patch-src_webrtc_src_third_party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
new file mode 100644
index 000000000000..a56242ca4220
--- /dev/null
+++ b/multimedia/ringrtc/files/patch-src_webrtc_src_third_party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
@@ -0,0 +1,29 @@
+- Implement runtime detection on FreeBSD
+
+--- src/webrtc/src/third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c.orig	2024-02-09 17:15:31 UTC
++++ src/webrtc/src/third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c
+@@ -91,9 +91,23 @@ static int arm_get_cpu_caps(void) {
+   return flags;
+ }
+ 
+-#elif defined(__linux__)  // end defined(VPX_USE_ANDROID_CPU_FEATURES)
++#elif defined(__linux__) || defined(__FreeBSD__)  // end defined(VPX_USE_ANDROID_CPU_FEATURES)
+ 
+ #include <sys/auxv.h>
++
++#if defined(__FreeBSD__)
++static unsigned long getauxval(unsigned long type)
++{
++    /* Only AT_HWCAP* return unsigned long */
++    if (type != AT_HWCAP && type != AT_HWCAP2) {
++        return 0;
++    }
++
++    unsigned long ret = 0;
++    elf_aux_info(type, &ret, sizeof(ret));
++    return ret;
++}
++#endif
+ 
+ // Define hwcap values ourselves: building with an old auxv header where these
+ // hwcap values are not defined should not prevent features from being enabled.