Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] chromium: update to 99.0.4844.51.
@ 2022-03-03  1:58 Duncaen
  2022-03-03 15:52 ` [PR PATCH] [Updated] " Duncaen
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03  1:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

There is a new pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [ ] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 27537 bytes --]

From e836b68a25a149b1b8a7b5aed153cf99eaa731fb Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../files/musl-patches/musl-fixes.patch       | 29 ++++---
 .../files/musl-patches/no-mallinfo.patch      | 27 +++---
 .../files/musl-patches/resolver.patch         | 86 +++++--------------
 srcpkgs/chromium/patches/cross-build.patch    |  4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch | 33 -------
 srcpkgs/chromium/patches/libc_malloc.patch    | 34 +++++---
 srcpkgs/chromium/patches/musl-stat.patch      |  8 +-
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch | 29 +++----
 ...ebcodecs-stop-using-AudioOpusEncoder.patch | 49 +++++++++++
 srcpkgs/chromium/patches/webrtc-include.patch | 10 ---
 .../patches/xxx-ppc64le-4k-pages.patch        |  6 +-
 .../patches/xxx-ppc64le-support.patch         | 49 ++++++-----
 srcpkgs/chromium/template                     |  4 +-
 13 files changed, 170 insertions(+), 198 deletions(-)
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
index 728f2b473ce3..86f308b1f41b 100644
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
@@ -80,7 +80,7 @@ diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b
 @@ -55,7 +55,9 @@
  // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
  // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
 +#if defined(__GLIBC__)
  #include <gnu/libc-version.h>
 +#endif
@@ -91,7 +91,7 @@ diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b
  void RecordLinuxGlibcVersion() {
  // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
  // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
 +#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
    base::Version version(gnu_get_libc_version());
  
@@ -119,13 +119,14 @@ diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/incl
  #endif
 --- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
 +++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
+@@ -557,8 +557,8 @@
  
  LogMessage::~LogMessage() {
    size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
+-#if !defined(OFFICIAL_BUILD) && !BUILDFLAG(IS_NACL) && !defined(__UCLIBC__) && \
+-    !BUILDFLAG(IS_AIX)
++#if !defined(OFFICIAL_BUILD) && !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_AIX) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
      base::debug::StackTrace stack_trace;
@@ -149,14 +150,14 @@ diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/incl
      defined(OS_FUCHSIA)
    pthread_attr_t attr;
    int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
+--- net/dns/public/scoped_res_state.cc.orig
++++ net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
    // res_init behaves the same way.
    memset(&_res, 0, sizeof(_res));
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index 9de49bf328fb..8bc4e3435969 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -1,77 +1,35 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
+--- net/dns/host_resolver_manager.cc.orig
++++ net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
    if (system_dns_config_notifier_)
      system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    EnsureDnsReloaderInit();
  #endif
  
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
+--- net/dns/dns_reloader.cc.orig
++++ net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
  
- #include "net/dns/dns_reloader.h"
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
  #include <resolv.h>
  
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+--- net/dns/host_resolver_proc.cc.orig
++++ net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
                                                  base::BlockingType::WILL_BLOCK);
  
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) ||
++    (BUILDFLAG(IS_LINUX) && !defined(:_GLIBC__)))
    DnsReloaderMaybeReload();
  #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
@ 2022-03-03 15:52 ` Duncaen
  2022-03-03 16:45 ` Duncaen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03 15:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [ ] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 48171 bytes --]

From 87a21c18ce82465e73b5b1af3e0c0477b95e1988 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  86 ++-----
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  28 +++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  14 ++
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  11 +
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   4 +-
 25 files changed, 376 insertions(+), 478 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index 9de49bf328fb..8bc4e3435969 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -1,77 +1,35 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
+--- net/dns/host_resolver_manager.cc.orig
++++ net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
    if (system_dns_config_notifier_)
      system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    EnsureDnsReloaderInit();
  #endif
  
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
+--- net/dns/dns_reloader.cc.orig
++++ net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
  
- #include "net/dns/dns_reloader.h"
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
  #include <resolv.h>
  
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+--- net/dns/host_resolver_proc.cc.orig
++++ net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
                                                  base::BlockingType::WILL_BLOCK);
  
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) ||
++    (BUILDFLAG(IS_LINUX) && !defined(:_GLIBC__)))
    DnsReloaderMaybeReload();
  #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..7e85a7dcf477
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,28 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -58,14 +58,14 @@
+ 
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/version.h"
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/events/devices/device_data_manager.h"
+@@ -321,7 +321,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..5d549dfd4a0a
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,14 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,11 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#else
++#define HAVE_CANONICALIZE_FILE_NAME 0
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..677eefb18a7f
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,11 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
  2022-03-03 15:52 ` [PR PATCH] [Updated] " Duncaen
@ 2022-03-03 16:45 ` Duncaen
  2022-03-03 17:27 ` Duncaen
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03 16:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 48830 bytes --]

From e1a42dd50a225574276cd6fea7634474b4d286aa Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  86 ++-----
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  28 +++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../fix-musl-missing-unistd_h-include.patch   |  10 +
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  12 +
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  11 +
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   4 +-
 26 files changed, 384 insertions(+), 478 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
index 9de49bf328fb..8bc4e3435969 100644
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ b/srcpkgs/chromium/files/musl-patches/resolver.patch
@@ -1,77 +1,35 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
+--- net/dns/host_resolver_manager.cc.orig
++++ net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
    if (system_dns_config_notifier_)
      system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    EnsureDnsReloaderInit();
  #endif
  
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
+--- net/dns/dns_reloader.cc.orig
++++ net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
  
- #include "net/dns/dns_reloader.h"
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
  #include <resolv.h>
  
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+--- net/dns/host_resolver_proc.cc.orig
++++ net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
                                                  base::BlockingType::WILL_BLOCK);
  
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) ||
++    (BUILDFLAG(IS_LINUX) && !defined(:_GLIBC__)))
    DnsReloaderMaybeReload();
  #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..7e85a7dcf477
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,28 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -58,14 +58,14 @@
+ 
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/version.h"
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/events/devices/device_data_manager.h"
+@@ -321,7 +321,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
new file mode 100644
index 000000000000..e14d009a9e0b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
@@ -0,0 +1,10 @@
+--- a/sandbox/linux/services/credentials.h
++++ b/sandbox/linux/services/credentials.h
+@@ -13,6 +13,7 @@
+ 
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..7a0337f3bf3b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,12 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,9 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..677eefb18a7f
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,11 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
  2022-03-03 15:52 ` [PR PATCH] [Updated] " Duncaen
  2022-03-03 16:45 ` Duncaen
@ 2022-03-03 17:27 ` Duncaen
  2022-03-03 19:54 ` Duncaen
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03 17:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 49899 bytes --]

From 3981f5f3c779cf2320b54f0887e0285fb9d8b5a8 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  77 -------
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  28 +++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../fix-musl-missing-unistd_h-include.patch   |  10 +
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  12 +
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  66 ++++++
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   4 +-
 26 files changed, 417 insertions(+), 491 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/resolver.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
deleted file mode 100644
index 9de49bf328fb..000000000000
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
-   if (system_dns_config_notifier_)
-     system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
-   EnsureDnsReloaderInit();
- #endif
- 
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
- 
- #include "net/dns/dns_reloader.h"
- 
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
- #include <resolv.h>
- 
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
-                                                 base::BlockingType::WILL_BLOCK);
- 
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
-   DnsReloaderMaybeReload();
- #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..7e85a7dcf477
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,28 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -58,14 +58,14 @@
+ 
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+ #include "base/strings/string_util.h"
+ #include "base/version.h"
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #if defined(USE_OZONE)
+ #include "ui/events/devices/device_data_manager.h"
+@@ -321,7 +321,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
new file mode 100644
index 000000000000..e14d009a9e0b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
@@ -0,0 +1,10 @@
+--- a/sandbox/linux/services/credentials.h
++++ b/sandbox/linux/services/credentials.h
+@@ -13,6 +13,7 @@
+ 
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..7a0337f3bf3b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,12 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,9 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..ece17c525f7a
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,66 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
+--- a/net/dns/public/scoped_res_state.cc
++++ b/net/dns/public/scoped_res_state.cc
+@@ -25,7 +25,7 @@
+ }
+ 
+ ScopedResState::~ScopedResState() {
+-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+   // Prefer res_ndestroy where available.
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+@@ -34,7 +34,7 @@
+   res_nclose(&res_);
+ #endif  // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+ 
+-#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ }
+ 
+ bool ScopedResState::IsValid() const {
+--- net/dns/host_resolver_manager.cc.orig
++++ net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
+   if (system_dns_config_notifier_)
+     system_dns_config_notifier_->AddObserver(this);
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   EnsureDnsReloaderInit();
+ #endif
+ 
+--- net/dns/dns_reloader.cc.orig
++++ net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
+ 
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+ #include <resolv.h>
+ 
+--- net/dns/host_resolver_proc.cc.orig
++++ net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
+                                                 base::BlockingType::WILL_BLOCK);
+ 
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__)))
+   DnsReloaderMaybeReload();
+ #endif
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
                   ` (2 preceding siblings ...)
  2022-03-03 17:27 ` Duncaen
@ 2022-03-03 19:54 ` Duncaen
  2022-03-03 22:54 ` Duncaen
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03 19:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 49690 bytes --]

From 99eae9b9d73027dabea4e488b632312c05d8fe3c Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  77 -------
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  21 ++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../fix-musl-missing-unistd_h-include.patch   |  10 +
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  12 +
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  66 ++++++
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   4 +-
 26 files changed, 410 insertions(+), 491 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/resolver.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
deleted file mode 100644
index 9de49bf328fb..000000000000
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
-   if (system_dns_config_notifier_)
-     system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
-   EnsureDnsReloaderInit();
- #endif
- 
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
- 
- #include "net/dns/dns_reloader.h"
- 
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
- #include <resolv.h>
- 
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
-                                                 base::BlockingType::WILL_BLOCK);
- 
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
-   DnsReloaderMaybeReload();
- #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..2522294f75ea
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,21 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -59,7 +59,9 @@
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+@@ -323,7 +323,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
new file mode 100644
index 000000000000..e14d009a9e0b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
@@ -0,0 +1,10 @@
+--- a/sandbox/linux/services/credentials.h
++++ b/sandbox/linux/services/credentials.h
+@@ -13,6 +13,7 @@
+ 
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..7a0337f3bf3b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,12 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,9 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..6bb7aaabb76c
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,66 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
+--- a/net/dns/public/scoped_res_state.cc
++++ b/net/dns/public/scoped_res_state.cc
+@@ -25,7 +25,7 @@
+ }
+ 
+ ScopedResState::~ScopedResState() {
+-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+   // Prefer res_ndestroy where available.
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+@@ -34,7 +34,7 @@
+   res_nclose(&res_);
+ #endif  // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+ 
+-#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ }
+ 
+ bool ScopedResState::IsValid() const {
+--- a/net/dns/host_resolver_manager.cc.orig
++++ b/net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
+   if (system_dns_config_notifier_)
+     system_dns_config_notifier_->AddObserver(this);
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   EnsureDnsReloaderInit();
+ #endif
+ 
+--- a/net/dns/dns_reloader.cc.orig
++++ b/net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
+ 
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+ #include <resolv.h>
+ 
+--- a/net/dns/host_resolver_proc.cc.orig
++++ b/net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
+                                                 base::BlockingType::WILL_BLOCK);
+ 
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__)))
+   DnsReloaderMaybeReload();
+ #endif
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
                   ` (3 preceding siblings ...)
  2022-03-03 19:54 ` Duncaen
@ 2022-03-03 22:54 ` Duncaen
  2022-03-04 14:09 ` Duncaen
  2022-03-07 15:43 ` [PR PATCH] [Merged]: " q66
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-03 22:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [x] x86_64-glibc
* [ ] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 49690 bytes --]

From 2e084a1dddb7fdb2e6669fa48d8a5701ff1adc3c Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  77 -------
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  21 ++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../fix-musl-missing-unistd_h-include.patch   |  10 +
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  12 +
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  66 ++++++
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   4 +-
 26 files changed, 410 insertions(+), 491 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/resolver.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
deleted file mode 100644
index 9de49bf328fb..000000000000
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
-   if (system_dns_config_notifier_)
-     system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
-   EnsureDnsReloaderInit();
- #endif
- 
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
- 
- #include "net/dns/dns_reloader.h"
- 
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
- #include <resolv.h>
- 
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
-                                                 base::BlockingType::WILL_BLOCK);
- 
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
-   DnsReloaderMaybeReload();
- #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..2522294f75ea
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,21 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -59,7 +59,9 @@
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+@@ -323,7 +323,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
new file mode 100644
index 000000000000..e14d009a9e0b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
@@ -0,0 +1,10 @@
+--- a/sandbox/linux/services/credentials.h
++++ b/sandbox/linux/services/credentials.h
+@@ -13,6 +13,7 @@
+ 
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..7a0337f3bf3b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,12 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,9 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..6bb7aaabb76c
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,66 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
+--- a/net/dns/public/scoped_res_state.cc
++++ b/net/dns/public/scoped_res_state.cc
+@@ -25,7 +25,7 @@
+ }
+ 
+ ScopedResState::~ScopedResState() {
+-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+   // Prefer res_ndestroy where available.
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+@@ -34,7 +34,7 @@
+   res_nclose(&res_);
+ #endif  // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+ 
+-#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ }
+ 
+ bool ScopedResState::IsValid() const {
+--- a/net/dns/host_resolver_manager.cc.orig
++++ b/net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
+   if (system_dns_config_notifier_)
+     system_dns_config_notifier_->AddObserver(this);
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   EnsureDnsReloaderInit();
+ #endif
+ 
+--- a/net/dns/dns_reloader.cc.orig
++++ b/net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
+ 
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+ #include <resolv.h>
+ 
+--- a/net/dns/host_resolver_proc.cc.orig
++++ b/net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
+                                                 base::BlockingType::WILL_BLOCK);
+ 
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__)))
+   DnsReloaderMaybeReload();
+ #endif
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..76c9d58b2be6 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
                   ` (4 preceding siblings ...)
  2022-03-03 22:54 ` Duncaen
@ 2022-03-04 14:09 ` Duncaen
  2022-03-07 15:43 ` [PR PATCH] [Merged]: " q66
  6 siblings, 0 replies; 8+ messages in thread
From: Duncaen @ 2022-03-04 14:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

There is an updated pull request by Duncaen against master on the void-packages repository

https://github.com/Duncaen/void-packages chromium-99
https://github.com/void-linux/void-packages/pull/35937

chromium: update to 99.0.4844.51.
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [ ] aarch64-musl
* [ ] i686-glibc

musl patches probably still need some work this time.

A patch file from https://github.com/void-linux/void-packages/pull/35937.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-chromium-99-35937.patch --]
[-- Type: text/x-diff, Size: 50765 bytes --]

From b54ebd98c275cb42a0696c94b157ec1a810decdc Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 3 Mar 2022 02:55:40 +0100
Subject: [PATCH] chromium: update to 99.0.4844.51.

---
 .../default-pthread-stacksize.patch           |  29 ---
 .../files/musl-patches/musl-crashpad.patch    |  23 --
 .../files/musl-patches/musl-fixes.patch       | 212 ------------------
 .../files/musl-patches/musl-sync.patch        |  30 ---
 .../files/musl-patches/no-mallinfo.patch      |  27 +--
 .../files/musl-patches/resolver.patch         |  77 -------
 srcpkgs/chromium/patches/cross-build.patch    |   4 +-
 .../disable-aarch64-memory-tagging.patch      |  16 ++
 ...ngrade-duplicate-peer-error-to-dvlog.patch |  33 ---
 .../patches/fix-gnu-libc-version-usage.patch  |  21 ++
 ...fix-missing-TEMP_FAILURE_RETRY-macro.patch |  21 ++
 .../fix-musl-missing-unistd_h-include.patch   |  10 +
 .../patches/fix-musl-pthread-stacksize.patch  |  40 ++++
 .../patches/fix-nasm-musl-config.patch        |  12 +
 .../fix-perfetto-GetThreadName-musl.patch     |  22 ++
 .../chromium/patches/fix-resolver-musl.patch  |  66 ++++++
 .../patches/fix-stack-utils-with-musl.patch   |  20 ++
 .../fix-swiftshader-llvm-musl-config.patch    |  26 +++
 srcpkgs/chromium/patches/libc_malloc.patch    |  34 +--
 srcpkgs/chromium/patches/musl-stat.patch      |   8 +-
 .../patches/remove-sys-cdefs-includes.patch   |  39 ++++
 ...ne_MM_Var-in-CFX_Font-AdjustMMParams.patch |  29 ++-
 ...ebcodecs-stop-using-AudioOpusEncoder.patch |  49 ++++
 srcpkgs/chromium/patches/webrtc-include.patch |  10 -
 .../patches/xxx-ppc64le-4k-pages.patch        |   6 +-
 .../patches/xxx-ppc64le-support.patch         |  49 ++--
 srcpkgs/chromium/template                     |   5 +-
 27 files changed, 426 insertions(+), 492 deletions(-)
 delete mode 100644 srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-fixes.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/musl-sync.patch
 delete mode 100644 srcpkgs/chromium/files/musl-patches/resolver.patch
 create mode 100644 srcpkgs/chromium/patches/disable-aarch64-memory-tagging.patch
 delete mode 100644 srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
 create mode 100644 srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
 create mode 100644 srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
 create mode 100644 srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
 create mode 100644 srcpkgs/chromium/patches/fix-nasm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-resolver-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
 create mode 100644 srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
 create mode 100644 srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
 create mode 100644 srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
 delete mode 100644 srcpkgs/chromium/patches/webrtc-include.patch

diff --git a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch b/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
deleted file mode 100644
index 26884f6cc937..000000000000
--- a/srcpkgs/chromium/files/musl-patches/default-pthread-stacksize.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- base/threading/platform_thread_linux.cc.orig
-+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
--  return 0;
-+  // use 8mb like glibc to avoid running out of space
-+  return (1 << 23);
---- chrome/browser/shutdown_signal_handlers_posix.cc.orig
-+++ chrome/browser/shutdown_signal_handlers_posix.cc
-@@ -187,11 +187,19 @@
-   g_shutdown_pipe_read_fd = pipefd[0];
-   g_shutdown_pipe_write_fd = pipefd[1];
- #if !defined(ADDRESS_SANITIZER)
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #else
-   // ASan instrumentation bloats the stack frames, so we need to increase the
-   // stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
-   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
-+# else
-+  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
-+# endif
- #endif
-   ShutdownDetector* detector = new ShutdownDetector(
-       g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
diff --git a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch b/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
deleted file mode 100644
index 03a0c06f3ca6..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-crashpad.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -26,6 +26,7 @@
- 
- #if defined(ARCH_CPU_X86_FAMILY)
- #include <asm/ldt.h>
-+#include <asm/ptrace-abi.h>
- #endif
- 
- namespace crashpad {
-
---- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-+++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
-@@ -17,7 +17,9 @@
- 
- #include_next <sys/ptrace.h>
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- 
- // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
- #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
diff --git a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch b/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
deleted file mode 100644
index 728f2b473ce3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
---- ./third_party/lss/linux_syscall_support.h.orig
-+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
- #ifndef __NR_fallocate
- #define __NR_fallocate          285
- #endif
-+
-+#undef __NR_pread
-+#define __NR_pread __NR_pread64
-+#undef __NR_pwrite
-+#define __NR_pwrite __NR_pwrite64
-+
- /* End of x86-64 definitions                                                 */
- #elif defined(__mips__)
- #if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
-+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -37,6 +37,10 @@
- #include "common/memory.h"
- #include "google_breakpad/common/minidump_format.h"
- 
-+#if !defined(__GLIBC__)
-+	#define _libc_fpstate _fpstate
-+#endif
-+
- namespace google_breakpad {
- 
- // Wraps platform-dependent implementations of accessors to ucontext_t structs.
---- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
-+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,7 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#include <limits.h>
- 
- #include "common/memory_range.h"
- 
---- ./sandbox/linux/suid/process_util.h.orig
-+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
- #include <sys/types.h>
- 
-+// Some additional functions
-+# define TEMP_FAILURE_RETRY(expression) \
-+	(__extension__			\
-+	 ({ long int __result;		\
-+	  do __result = (long int) (expression); \
-+	  while (__result == -1L && errno == EINTR); \
-+	  __result; }))
-+
- // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
- // will prefer certain process types over others. The range for the
- // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig	2020-04-12 08:26:40.184159217 -0400
-+++ ./sandbox/linux/seccomp-bpf/trap.cc	2020-04-12 08:46:16.737191222 -0400
-@@ -174,7 +174,7 @@
-   // If the version of glibc doesn't include this information in
-   // siginfo_t (older than 2.17), we need to explicitly copy it
-   // into an arch_sigsys structure.
--  memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
-+  memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
- #endif
- 
- #if defined(__mips__)
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
-+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
- #include <sys/param.h>
- #endif
- #include <sys/types.h>
--#include <sys/sysctl.h>
- #endif
- #if HAVE_UNISTD_H
- #include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
---- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig	2021-03-10 07:23:00.145810088 -0500
-+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc	2021-03-10 10:57:19.405962671 -0500
-@@ -55,7 +55,9 @@
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
- #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__)
- #include <gnu/libc-version.h>
-+#endif
- 
- #include "base/linux_util.h"
- #include "base/strings/string_split.h"
-@@ -316,7 +318,7 @@
- void RecordLinuxGlibcVersion() {
- // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
- // of lacros-chrome is complete.
--#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
-+#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
-   base::Version version(gnu_get_libc_version());
- 
-   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- services/device/serial/serial_io_handler_posix.cc.orig	2019-07-03 10:57:32.568171835 -0400
-+++ services/device/serial/serial_io_handler_posix.cc	2019-07-03 10:57:16.867983031 -0400
-@@ -6,6 +6,7 @@
- 
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
- 
- #include <algorithm>
- #include <utility>
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
---- third_party/ots/src/include/opentype-sanitiser.h
-+++ third_party/ots/src/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig	2021-01-20 12:09:54.227038757 -0500
-+++ ./base/logging.cc	2021-01-20 12:24:32.600301351 -0500
-@@ -557,8 +557,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
--    !defined(OS_AIX)
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
-   if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
-     base::debug::StackTrace stack_trace;
---- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
-+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   // pthread_getattr_np() can fail if the thread is not invoked by
-   // pthread_create() (e.g., the main thread of blink_unittests).
-@@ -96,7 +96,7 @@
- }
- 
- void* GetStackStart() {
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-     defined(OS_FUCHSIA)
-   pthread_attr_t attr;
-   int error;
---- ./net/dns/dns_config_service_posix.cc.orig
-+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
-   ConfigParsePosixResult result;
-   config->unhandled_options = false;
- // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
--#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
-+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
-   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
-   // res_init behaves the same way.
-   memset(&_res, 0, sizeof(_res));
---- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig	2019-06-18 11:51:17.000000000 -0400
-+++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc	2019-07-03 12:32:50.938758186 -0400
-@@ -25,7 +25,7 @@
- #include "llvm/Support/raw_ostream.h"
- #include <algorithm>
- #include <string>
--#if HAVE_EXECINFO_H
-+#if HAVE_EXECINFO_H && defined(__GLIBC__)
- # include <execinfo.h>         // For backtrace().
- #endif
- #if HAVE_SIGNAL_H
-@@ -52,6 +52,7 @@
- #include <unwind.h>
- #else
- #undef HAVE__UNWIND_BACKTRACE
-+#undef HAVE_BACKTRACE
- #endif
- #endif
- 
---- third_party/nasm/nasmlib/realpath.c.orig	2019-07-03 12:23:05.021949895 -0400
-+++ third_party/nasm/nasmlib/realpath.c	2019-07-03 12:24:24.246862665 -0400
-@@ -49,7 +49,7 @@
- 
- #include "nasmlib.h"
- 
--#ifdef HAVE_CANONICALIZE_FILE_NAME
-+#if defined(__GLIBC__)
- 
- /*
-  * GNU-specific, but avoids the realpath(..., NULL)
---- third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-+++ third_party/perfetto/include/perfetto/ext/base/thread_utils.h
-@@ -29,7 +29,7 @@
- #include <algorithm>
- #endif
- 
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
- #include <sys/prctl.h>
- #endif
- 
-@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
- 
- inline bool GetThreadName(std::string& out_result) {
-   char buf[16] = {};
--#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
-+#if 1
-   if (prctl(PR_GET_NAME, buf) != 0)
-     return false;
- #else
diff --git a/srcpkgs/chromium/files/musl-patches/musl-sync.patch b/srcpkgs/chromium/files/musl-patches/musl-sync.patch
deleted file mode 100644
index bc2fa1937bd3..000000000000
--- a/srcpkgs/chromium/files/musl-patches/musl-sync.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- third_party/libsync/src/include/sync/sync.h.orig	2020-02-21 07:43:33.748325175 -0500
-+++ third_party/libsync/src/include/sync/sync.h	2020-02-21 07:44:07.288328784 -0500
-@@ -19,12 +19,16 @@
- #ifndef __SYS_CORE_SYNC_H
- #define __SYS_CORE_SYNC_H
- 
-+#if defined(__GLIBC__)
- #include <sys/cdefs.h>
-+#endif
- #include <stdint.h>
- 
- #include <linux/types.h>
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- struct sync_legacy_merge_data {
-  int32_t fd2;
-@@ -158,6 +162,8 @@
-                                   struct sync_pt_info *itr);
- void sync_fence_info_free(struct sync_fence_info_data *info);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
index 2524cbb84ca9..5b486ca62139 100644
--- a/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
+++ b/srcpkgs/chromium/files/musl-patches/no-mallinfo.patch
@@ -9,34 +9,35 @@
  #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
  #if __GLIBC_PREREQ(2, 33)
  #define MALLINFO2_FOUND_IN_LIBC
---- ./base/process/process_metrics_posix.cc
-+++ ./base/process/process_metrics_posix.cc
+--- base/process/process_metrics_posix.cc.orig
++++ base/process/process_metrics_posix.cc
 @@ -105,7 +105,7 @@
  
- #endif  // !defined(OS_FUCHSIA)
+ #endif  // !BUILDFLAG(IS_FUCHSIA)
  
--#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#if (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
  namespace {
  
  size_t GetMallocUsageMallinfo() {
-@@ -127,16 +127,16 @@
+@@ -123,7 +123,7 @@
  }
  
  }  // namespace
--#endif  // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#endif  // (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+         // BUILDFLAG(IS_ANDROID)
  
  size_t ProcessMetrics::GetMallocUsage() {
- #if defined(OS_APPLE)
+@@ -131,9 +131,9 @@
    malloc_statistics_t stats = {0};
    malloc_zone_statistics(nullptr, &stats);
    return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
    return GetMallocUsageMallinfo();
--#elif defined(OS_FUCHSIA)
-+#else
+-#elif BUILDFLAG(IS_FUCHSIA)
++#elif BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
    // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
    return 0;
  #endif
diff --git a/srcpkgs/chromium/files/musl-patches/resolver.patch b/srcpkgs/chromium/files/musl-patches/resolver.patch
deleted file mode 100644
index 9de49bf328fb..000000000000
--- a/srcpkgs/chromium/files/musl-patches/resolver.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- net/dns/host_resolver_manager.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/host_resolver_manager.cc	2020-10-09 16:42:49.738302772 -0400
-@@ -2779,8 +2779,7 @@
-   NetworkChangeNotifier::AddConnectionTypeObserver(this);
-   if (system_dns_config_notifier_)
-     system_dns_config_notifier_->AddObserver(this);
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID)
-+#if defined(__GLIBC__)
-   EnsureDnsReloaderInit();
- #endif
- 
---- net/dns/dns_reloader.cc.orig	2020-10-09 16:39:12.064069835 -0400
-+++ net/dns/dns_reloader.cc	2020-10-09 16:44:30.442419823 -0400
-@@ -4,9 +4,8 @@
- 
- #include "net/dns/dns_reloader.h"
- 
--#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
--    !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
--
-+#if defined(__GLIBC__)
-+ 
- #include <resolv.h>
- 
- #include "base/lazy_instance.h"
---- net/dns/host_resolver_proc.cc.orig	2020-10-09 16:39:12.065069836 -0400
-+++ net/dns/host_resolver_proc.cc	2020-10-09 16:45:09.641466644 -0400
-@@ -159,8 +159,7 @@
-   base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
-                                                 base::BlockingType::WILL_BLOCK);
- 
--#if defined(OS_POSIX) && \
--    !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
-+#if defined(__GLIBC__)
-   DnsReloaderMaybeReload();
- #endif
-   base::Optional<AddressInfo> ai;
---- net/dns/dns_config_service_linux.cc.orig
-+++ net/dns/dns_config_service_linux.cc
-@@ -443,11 +443,13 @@
-       base::ScopedBlockingCall scoped_blocking_call(
-           FROM_HERE, base::BlockingType::MAY_BLOCK);
- 
-+#if defined(__GLIBC__)
-       std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
-       if (res) {
-         dns_config_ = ConvertResStateToDnsConfig(*res.get());
-         resolv_reader_->CloseResState(res.get());
-       }
-+#endif
- 
-       UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
-                             dns_config_.has_value());
---- net/dns/public/resolv_reader.cc.orig
-+++ net/dns/public/resolv_reader.cc
-@@ -20,19 +20,10 @@
- namespace net {
- 
- std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
--  auto res = std::make_unique<struct __res_state>();
--  memset(res.get(), 0, sizeof(struct __res_state));
--
--  if (res_ninit(res.get()) != 0) {
--    CloseResState(res.get());
--    return nullptr;
--  }
--
--  return res;
-+  return nullptr;
- }
- 
- void ResolvReader::CloseResState(struct __res_state* res) {
--  res_nclose(res);
- }
- 
- absl::optional<std::vector<IPEndPoint>> GetNameservers(
diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch
index 63b89395cb80..ddfe14951eef 100644
--- a/srcpkgs/chromium/patches/cross-build.patch
+++ b/srcpkgs/chromium/patches/cross-build.patch
@@ -60,6 +60,6 @@
    config(target_name) {
 -    if (host_toolchain == current_toolchain) {
 +    if (current_cpu != target_cpu) {
-       args = host_pkg_config_args + invoker.packages
+       args = common_pkg_config_args + host_pkg_config_args + invoker.packages
      } else {
-       args = pkg_config_args + invoker.packages
+       args = common_pkg_config_args + pkg_config_args + invoker.packages
diff --git a/srcpkgs/chromium/patches/disable-aarch64-memory-tagging.patch b/srcpkgs/chromium/patches/disable-aarch64-memory-tagging.patch
new file mode 100644
index 000000000000..0596c6364a68
--- /dev/null
+++ b/srcpkgs/chromium/patches/disable-aarch64-memory-tagging.patch
@@ -0,0 +1,16 @@
+This is broken in the current release and would require a lot of patches to be
+backported. Remove this patch for the next release.
+
+--- a/base/memory/tagging.h
++++ b/base/memory/tagging.h
+@@ -14,10 +14,6 @@
+ #include "base/compiler_specific.h"
+ #include "build/build_config.h"
+ 
+-#if defined(ARCH_CPU_ARM64) && defined(__clang__) && \
+-    (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID))
+-#define HAS_MEMORY_TAGGING 1
+-#endif
+ 
+ constexpr int kMemTagGranuleSize = 16u;
+ #if defined(HAS_MEMORY_TAGGING)
diff --git a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch b/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
deleted file mode 100644
index e07127a473d0..000000000000
--- a/srcpkgs/chromium/patches/downgrade-duplicate-peer-error-to-dvlog.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 00604ca8ed6d669fb6cb3ae8bacd6028d5ef10ac Mon Sep 17 00:00:00 2001
-From: Stephen Roettger <sroettger@google.com>
-Date: Thu, 20 Jan 2022 10:04:04 +0000
-Subject: [PATCH] Downgrade duplicate peer error to dvlog
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Downgrading since this case can happen in non-error situations. There can be
-duplicate introductions in flight in which case we simply drop the second one.
-
-Change-Id: I2c51b177913ccd9634e9bb6343d468101d9735ed
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398794
-Reviewed-by: Ken Rockot <rockot@google.com>
-Commit-Queue: Stephen Röttger <sroettger@google.com>
-Cr-Commit-Position: refs/heads/main@{#961389}
----
- mojo/core/node_controller.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc
-index 7cde7719687..81712676733 100644
---- a/mojo/core/node_controller.cc
-+++ b/mojo/core/node_controller.cc
-@@ -594,7 +594,7 @@ void NodeController::AddPeer(const ports::NodeName& name,
-     }
- 
-     if (dropped_peers_.Contains(name) && !allow_name_reuse) {
--      LOG(ERROR) << "Trying to re-add dropped peer " << name;
-+      DVLOG(1) << "Trying to re-add dropped peer " << name;
-       return;
-     }
- 
diff --git a/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
new file mode 100644
index 000000000000..2522294f75ea
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-gnu-libc-version-usage.patch
@@ -0,0 +1,21 @@
+--- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
++++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -59,7 +59,9 @@
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ #include <gnu/libc-version.h>
++#endif  // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ 
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+@@ -323,7 +323,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS_LACROS)
+   base::Version version(gnu_get_libc_version());
+ 
+   UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
diff --git a/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
new file mode 100644
index 000000000000..b56717b9ce32
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-missing-TEMP_FAILURE_RETRY-macro.patch
@@ -0,0 +1,21 @@
+This macro is defined in glibc, but not musl.
+
+--- a/sandbox/linux/suid/process_util.h.orig
++++ b/sandbox/linux/suid/process_util.h
+@@ -11,6 +11,16 @@
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
++// Some additional functions
++#if !defined(TEMP_FAILURE_RETRY)
++# define TEMP_FAILURE_RETRY(expression) \
++	(__extension__			\
++	 ({ long int __result;		\
++	  do __result = (long int) (expression); \
++	  while (__result == -1L && errno == EINTR); \
++	  __result; }))
++#endif
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
diff --git a/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
new file mode 100644
index 000000000000..e14d009a9e0b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-missing-unistd_h-include.patch
@@ -0,0 +1,10 @@
+--- a/sandbox/linux/services/credentials.h
++++ b/sandbox/linux/services/credentials.h
+@@ -13,6 +13,7 @@
+ 
+ #include <string>
+ #include <vector>
++#include <unistd.h>
+ 
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
diff --git a/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
new file mode 100644
index 000000000000..cd5533190db9
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-musl-pthread-stacksize.patch
@@ -0,0 +1,40 @@
+--- a/base/threading/platform_thread_linux.cc
++++ b/base/threading/platform_thread_linux.cc
+@@ -436,8 +436,13 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
+ #else
++  // musl libcs default is too small, use 8mb like glibc
++  return (1 << 23);
++#endif
++#else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
+   return 2 * (1 << 23);  // 2 times 8192K (the default stack size on Linux).
+--- a/chrome/browser/shutdown_signal_handlers_posix.cc
++++ b/chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -188,11 +188,21 @@
+   g_shutdown_pipe_read_fd = pipefd[0];
+   g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
+ #else
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8;
++#endif
++#else
+   // ASan instrumentation bloats the stack frames, so we need to increase the
+   // stack size to avoid hitting the guard page.
++#if defined(__GLIBC__)
+   const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++#else
++  const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8;
++  // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++#endif
+ #endif
+   ShutdownDetector* detector = new ShutdownDetector(
+       g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/srcpkgs/chromium/patches/fix-nasm-musl-config.patch b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
new file mode 100644
index 000000000000..7a0337f3bf3b
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-nasm-musl-config.patch
@@ -0,0 +1,12 @@
+--- a/third_party/nasm/config/config-linux.h
++++ b/third_party/nasm/config/config-linux.h
+@@ -139,7 +139,9 @@
+ #define HAVE_ACCESS 1
+ 
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
++#ifdef __GLIBC__
+ #define HAVE_CANONICALIZE_FILE_NAME 1
++#endif
+ 
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
new file mode 100644
index 000000000000..4014d1ee5e69
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-perfetto-GetThreadName-musl.patch
@@ -0,0 +1,22 @@
+--- a/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ b/third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -30,7 +30,8 @@
+ #include <algorithm>
+ #endif
+ 
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+ #include <sys/prctl.h>
+ #endif
+ 
+@@ -58,7 +59,8 @@
+ 
+ inline bool GetThreadName(std::string& out_result) {
+   char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
++    (PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) && !defined(__GLIBC__))
+   if (prctl(PR_GET_NAME, buf) != 0)
+     return false;
+ #else
diff --git a/srcpkgs/chromium/patches/fix-resolver-musl.patch b/srcpkgs/chromium/patches/fix-resolver-musl.patch
new file mode 100644
index 000000000000..6bb7aaabb76c
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-resolver-musl.patch
@@ -0,0 +1,66 @@
+--- a/net/dns/public/scoped_res_state.cc.orig
++++ b/net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+ 
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+   // res_init behaves the same way.
+   memset(&_res, 0, sizeof(_res));
+--- a/net/dns/public/scoped_res_state.cc
++++ b/net/dns/public/scoped_res_state.cc
+@@ -25,7 +25,7 @@
+ }
+ 
+ ScopedResState::~ScopedResState() {
+-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+   // Prefer res_ndestroy where available.
+ #if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+@@ -34,7 +34,7 @@
+   res_nclose(&res_);
+ #endif  // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+ 
+-#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++#endif  // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ }
+ 
+ bool ScopedResState::IsValid() const {
+--- a/net/dns/host_resolver_manager.cc.orig
++++ b/net/dns/host_resolver_manager.cc
+@@ -3015,7 +3015,7 @@
+   if (system_dns_config_notifier_)
+     system_dns_config_notifier_->AddObserver(this);
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID)
++    !BUILDFLAG(IS_ANDROID) && !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+   EnsureDnsReloaderInit();
+ #endif
+ 
+--- a/net/dns/dns_reloader.cc.orig
++++ b/net/dns/dns_reloader.cc
+@@ -7,7 +7,8 @@
+ #include "build/build_config.h"
+ 
+ #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+-    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++    !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA) && \
++    !(BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
+ 
+ #include <resolv.h>
+ 
+--- a/net/dns/host_resolver_proc.cc.orig
++++ b/net/dns/host_resolver_proc.cc
+@@ -177,7 +177,8 @@
+                                                 base::BlockingType::WILL_BLOCK);
+ 
+ #if BUILDFLAG(IS_POSIX) && \
+-    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++    !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__)))
+   DnsReloaderMaybeReload();
+ #endif
+   absl::optional<AddressInfo> ai;
diff --git a/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
new file mode 100644
index 000000000000..bb48d95312b3
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-stack-utils-with-musl.patch
@@ -0,0 +1,20 @@
+--- a/third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ b/third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -29,7 +29,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   // pthread_getattr_np() can fail if the thread is not invoked by
+   // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
+ }
+ 
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
+     defined(OS_FUCHSIA)
+   pthread_attr_t attr;
+   int error;
diff --git a/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
new file mode 100644
index 000000000000..7bf63bd33d4e
--- /dev/null
+++ b/srcpkgs/chromium/patches/fix-swiftshader-llvm-musl-config.patch
@@ -0,0 +1,26 @@
+--- a/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
++++ b/third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+@@ -17,7 +17,11 @@
+ #define ENABLE_CRASH_OVERRIDES 0
+ 
+ /* Define to 1 if you have the `backtrace' function. */
++#ifdef __GLIBC__
+ #define HAVE_BACKTRACE 1
++#else
++#define HAVE_BACKTRACE 0
++#endif
+ 
+ /* Define to 1 if you have the <CrashReporterClient.h> header file. */
+ /* #undef HAVE_CRASHREPORTERCLIENT_H */
+@@ -58,7 +62,11 @@
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define to 1 if you have the <execinfo.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_EXECINFO_H 1
++#else
++#define HAVE_EXECINFO_H 0
++#endif
+ 
+ /* Define to 1 if you have the <fcntl.h> header file. */
+ #define HAVE_FCNTL_H 1
diff --git a/srcpkgs/chromium/patches/libc_malloc.patch b/srcpkgs/chromium/patches/libc_malloc.patch
index ff672ea0fa7e..414f28765d69 100644
--- a/srcpkgs/chromium/patches/libc_malloc.patch
+++ b/srcpkgs/chromium/patches/libc_malloc.patch
@@ -1,26 +1,34 @@
---- a/base/process/memory_linux.cc	2017-09-15 08:41:43.000000000 +0000
-+++ b/base/process/memory_linux.cc	2017-09-15 08:44:39.804995469 +0000
-@@ -21,6 +21,12 @@
- #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h"
- #endif
+--- a/base/process/memory_linux.cc
++++ b/base/process/memory_linux.cc
+@@ -18,6 +18,13 @@
+ #include "base/threading/thread_restrictions.h"
+ #include "build/build_config.h"
  
 +#if defined(LIBC_GLIBC)
 +extern "C" {
 +extern void *__libc_malloc(size_t size);
++extern void *__libc_free(void *ptr);
 +}
 +#endif
 +
  namespace base {
  
- size_t g_oom_size = 0U;
---- a/base/process/memory_linux.cc	2020-08-30 14:18:35.401132593 -0400
-+++ b/base/process/memory_linux.cc	2020-08-30 14:19:08.030199189 -0400
-@@ -141,7 +141,7 @@
-     (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC))
+ namespace {
+@@ -111,7 +118,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
    *result = malloc(size);
- #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)
+ #elif defined(LIBC_GLIBC)
 -  *result = __libc_malloc(size);
 +  *result = ::__libc_malloc(size);
- #elif BUILDFLAG(USE_TCMALLOC)
-   *result = tc_malloc_skip_new_handler(size);
  #endif
+   return *result != nullptr;
+ }
+@@ -122,7 +129,7 @@
+ #elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR) || !defined(LIBC_GLIBC)
+   free(ptr);
+ #elif defined(LIBC_GLIBC)
+-  __libc_free(ptr);
++  ::__libc_free(ptr);
+ #endif
+ }
+ 
diff --git a/srcpkgs/chromium/patches/musl-stat.patch b/srcpkgs/chromium/patches/musl-stat.patch
index 427be1a3f4c2..b25e3c062172 100644
--- a/srcpkgs/chromium/patches/musl-stat.patch
+++ b/srcpkgs/chromium/patches/musl-stat.patch
@@ -3,10 +3,10 @@
 @@ -19,7 +19,8 @@
  #include "build/build_config.h"
  
- #if defined(OS_BSD) || defined(OS_APPLE) || defined(OS_NACL) || \
--    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21)
-+    defined(OS_FUCHSIA) || (defined(OS_ANDROID) && __ANDROID_API__ < 21) || \
-+    (defined(OS_LINUX) && !defined(__GLIBC__))
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+-    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++    BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++    (BUILDFLAG(IS_LINUX) && !defined(__GLIBC__))
  struct stat;
  namespace base {
  typedef struct stat stat_wrapper_t;
diff --git a/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
new file mode 100644
index 000000000000..00344073f461
--- /dev/null
+++ b/srcpkgs/chromium/patches/remove-sys-cdefs-includes.patch
@@ -0,0 +1,39 @@
+--- a/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
++++ b/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+@@ -17,8 +17,6 @@
+ 
+ #include_next <sys/ptrace.h>
+ 
+-#include <sys/cdefs.h>
+-
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=22433
+ #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \
+     defined(__GLIBC__)
+--- a/third_party/libsync/src/include/sync/sync.h
++++ b/third_party/libsync/src/include/sync/sync.h
+@@ -19,12 +19,13 @@
+ #ifndef __SYS_CORE_SYNC_H
+ #define __SYS_CORE_SYNC_H
+ 
+-#include <sys/cdefs.h>
+ #include <stdint.h>
+ 
+ #include <linux/types.h>
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ struct sync_legacy_merge_data {
+  int32_t fd2;
+@@ -158,6 +159,8 @@
+                                   struct sync_pt_info *itr);
+ void sync_fence_info_free(struct sync_fence_info_data *info);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif /* __SYS_CORE_SYNC_H */
diff --git a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
index 9e3b07920f17..2cdbd02a8269 100644
--- a/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
+++ b/srcpkgs/chromium/patches/use-FT_Done_MM_Var-in-CFX_Font-AdjustMMParams.patch
@@ -1,4 +1,4 @@
-From cb0aad687f34629a42053d600cf2947282cea2c0 Mon Sep 17 00:00:00 2001
+From ffeb67faf715475f6e463d65c368f556780adf19 Mon Sep 17 00:00:00 2001
 From: Lei Zhang <thestig@chromium.org>
 Date: Mon, 31 Jan 2022 22:42:35 +0000
 Subject: [PATCH] Use FT_Done_MM_Var() in CFX_Font::AdjustMMParams() when
@@ -12,17 +12,15 @@ Change-Id: I044540893103921fc64cdd53fcd628cfebf2c9db
 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/90130
 Reviewed-by: Nigi <nigi@chromium.org>
 Commit-Queue: Lei Zhang <thestig@chromium.org>
-
-(cherry picked from commit ffeb67faf715475f6e463d65c368f556780adf19)
 ---
  core/fxge/cfx_font.cpp | 28 ++++++++++++++++++++++++++--
  1 file changed, 26 insertions(+), 2 deletions(-)
 
 diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
-index 7a4e8eb24..0ef421fe7 100644
+index c08fe9608..8b3a72700 100644
 --- a/third_party/pdfium/core/fxge/cfx_font.cpp
 +++ b/third_party/pdfium/core/fxge/cfx_font.cpp
-@@ -43,6 +43,30 @@ struct OUTLINE_PARAMS {
+@@ -44,6 +44,30 @@ struct OUTLINE_PARAMS {
    float m_CoordUnit;
  };
  
@@ -31,12 +29,12 @@ index 7a4e8eb24..0ef421fe7 100644
 +// FT_Done_MM_Var() directly.
 +//
 +// Use weak symbols to check if FT_Done_MM_Var() is available at runtime.
-+#if !defined(OS_WIN)
++#if !BUILDFLAG(IS_WIN)
 +extern "C" __attribute__((weak)) decltype(FT_Done_MM_Var) FT_Done_MM_Var;
 +#endif
 +
 +void FreeMMVar(FXFT_FaceRec* rec, FXFT_MM_VarPtr variation_desc) {
-+#if defined(OS_WIN)
++#if BUILDFLAG(IS_WIN)
 +  // Assume `use_system_freetype` GN var is never set on Windows.
 +  constexpr bool has_ft_done_mm_var_func = true;
 +#else
@@ -50,19 +48,20 @@ index 7a4e8eb24..0ef421fe7 100644
 +  }
 +}
 +
- #ifdef PDF_ENABLE_XFA
- unsigned long FTStreamRead(FXFT_StreamRec* stream,
-                            unsigned long offset,
-@@ -640,14 +664,14 @@ void CFX_Font::AdjustMMParams(int glyph_index,
-     int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
-                     FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
+ FX_RECT FXRectFromFTPos(FT_Pos left, FT_Pos top, FT_Pos right, FT_Pos bottom) {
+   return FX_RECT(pdfium::base::checked_cast<int32_t>(left),
+                  pdfium::base::checked_cast<int32_t>(top),
+@@ -645,7 +669,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+     FT_Pos max_width = FXFT_Get_Glyph_HoriAdvance(m_Face->GetRec()) * 1000 /
+                        FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
      if (max_width == min_width) {
 -      FXFT_Free(m_Face->GetRec(), pMasters);
 +      FreeMMVar(m_Face->GetRec(), pMasters);
        return;
      }
-     int param = min_param + (max_param - min_param) * (dest_width - min_width) /
-                                 (max_width - min_width);
+     FT_Pos param = min_param + (max_param - min_param) *
+@@ -653,7 +677,7 @@ void CFX_Font::AdjustMMParams(int glyph_index,
+                                    (max_width - min_width);
      coords[1] = param;
    }
 -  FXFT_Free(m_Face->GetRec(), pMasters);
diff --git a/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 000000000000..32957d32fa37
--- /dev/null
+++ b/srcpkgs/chromium/patches/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+     scoped_refptr<base::SequencedTaskRunner> task_runner) {
+   if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+     return nullptr;
+-  // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+-  // we'll create a real platform encoder here.
+-  auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+-  auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+-      {base::TaskPriority::USER_BLOCKING});
+-  return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+-                                                  std::move(encoding_runner),
+-                                                  std::move(task_runner));
++  return nullptr;
+ }
+ 
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/srcpkgs/chromium/patches/webrtc-include.patch b/srcpkgs/chromium/patches/webrtc-include.patch
deleted file mode 100644
index 4110bef17957..000000000000
--- a/srcpkgs/chromium/patches/webrtc-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:24.488058990 +0100
-+++ b/third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc	2019-02-21 21:21:36.151961064 +0100
-@@ -16,6 +16,7 @@
- 
- #include <memory>
- #include <string>
-+#include <string.h>
- #include <utility>
- 
- #include "modules/desktop_capture/desktop_frame.h"
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
index 3ec4f0225a82..ae5326ca653c 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-4k-pages.patch
@@ -17,8 +17,8 @@ index bfd5753..045082b 100644
  
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PageAllocationGranularityShift() {
--#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
-+#if defined(OS_WIN)
+-#if BUILDFLAG(IS_WIN) || defined(ARCH_CPU_PPC64)
++#if BUILDFLAG(IS_WIN)
    // Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
    // sizes.  Since 64kB is the de facto standard on the platform and binaries
    // compiled for 64kB are likely to work on 4kB systems, 64kB is a good choice
@@ -35,7 +35,7 @@ index 0b9260d..3e054ec 100644
 -PartitionPageShift() {
 -  return 18;  // 256 KiB
 -}
- #elif defined(OS_APPLE) && defined(ARCH_CPU_64_BITS)
+ #elif BUILDFLAG(IS_APPLE) && defined(ARCH_CPU_64_BITS)
  PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
  PartitionPageShift() {
 diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h
diff --git a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
index 7b5c4a4360a4..b95e58c834b1 100644
--- a/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
+++ b/srcpkgs/chromium/patches/xxx-ppc64le-support.patch
@@ -232,44 +232,43 @@ diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.c
 index 2a97d3916..8e81aa6cf 100644
 --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-14 14:41:08.000000000 -0400
 +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2021-04-15 13:17:57.808715733 -0400
-@@ -40,7 +40,8 @@
- #include <sys/ptrace.h>
- #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
-     !defined(__arm__) && !defined(__aarch64__) &&           \
+@@ -37,7 +37,8 @@
+ 
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+     !defined(__arm__) && !defined(__aarch64__) &&             \
 -    !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(PTRACE_GET_THREAD_AREA) &&			    \
++    !defined(PTRACE_GET_THREAD_AREA) &&                       \
 +    !defined(__powerpc64__)
  // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
  // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
  // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
-@@ -49,6 +50,11 @@
+@@ -45,6 +46,11 @@
+ #include <asm/ptrace-abi.h>
  #endif
- #endif  // !OS_NACL_NONSFI
  
 +// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
 +#ifdef __powerpc64__
 +#include <termios.h>
 +#endif
 +
- #if defined(OS_ANDROID)
+ #if BUILDFLAG(IS_ANDROID)
  
  #if !defined(F_DUPFD_CLOEXEC)
-@@ -98,6 +104,15 @@
- #endif
- }
- 
+@@ -99,6 +105,14 @@
+   return true;
+ #else
+   return false;
++#endif
++}
++
 +inline bool IsArchitecturePPC64() {
 +#if defined(__powerpc64__)
 +  return true;
 +#else
 +  return false;
-+#endif
-+}
-+
-+
- // Ubuntu's version of glibc has a race condition in sem_post that can cause
- // it to call futex(2) with bogus op arguments. To workaround this, we need
- // to allow those futex(2) calls to fail with EINVAL, instead of crashing the
+ #endif
+ }
+ 
 @@ -239,6 +254,8 @@
    uint64_t kOLargeFileFlag = O_LARGEFILE;
    if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
@@ -3447,14 +3446,14 @@ index 9b065bd..df3af02 100644
 --- a/third_party/libaom/BUILD.gn
 +++ b/third_party/libaom/BUILD.gn
 @@ -36,6 +36,8 @@ if (enable_libaom) {
-     } else {
-       cpu_arch_full = "arm"
-     }
-+  } else if (current_cpu == "ppc64") {
-+    cpu_arch_full = "generic"
    } else {
-     cpu_arch_full = current_cpu
+     cpu_arch_full = "arm"
    }
++} else if (current_cpu == "ppc64") {
++  cpu_arch_full = "generic"
+ } else {
+   cpu_arch_full = current_cpu
+ }
 diff --git a/third_party/libgav1/options.gni b/third_party/libgav1/options.gni
 index 11af801..4b13d05 100644
 --- a/third_party/libgav1/options.gni
diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template
index 92c48e550599..2708747046d7 100644
--- a/srcpkgs/chromium/template
+++ b/srcpkgs/chromium/template
@@ -1,7 +1,7 @@
 # Template file for 'chromium'
 pkgname=chromium
 # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version
-version=98.0.4758.102
+version=99.0.4844.51
 revision=1
 archs="i686* x86_64* aarch64* armv7l* ppc64le*"
 short_desc="Google's attempt at creating a safer, faster, and more stable browser"
@@ -9,7 +9,7 @@ maintainer="Duncaen <duncaen@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://www.chromium.org/"
 distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz"
-checksum=415b47e912766cd07f9f52e95bc6470b835acf1d6f566ae32e66ba8be608f33e
+checksum=97c52e57eca0dc8b752d274047f38c88aaa86036c0587b26b056efbd3fb2bae3
 
 lib32disabled=yes
 
@@ -205,7 +205,6 @@ do_configure() {
 
 	conf=(
 		'enable_nacl=false'
-		'enable_nacl_nonsfi=false'
 
 		'use_sysroot=false'
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Merged]: chromium: update to 99.0.4844.51.
  2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
                   ` (5 preceding siblings ...)
  2022-03-04 14:09 ` Duncaen
@ 2022-03-07 15:43 ` q66
  6 siblings, 0 replies; 8+ messages in thread
From: q66 @ 2022-03-07 15:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There's a merged pull request on the void-packages repository

chromium: update to 99.0.4844.51.
https://github.com/void-linux/void-packages/pull/35937

Description:
[ci skip]

* [x] x86_64-glibc
* [x] x86_64-musl
* [x] aarch64-musl
* [x] i686-glibc

musl patches probably still need some work this time.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-07 15:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03  1:58 [PR PATCH] chromium: update to 99.0.4844.51 Duncaen
2022-03-03 15:52 ` [PR PATCH] [Updated] " Duncaen
2022-03-03 16:45 ` Duncaen
2022-03-03 17:27 ` Duncaen
2022-03-03 19:54 ` Duncaen
2022-03-03 22:54 ` Duncaen
2022-03-04 14:09 ` Duncaen
2022-03-07 15:43 ` [PR PATCH] [Merged]: " q66

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).