git: 5d97e86feed9 - main - www/*chromium: unbreak arm64 by implementing the missing cpudetect code

From: Robert Nagy <rnagy_at_FreeBSD.org>
Date: Mon, 08 Jan 2024 21:10:09 UTC
The branch main has been updated by rnagy:

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

commit 5d97e86feed90c9cf5fc79449740308bf86cd692
Author:     Robert Nagy <rnagy@FreeBSD.org>
AuthorDate: 2024-01-08 21:09:10 +0000
Commit:     Robert Nagy <rnagy@FreeBSD.org>
CommitDate: 2024-01-08 21:10:02 +0000

    www/*chromium: unbreak arm64 by implementing the missing cpudetect code
---
 ...vpx_source_libvpx_vpx__ports_aarch64__cpudetect.c | 20 ++++++++++++++++++++
 ...vpx_source_libvpx_vpx__ports_aarch64__cpudetect.c | 20 ++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/www/chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c b/www/chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
new file mode 100644
index 000000000000..92163a805c0c
--- /dev/null
+++ b/www/chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
@@ -0,0 +1,20 @@
+--- third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c.orig	2024-01-08 12:52:53 UTC
++++ third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c
+@@ -153,7 +153,16 @@ static int arm_get_cpu_caps(void) {
+   return flags;
+ }
+ 
+-#else  // end __Fuchsia__
++#elif defined(__FreeBSD__)  // end __Fuchsia__
++
++int arm_get_cpu_caps(void) {
++  int flags = 0;
++#if HAVE_NEON
++  flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
++#endif  // HAVE_NEON
++  return flags;
++}
++#else  // end __FreeBSD__
+ #error \
+     "Runtime CPU detection selected, but no CPU detection method available" \
+ "for your platform. Rerun configure with --disable-runtime-cpu-detect."
diff --git a/www/ungoogled-chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c b/www/ungoogled-chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
new file mode 100644
index 000000000000..92163a805c0c
--- /dev/null
+++ b/www/ungoogled-chromium/files/patch-third__party_libvpx_source_libvpx_vpx__ports_aarch64__cpudetect.c
@@ -0,0 +1,20 @@
+--- third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c.orig	2024-01-08 12:52:53 UTC
++++ third_party/libvpx/source/libvpx/vpx_ports/aarch64_cpudetect.c
+@@ -153,7 +153,16 @@ static int arm_get_cpu_caps(void) {
+   return flags;
+ }
+ 
+-#else  // end __Fuchsia__
++#elif defined(__FreeBSD__)  // end __Fuchsia__
++
++int arm_get_cpu_caps(void) {
++  int flags = 0;
++#if HAVE_NEON
++  flags |= HAS_NEON;  // Neon is mandatory in Armv8.0-A.
++#endif  // HAVE_NEON
++  return flags;
++}
++#else  // end __FreeBSD__
+ #error \
+     "Runtime CPU detection selected, but no CPU detection method available" \
+ "for your platform. Rerun configure with --disable-runtime-cpu-detect."