aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2024-02-23 11:34:49 +0000
committerMikael Urankar <mikael@FreeBSD.org>2024-02-23 11:34:49 +0000
commit0e1244f7a7098b982bbb065eee1a04127bc30d7e (patch)
treee62e59aa40cef782e829386dd783499726ac04da
parent06dead21d0c7581e14df51cb7d6edd841b63d50a (diff)
downloadports-0e1244f7a7098b982bbb065eee1a04127bc30d7e.tar.gz
ports-0e1244f7a7098b982bbb065eee1a04127bc30d7e.zip
multimedia/ringrtc: Fix build on aarch64
-rw-r--r--multimedia/ringrtc/files/patch-src_webrtc_src_third_party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c29
1 files changed, 29 insertions, 0 deletions
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.