Date: Fri, 27 Oct 2023 06:34:15 GMT From: Robert Clausecker <fuz@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 9ce9fc372c73 - main - multimedia/ringrtc: fix build on armv7 Message-ID: <202310270634.39R6YFA2090154@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=9ce9fc372c730db46ec32d48d63d08a5005ac2ac commit 9ce9fc372c730db46ec32d48d63d08a5005ac2ac Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2023-10-25 17:03:09 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2023-10-27 06:32:59 +0000 multimedia/ringrtc: fix build on armv7 Add missing CPU feature detection logic to bundled opus. Approved by: portmgr (build fix blanket) MFH: 2023Q4 --- ...c_webrtc_src_ringrtc_opus_src_celt_arm_armcpu.c | 40 ++++++++++++++++++++++ ...rtc_src_third__party_opus_src_celt_arm_armcpu.c | 40 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_src_celt_arm_armcpu.c b/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_src_celt_arm_armcpu.c new file mode 100644 index 000000000000..07d04b8750f2 --- /dev/null +++ b/multimedia/ringrtc/files/patch-src_webrtc_src_ringrtc_opus_src_celt_arm_armcpu.c @@ -0,0 +1,40 @@ +--- ../../src/webrtc/src/ringrtc/opus/src/celt/arm/armcpu.c.orig 2023-10-25 18:24:55 UTC ++++ ../../src/webrtc/src/ringrtc/opus/src/celt/arm/armcpu.c +@@ -148,6 +148,37 @@ + } + return flags; + } ++#elif defined(__FreeBSD__) ++#include <sys/auxv.h> ++ ++opus_uint32 opus_cpu_capabilities(void) ++{ ++ long hwcap = 0; ++ opus_uint32 flags = 0; ++ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); ++ ++# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \ ++ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ if (hwcap & HWCAP_EDSP) ++ flags |= OPUS_CPU_ARM_EDSP_FLAG; ++ ++# if defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ if (hwcap & HWCAP_NEON) ++ flags |= OPUS_CPU_ARM_NEON_FLAG; ++# endif ++# endif ++ ++# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \ ++ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ ++# if __ARM_ARCH >= 6 ++ flags |= OPUS_CPU_ARM_MEDIA_FLAG; ++# endif ++# endif ++ ++ return (flags); ++} + #else + /* The feature registers which can tell us what the processor supports are + * accessible in priveleged modes only, so we can't have a general user-space diff --git a/multimedia/ringrtc/files/patch-src_webrtc_src_third__party_opus_src_celt_arm_armcpu.c b/multimedia/ringrtc/files/patch-src_webrtc_src_third__party_opus_src_celt_arm_armcpu.c new file mode 100644 index 000000000000..e5d59c3fc889 --- /dev/null +++ b/multimedia/ringrtc/files/patch-src_webrtc_src_third__party_opus_src_celt_arm_armcpu.c @@ -0,0 +1,40 @@ +--- ../../src/webrtc/src/third_party/opus/src/celt/arm/armcpu.c.orig 2023-10-25 18:00:46 UTC ++++ ../../src/webrtc/src/third_party/opus/src/celt/arm/armcpu.c +@@ -148,6 +148,37 @@ + } + return flags; + } ++#elif defined(__FreeBSD__) ++#include <sys/auxv.h> ++ ++opus_uint32 opus_cpu_capabilities(void) ++{ ++ long hwcap = 0; ++ opus_uint32 flags = 0; ++ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); ++ ++# if defined(OPUS_ARM_MAY_HAVE_EDSP) || defined(OPUS_ARM_MAY_HAVE_MEDIA) \ ++ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ if (hwcap & HWCAP_EDSP) ++ flags |= OPUS_CPU_ARM_EDSP_FLAG; ++ ++# if defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ if (hwcap & HWCAP_NEON) ++ flags |= OPUS_CPU_ARM_NEON_FLAG; ++# endif ++# endif ++ ++# if defined(OPUS_ARM_MAY_HAVE_MEDIA) \ ++ || defined(OPUS_ARM_MAY_HAVE_NEON) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR) ++ ++# if __ARM_ARCH >= 6 ++ flags |= OPUS_CPU_ARM_MEDIA_FLAG; ++# endif ++# endif ++ ++ return (flags); ++} + #else + /* The feature registers which can tell us what the processor supports are + * accessible in priveleged modes only, so we can't have a general user-space
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202310270634.39R6YFA2090154>