git: 7a28b0b53302 - 2022Q2 - www/firefox: try to fix build on diverse CPUs

From: Christoph Moench-Tegeder <cmt_at_FreeBSD.org>
Date: Mon, 04 Apr 2022 18:44:32 UTC
The branch 2022Q2 has been updated by cmt:

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

commit 7a28b0b5330265594250211b71d1731078dce973
Author:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
AuthorDate: 2022-04-04 18:41:45 +0000
Commit:     Christoph Moench-Tegeder <cmt@FreeBSD.org>
CommitDate: 2022-04-04 18:44:21 +0000

    www/firefox: try to fix build on diverse CPUs
    
    the cpuid.h header errors out on anythinbg non-x86, as per
    http://ampere1.nyi.freebsd.org/data/123arm64-quarterly/5889de908603/logs/firefox-99.0_1,2.log
    limit the include to x86 - the actual use of that was already limited
    to amd64, everything else gets the fallthrough
    
    (cherry picked from commit 4a4ffa51d5f0f57bd4047b04fe348594a89fdd0d)
---
 www/firefox/files/patch-tools_profiler_core_patform.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/firefox/files/patch-tools_profiler_core_patform.cpp b/www/firefox/files/patch-tools_profiler_core_patform.cpp
index e07969fa8f41..905e6d7bbe49 100644
--- a/www/firefox/files/patch-tools_profiler_core_patform.cpp
+++ b/www/firefox/files/patch-tools_profiler_core_patform.cpp
@@ -1,14 +1,14 @@
-commit 913cfc8ce77818fa44f9086ee44538337930a9ef
+commit 45a7951cb6a9b1735b9b6cec89db69b5933715c7
 Author: Christoph Moench-Tegeder <cmt@FreeBSD.org>
 Date:   Mon Mar 28 21:54:35 2022 +0200
 
     FreeBSD can use sched_getcpu() from 1400046/1300524 on
 
 diff --git tools/profiler/core/platform.cpp tools/profiler/core/platform.cpp
-index 92bcc1100687..77285f67b62c 100644
+index 92bcc1100687..2f17a88942a8 100644
 --- tools/profiler/core/platform.cpp
 +++ tools/profiler/core/platform.cpp
-@@ -111,6 +111,17 @@
+@@ -111,6 +111,20 @@
  #  include <cpuid.h>
  #endif
  
@@ -18,15 +18,18 @@ index 92bcc1100687..77285f67b62c 100644
 +#  if __FreeBSD_version > 1400045 || (__FreeBSD_version > 1300523 && __FreeBSD_version < 1400000)
 +#  include <sched.h>
 +#  else
++#    if __x86_64__ || __i386__
 +// similar cpuid_count() trick as on Darwin, using LLVM
-+#  include <cpuid.h>
++// but not for all CPUs
++#      include <cpuid.h>
++#    endif
 +#  endif
 +#endif
 +
  #if defined(GP_OS_windows)
  #  include <processthreadsapi.h>
  
-@@ -6368,6 +6379,19 @@ void profiler_mark_thread_awake() {
+@@ -6368,6 +6382,19 @@ void profiler_mark_thread_awake() {
      cpuId = ebx >> 24;
    }
  #  endif