Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] qt5 uptade to 5.14.0
@ 2019-10-10 23:27 voidlinux-github
  2019-10-15 11:21 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (33 more replies)
  0 siblings, 34 replies; 35+ messages in thread
From: voidlinux-github @ 2019-10-10 23:27 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 uptade to 5.14.0
# Tested on
- [x] x86_64
- [ ] x86_64-musl
- [ ] i686
- [ ] armv7l-musl
- [ ] armv7l
- [ ] armv6l-musl
- [ ] armv6l
- [ ] aarch64-musl
- [ ] aarch64

# TODO:

- fix cross
- split qt5-webengine
- rebase webengine ppc patches @q66 
- musl things (?)
- more things


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 318508 bytes --]

From f2e830a7647aa9816e4c48dec7c8c40542a6e769 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 1/2] qt5: update to 5.14.0beta1.

---
 common/shlibs                                 |    3 +
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0042-arm-void-is-not-android.patch        |   18 +-
 .../qt5/patches/0044-qt-musl-execinfo.patch   |   13 -
 srcpkgs/qt5/patches/0050-pulse-stubs.patch    |   49 -
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../0100-qt5-webengine-linux-5.2.patch        |   42 +
 srcpkgs/qt5/patches/0100-qtbug-77364.patch    |   26 -
 .../0101-qt5-webengine-system-icu.patch       |   32 +
 srcpkgs/qt5/template                          |    9 +-
 15 files changed, 96 insertions(+), 7567 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0050-pulse-stubs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 create mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-qtbug-77364.patch
 create mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch

diff --git a/common/shlibs b/common/shlibs
index 688275b7d9e..89c78d2d06a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1849,6 +1849,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1861,6 +1862,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
index b13290d3ccd..76de3dd5832 100644
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
@@ -1,13 +1,23 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-10 18:16:05.910690056 +0200
+@@ -16,9 +16,6 @@
+     if (arm_use_neon) {
+       # Enable build-time NEON selection.
+       defines = [ "DL_ARM_NEON" ]
+-    } else if (arm_optionally_use_neon) {
+-      # Enable run-time NEON selection.
+-      defines = [ "DL_ARM_NEON_OPTIONAL" ]
+     }
+   } else if (current_cpu == "arm64") {
+     # Enable build-time NEON selection.
+@@ -206,18 +203,6 @@
        "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
        "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
      ]
 -    if (arm_optionally_use_neon) {
 -      # Run-time NEON detection.
 -      deps = [
--        "//third_party/android_tools:cpu_features",
+-        "//third_party/android_sdk:cpu_features",
 -      ]
 -
 -      # To get the __android_log_print routine
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
index 98f3a38745a..c1cdb537212 100644
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
@@ -92,16 +92,3 @@
      !defined(OS_AIX)
    if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0050-pulse-stubs.patch b/srcpkgs/qt5/patches/0050-pulse-stubs.patch
deleted file mode 100644
index c4f0fae86ee..00000000000
--- a/srcpkgs/qt5/patches/0050-pulse-stubs.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Pulse changed API in a recent update and these need to be fixed
-in order to avoid build errors.
-
---- qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-+++ qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-@@ -24,11 +24,11 @@ pa_operation* pa_context_get_source_info_by_index(pa_context* c, uint32_t idx, p
- pa_operation* pa_context_get_source_info_by_name(pa_context* c, const char* name, pa_source_info_cb_t cb, void *userdata);
- pa_operation* pa_context_get_source_info_list(pa_context* c, pa_source_info_cb_t cb, void* userdata);
- pa_operation* pa_context_get_sink_info_list(pa_context* c, pa_sink_info_cb_t cb, void* userdata);
--pa_context_state_t pa_context_get_state(pa_context* c);
-+pa_context_state_t pa_context_get_state(const pa_context* c);
- pa_context* pa_context_new(pa_mainloop_api* mainloop, const char* name);
- pa_operation* pa_context_set_source_volume_by_index(pa_context* c, uint32_t idx, const pa_cvolume* volume, pa_context_success_cb_t cb, void* userdata);
- void pa_context_set_state_callback(pa_context* c, pa_context_notify_cb_t cb, void* userdata);
--pa_operation_state_t pa_operation_get_state(pa_operation* o);
-+pa_operation_state_t pa_operation_get_state(const pa_operation* o);
- void pa_context_unref(pa_context* c);
- void pa_operation_unref(pa_operation* o);
- int pa_stream_begin_write(pa_stream* p, void** data, size_t* nbytes);
-@@ -38,23 +38,23 @@ pa_operation* pa_stream_cork(pa_stream* s, int b, pa_stream_success_cb_t cb, voi
- int pa_stream_disconnect(pa_stream* s);
- int pa_stream_drop(pa_stream *p);
- pa_operation* pa_stream_flush(pa_stream* s, pa_stream_success_cb_t cb, void* userdata);
--uint32_t pa_stream_get_device_index(pa_stream* s);
-+uint32_t pa_stream_get_device_index(const pa_stream* s);
- int pa_stream_get_latency(pa_stream* s, pa_usec_t* r_usec, int* negative);
--pa_stream_state_t pa_stream_get_state(pa_stream* p);
-+pa_stream_state_t pa_stream_get_state(const pa_stream* p);
- pa_stream* pa_stream_new(pa_context*  c, const char*  name, const pa_sample_spec*  ss, const pa_channel_map *  map);
- pa_stream* pa_stream_new_with_proplist(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map* map, pa_proplist* p);
- pa_proplist* pa_proplist_new(void);
--int pa_proplist_contains(pa_proplist* p, const char* key);
-+int pa_proplist_contains(const pa_proplist* p, const char* key);
- void pa_proplist_free(pa_proplist* p);
--const char* pa_proplist_gets(pa_proplist* p, const char* key);
-+const char* pa_proplist_gets(const pa_proplist* p, const char* key);
- int pa_proplist_sets(pa_proplist* p, const char* key, const char* value);
--size_t pa_stream_readable_size(pa_stream *p);
-+size_t pa_stream_readable_size(const pa_stream *p);
- int pa_stream_peek(pa_stream* p, const void** data, size_t* nbytes);
- void pa_stream_set_read_callback(pa_stream* p, pa_stream_request_cb_t cb, void* userdata);
- void pa_stream_set_state_callback(pa_stream* s, pa_stream_notify_cb_t cb, void* userdata);
- int pa_stream_write(pa_stream* p, const void* data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
- void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
- void pa_stream_unref(pa_stream* s);
--int pa_context_errno(pa_context *c);
-+int pa_context_errno(const pa_context *c);
- const char* pa_strerror(int error);
- pa_cvolume* pa_cvolume_set(pa_cvolume* a, unsigned  channels, pa_volume_t v);
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..d53915f117b
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/patches/0100-qtbug-77364.patch b/srcpkgs/qt5/patches/0100-qtbug-77364.patch
deleted file mode 100644
index 5a3629bf0b7..00000000000
--- a/srcpkgs/qt5/patches/0100-qtbug-77364.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From c09cf578bd7267b867326101cd2d0f39e7c814fe Mon Sep 17 00:00:00 2001
-From: David Faure <david.faure@kdab.com>
-Date: Mon, 09 Sep 2019 18:12:26 +0200
-Subject: [PATCH] QWidget::setFocusProxy: adjust focus widget properly
-
-My commit 3e7463411e adjusted the focus widget by setting
-QApplicationPrivate::focus_widget directly, while there is a method for
-doing this properly, including setFocus_sys() and emitting signals.
-
-Fixes: QTBUG-77364
-Change-Id: I218acf7a9de39173d282ced46def4f65594f80b4
----
-
-diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
-index cf5a81c..6889c2e 100644
---- qtbase/src/widgets/kernel/qwidget.cpp
-+++ qtbase/src/widgets/kernel/qwidget.cpp
-@@ -6204,7 +6204,7 @@
- 
-     if (changingAppFocusWidget) {
-         QWidget *newDeepestFocusProxy = d_func()->deepestFocusProxy();
--        QApplicationPrivate::focus_widget = newDeepestFocusProxy ? newDeepestFocusProxy : this;
-+        QApplicationPrivate::setFocusWidget(newDeepestFocusProxy ? newDeepestFocusProxy : this, Qt::NoFocusReason);
-     }
- }
- 
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..8f6b9db6afe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 0b74add5101..912f335258b 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,8 +1,8 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.1
+version=5.14.0beta1
 revision=1
-wrksrc="qt-everywhere-src-${version}"
+wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
  protobuf python re2c ruby"
@@ -20,8 +20,8 @@ short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
-distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
+checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
@@ -413,6 +413,7 @@ do_configure() {
 
 do_build() {
 	export NINJAJOBS=${makejobs}
+	export NINJAJOBS=-j4
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes

From f773bb42592ca55e180dafa967db92ecea68121c Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 2/2] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index be11cde6cfb..b2832680f75 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=1.8.15
-revision=1
+revision=2
 _libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9
 _GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
 _variant_commit=550ac2f159ca883d360c196149b466955c77a573
@@ -18,7 +18,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  $(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.1<5.13.2"
+depends="qt5-imageformats qt5>=5.14.0beta1<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"

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

* Re: [PR PATCH] [Updated] [WIP] qt5 uptade to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
@ 2019-10-15 11:21 ` voidlinux-github
  2019-10-15 11:21 ` voidlinux-github
                   ` (32 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2019-10-15 11:21 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 uptade to 5.14.0
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled without webengine)
- [x] i686 (compiled)
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [x] armv6l (compiled without webengine)
- [x] aarch64-musl (compiled without webengine)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross
- split qt5-webengine
- rebase webengine ppc patches @q66 
- musl things (?)
- more things
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- visual bugs with KDE Plasma (e.g. logout/shutdown screen borked)


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 342584 bytes --]

From 5917394316ec1c5458e163238582a4ac01595bca Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 1/7] qt5: update to 5.14.0beta1.

---
 common/shlibs                                 |    3 +
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0042-arm-void-is-not-android.patch        |   18 +-
 .../qt5/patches/0044-qt-musl-execinfo.patch   |   13 -
 srcpkgs/qt5/patches/0050-pulse-stubs.patch    |   49 -
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../0100-qt5-webengine-linux-5.2.patch        |   42 +
 srcpkgs/qt5/patches/0100-qtbug-77364.patch    |   26 -
 .../0101-qt5-webengine-system-icu.patch       |   32 +
 srcpkgs/qt5/template                          |    9 +-
 15 files changed, 96 insertions(+), 7567 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0050-pulse-stubs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 create mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-qtbug-77364.patch
 create mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch

diff --git a/common/shlibs b/common/shlibs
index 5d5fe02cf6a..5b6c52c366a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1849,6 +1849,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1861,6 +1862,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
index b13290d3ccd..76de3dd5832 100644
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
@@ -1,13 +1,23 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-10 18:16:05.910690056 +0200
+@@ -16,9 +16,6 @@
+     if (arm_use_neon) {
+       # Enable build-time NEON selection.
+       defines = [ "DL_ARM_NEON" ]
+-    } else if (arm_optionally_use_neon) {
+-      # Enable run-time NEON selection.
+-      defines = [ "DL_ARM_NEON_OPTIONAL" ]
+     }
+   } else if (current_cpu == "arm64") {
+     # Enable build-time NEON selection.
+@@ -206,18 +203,6 @@
        "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
        "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
      ]
 -    if (arm_optionally_use_neon) {
 -      # Run-time NEON detection.
 -      deps = [
--        "//third_party/android_tools:cpu_features",
+-        "//third_party/android_sdk:cpu_features",
 -      ]
 -
 -      # To get the __android_log_print routine
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
index 98f3a38745a..c1cdb537212 100644
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
@@ -92,16 +92,3 @@
      !defined(OS_AIX)
    if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0050-pulse-stubs.patch b/srcpkgs/qt5/patches/0050-pulse-stubs.patch
deleted file mode 100644
index c4f0fae86ee..00000000000
--- a/srcpkgs/qt5/patches/0050-pulse-stubs.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Pulse changed API in a recent update and these need to be fixed
-in order to avoid build errors.
-
---- qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-+++ qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-@@ -24,11 +24,11 @@ pa_operation* pa_context_get_source_info_by_index(pa_context* c, uint32_t idx, p
- pa_operation* pa_context_get_source_info_by_name(pa_context* c, const char* name, pa_source_info_cb_t cb, void *userdata);
- pa_operation* pa_context_get_source_info_list(pa_context* c, pa_source_info_cb_t cb, void* userdata);
- pa_operation* pa_context_get_sink_info_list(pa_context* c, pa_sink_info_cb_t cb, void* userdata);
--pa_context_state_t pa_context_get_state(pa_context* c);
-+pa_context_state_t pa_context_get_state(const pa_context* c);
- pa_context* pa_context_new(pa_mainloop_api* mainloop, const char* name);
- pa_operation* pa_context_set_source_volume_by_index(pa_context* c, uint32_t idx, const pa_cvolume* volume, pa_context_success_cb_t cb, void* userdata);
- void pa_context_set_state_callback(pa_context* c, pa_context_notify_cb_t cb, void* userdata);
--pa_operation_state_t pa_operation_get_state(pa_operation* o);
-+pa_operation_state_t pa_operation_get_state(const pa_operation* o);
- void pa_context_unref(pa_context* c);
- void pa_operation_unref(pa_operation* o);
- int pa_stream_begin_write(pa_stream* p, void** data, size_t* nbytes);
-@@ -38,23 +38,23 @@ pa_operation* pa_stream_cork(pa_stream* s, int b, pa_stream_success_cb_t cb, voi
- int pa_stream_disconnect(pa_stream* s);
- int pa_stream_drop(pa_stream *p);
- pa_operation* pa_stream_flush(pa_stream* s, pa_stream_success_cb_t cb, void* userdata);
--uint32_t pa_stream_get_device_index(pa_stream* s);
-+uint32_t pa_stream_get_device_index(const pa_stream* s);
- int pa_stream_get_latency(pa_stream* s, pa_usec_t* r_usec, int* negative);
--pa_stream_state_t pa_stream_get_state(pa_stream* p);
-+pa_stream_state_t pa_stream_get_state(const pa_stream* p);
- pa_stream* pa_stream_new(pa_context*  c, const char*  name, const pa_sample_spec*  ss, const pa_channel_map *  map);
- pa_stream* pa_stream_new_with_proplist(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map* map, pa_proplist* p);
- pa_proplist* pa_proplist_new(void);
--int pa_proplist_contains(pa_proplist* p, const char* key);
-+int pa_proplist_contains(const pa_proplist* p, const char* key);
- void pa_proplist_free(pa_proplist* p);
--const char* pa_proplist_gets(pa_proplist* p, const char* key);
-+const char* pa_proplist_gets(const pa_proplist* p, const char* key);
- int pa_proplist_sets(pa_proplist* p, const char* key, const char* value);
--size_t pa_stream_readable_size(pa_stream *p);
-+size_t pa_stream_readable_size(const pa_stream *p);
- int pa_stream_peek(pa_stream* p, const void** data, size_t* nbytes);
- void pa_stream_set_read_callback(pa_stream* p, pa_stream_request_cb_t cb, void* userdata);
- void pa_stream_set_state_callback(pa_stream* s, pa_stream_notify_cb_t cb, void* userdata);
- int pa_stream_write(pa_stream* p, const void* data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
- void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
- void pa_stream_unref(pa_stream* s);
--int pa_context_errno(pa_context *c);
-+int pa_context_errno(const pa_context *c);
- const char* pa_strerror(int error);
- pa_cvolume* pa_cvolume_set(pa_cvolume* a, unsigned  channels, pa_volume_t v);
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..d53915f117b
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/patches/0100-qtbug-77364.patch b/srcpkgs/qt5/patches/0100-qtbug-77364.patch
deleted file mode 100644
index 5a3629bf0b7..00000000000
--- a/srcpkgs/qt5/patches/0100-qtbug-77364.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From c09cf578bd7267b867326101cd2d0f39e7c814fe Mon Sep 17 00:00:00 2001
-From: David Faure <david.faure@kdab.com>
-Date: Mon, 09 Sep 2019 18:12:26 +0200
-Subject: [PATCH] QWidget::setFocusProxy: adjust focus widget properly
-
-My commit 3e7463411e adjusted the focus widget by setting
-QApplicationPrivate::focus_widget directly, while there is a method for
-doing this properly, including setFocus_sys() and emitting signals.
-
-Fixes: QTBUG-77364
-Change-Id: I218acf7a9de39173d282ced46def4f65594f80b4
----
-
-diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
-index cf5a81c..6889c2e 100644
---- qtbase/src/widgets/kernel/qwidget.cpp
-+++ qtbase/src/widgets/kernel/qwidget.cpp
-@@ -6204,7 +6204,7 @@
- 
-     if (changingAppFocusWidget) {
-         QWidget *newDeepestFocusProxy = d_func()->deepestFocusProxy();
--        QApplicationPrivate::focus_widget = newDeepestFocusProxy ? newDeepestFocusProxy : this;
-+        QApplicationPrivate::setFocusWidget(newDeepestFocusProxy ? newDeepestFocusProxy : this, Qt::NoFocusReason);
-     }
- }
- 
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..8f6b9db6afe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 0b74add5101..912f335258b 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,8 +1,8 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.1
+version=5.14.0beta1
 revision=1
-wrksrc="qt-everywhere-src-${version}"
+wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
  protobuf python re2c ruby"
@@ -20,8 +20,8 @@ short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
-distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
+checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
@@ -413,6 +413,7 @@ do_configure() {
 
 do_build() {
 	export NINJAJOBS=${makejobs}
+	export NINJAJOBS=-j4
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes

From 11addb6b1925543d72dcd76e14fab55a26aa2418 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 2/7] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index be11cde6cfb..b2832680f75 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=1.8.15
-revision=1
+revision=2
 _libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9
 _GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
 _variant_commit=550ac2f159ca883d360c196149b466955c77a573
@@ -18,7 +18,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  $(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.1<5.13.2"
+depends="qt5-imageformats qt5>=5.14.0beta1<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"

From f6c98ebe833aab42479312f642522671f9a15720 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 19:17:17 +0200
Subject: [PATCH 3/7] fixup! qt5: update to 5.14.0beta1.

---
 .../0090-hard-disable-qmlchachegen.patch      | 10 ----
 srcpkgs/qt5/files/qmlcachegen.pro             | 40 ++++++++++++++++
 srcpkgs/qt5/files/qmllint.pro                 | 17 ++++++-
 srcpkgs/qt5/files/qttools_src.pro             | 18 ++++----
 srcpkgs/qt5/files/uic.pro                     |  1 +
 .../qt5/patches/0023-enable_tools-cross.patch | 46 -------------------
 ...does-it-find-canon-file-name-on-musl.patch | 11 +++++
 srcpkgs/qt5/template                          | 31 ++-----------
 8 files changed, 81 insertions(+), 93 deletions(-)
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 create mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b08facb22d1
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,40 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp \
+    resourcefilemapper.cpp
+TARGET = qmlcachegen
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
+
+HEADERS += \
+    resourcefilemapper.h
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 912f335258b..3d64a8964b6 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -30,15 +30,6 @@ desc_option_webengine="Build Chromium-based WebEngine component"
 
 makedepends+=" harfbuzz-devel"
 
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in
@@ -293,7 +284,6 @@ do_configure() {
 				-e '/#error Read the comment at this location/d'
 			;;
 		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -341,6 +331,7 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	# Rely on auto detection (fails if forced for cross builds)
 	if [ "$build_option_webengine" ]; then
 		# opts+=" -webengine-alsa"
@@ -381,25 +372,12 @@ do_configure() {
 			fi
 			;;
 		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
-		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
-		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
-		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		#cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
+		#cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
+		#cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -488,6 +466,7 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"

From 99e309d3bc06a5b0e9568e10274d3e0ea3c22e49 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 20:04:04 +0200
Subject: [PATCH 4/7] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 3d64a8964b6..c375d89842d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -4,15 +4,15 @@ version=5.14.0beta1
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
+hostmakedepends="cmake clang flex git glib-devel pkg-config
  protobuf python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
  libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -28,8 +28,6 @@ replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0
 build_options="webengine"
 desc_option_webengine="Build Chromium-based WebEngine component"
 
-makedepends+=" harfbuzz-devel"
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in

From 593c70809187518c68071b7133d613836a4d2a6e Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:18:54 +0200
Subject: [PATCH 5/7] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index c375d89842d..bee836700ff 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,14 +5,14 @@ revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel pkg-config
- protobuf python re2c ruby"
+ python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
  gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
  libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -388,12 +388,7 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
-	export NINJAJOBS=-j4
-	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
-	# is not yet ready when it is to be included. Repeating make works around that
-	# problem without having to resort to disable_parallel_build=yes
-	make ${makejobs} || make ${makejobs}
+	make ${makejobs}
 }
 
 do_install() {
@@ -615,7 +610,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 

From f8af0a8e135a1878c29d3e3afd1ef8c310e27502 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 6/7] New package: qt5-webengine

---
 srcpkgs/qt5-webengine                         |  1 -
 srcpkgs/qt5-webengine-devel                   |  2 +-
 .../patches/qt5-webengine-linux-5.2.patch     | 42 +++++++++
 .../patches/qt5-webengine-system-icu.patch    | 32 +++++++
 srcpkgs/qt5-webengine/template                | 90 +++++++++++++++++++
 5 files changed, 165 insertions(+), 2 deletions(-)
 delete mode 120000 srcpkgs/qt5-webengine
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-webengine
deleted file mode 120000
index 75793eb6664..00000000000
--- a/srcpkgs/qt5-webengine
+++ /dev/null
@@ -1 +0,0 @@
-qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..f8e0a38ba38
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..e3035b15400
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..ba5a5e26a1d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,90 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.0beta1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
+#create_wrksrc=yes
+#only_for_archs="i686 x86_64"
+build_style=qmake
+configure_args=" -- -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if webengine '' '-no')-webengine-v8-snapshot"
+#make_build_args=""
+#make_install_args=""
+#conf_files=""
+#make_dirs="/var/log/dir 0755 root root"
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+depends=""
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
+checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+
+build_options="snapshot"
+build_options_default="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel"
+fi
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+#	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+#	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+#	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+}
+
+pre_build() {
+	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		vmove usr/lib/qt5/plugins/designer
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 44d89cf25013f9deb587bc3c67f4ffa15b3cc97c Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:20:27 +0200
Subject: [PATCH 7/7] [tmp]: messing around with the qmake build_style

---
 common/build-style/qmake.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d4549dae099 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,15 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
+		${configure_args}
 }
 
 do_build() {

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

* Re: [PR PATCH] [Updated] [WIP] qt5 uptade to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
  2019-10-15 11:21 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-15 11:21 ` voidlinux-github
  2019-11-11 19:23 ` [PR PATCH] [Updated] [WIP] qt5 update " voidlinux-github
                   ` (31 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2019-10-15 11:21 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 uptade to 5.14.0
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled without webengine)
- [x] i686 (compiled)
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [x] armv6l (compiled without webengine)
- [x] aarch64-musl (compiled without webengine)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross
- split qt5-webengine
- rebase webengine ppc patches @q66 
- musl things (?)
- more things
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- visual bugs with KDE Plasma (e.g. logout/shutdown screen borked)


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 342584 bytes --]

From 5917394316ec1c5458e163238582a4ac01595bca Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 1/7] qt5: update to 5.14.0beta1.

---
 common/shlibs                                 |    3 +
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0042-arm-void-is-not-android.patch        |   18 +-
 .../qt5/patches/0044-qt-musl-execinfo.patch   |   13 -
 srcpkgs/qt5/patches/0050-pulse-stubs.patch    |   49 -
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../0100-qt5-webengine-linux-5.2.patch        |   42 +
 srcpkgs/qt5/patches/0100-qtbug-77364.patch    |   26 -
 .../0101-qt5-webengine-system-icu.patch       |   32 +
 srcpkgs/qt5/template                          |    9 +-
 15 files changed, 96 insertions(+), 7567 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0050-pulse-stubs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 create mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-qtbug-77364.patch
 create mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch

diff --git a/common/shlibs b/common/shlibs
index 5d5fe02cf6a..5b6c52c366a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1849,6 +1849,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1861,6 +1862,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
index b13290d3ccd..76de3dd5832 100644
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
@@ -1,13 +1,23 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-10 18:16:05.910690056 +0200
+@@ -16,9 +16,6 @@
+     if (arm_use_neon) {
+       # Enable build-time NEON selection.
+       defines = [ "DL_ARM_NEON" ]
+-    } else if (arm_optionally_use_neon) {
+-      # Enable run-time NEON selection.
+-      defines = [ "DL_ARM_NEON_OPTIONAL" ]
+     }
+   } else if (current_cpu == "arm64") {
+     # Enable build-time NEON selection.
+@@ -206,18 +203,6 @@
        "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
        "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
      ]
 -    if (arm_optionally_use_neon) {
 -      # Run-time NEON detection.
 -      deps = [
--        "//third_party/android_tools:cpu_features",
+-        "//third_party/android_sdk:cpu_features",
 -      ]
 -
 -      # To get the __android_log_print routine
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
index 98f3a38745a..c1cdb537212 100644
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
@@ -92,16 +92,3 @@
      !defined(OS_AIX)
    if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0050-pulse-stubs.patch b/srcpkgs/qt5/patches/0050-pulse-stubs.patch
deleted file mode 100644
index c4f0fae86ee..00000000000
--- a/srcpkgs/qt5/patches/0050-pulse-stubs.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Pulse changed API in a recent update and these need to be fixed
-in order to avoid build errors.
-
---- qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-+++ qtwebengine/src/3rdparty/chromium/media/audio/pulse/pulse.sigs
-@@ -24,11 +24,11 @@ pa_operation* pa_context_get_source_info_by_index(pa_context* c, uint32_t idx, p
- pa_operation* pa_context_get_source_info_by_name(pa_context* c, const char* name, pa_source_info_cb_t cb, void *userdata);
- pa_operation* pa_context_get_source_info_list(pa_context* c, pa_source_info_cb_t cb, void* userdata);
- pa_operation* pa_context_get_sink_info_list(pa_context* c, pa_sink_info_cb_t cb, void* userdata);
--pa_context_state_t pa_context_get_state(pa_context* c);
-+pa_context_state_t pa_context_get_state(const pa_context* c);
- pa_context* pa_context_new(pa_mainloop_api* mainloop, const char* name);
- pa_operation* pa_context_set_source_volume_by_index(pa_context* c, uint32_t idx, const pa_cvolume* volume, pa_context_success_cb_t cb, void* userdata);
- void pa_context_set_state_callback(pa_context* c, pa_context_notify_cb_t cb, void* userdata);
--pa_operation_state_t pa_operation_get_state(pa_operation* o);
-+pa_operation_state_t pa_operation_get_state(const pa_operation* o);
- void pa_context_unref(pa_context* c);
- void pa_operation_unref(pa_operation* o);
- int pa_stream_begin_write(pa_stream* p, void** data, size_t* nbytes);
-@@ -38,23 +38,23 @@ pa_operation* pa_stream_cork(pa_stream* s, int b, pa_stream_success_cb_t cb, voi
- int pa_stream_disconnect(pa_stream* s);
- int pa_stream_drop(pa_stream *p);
- pa_operation* pa_stream_flush(pa_stream* s, pa_stream_success_cb_t cb, void* userdata);
--uint32_t pa_stream_get_device_index(pa_stream* s);
-+uint32_t pa_stream_get_device_index(const pa_stream* s);
- int pa_stream_get_latency(pa_stream* s, pa_usec_t* r_usec, int* negative);
--pa_stream_state_t pa_stream_get_state(pa_stream* p);
-+pa_stream_state_t pa_stream_get_state(const pa_stream* p);
- pa_stream* pa_stream_new(pa_context*  c, const char*  name, const pa_sample_spec*  ss, const pa_channel_map *  map);
- pa_stream* pa_stream_new_with_proplist(pa_context* c, const char* name, const pa_sample_spec* ss, const pa_channel_map* map, pa_proplist* p);
- pa_proplist* pa_proplist_new(void);
--int pa_proplist_contains(pa_proplist* p, const char* key);
-+int pa_proplist_contains(const pa_proplist* p, const char* key);
- void pa_proplist_free(pa_proplist* p);
--const char* pa_proplist_gets(pa_proplist* p, const char* key);
-+const char* pa_proplist_gets(const pa_proplist* p, const char* key);
- int pa_proplist_sets(pa_proplist* p, const char* key, const char* value);
--size_t pa_stream_readable_size(pa_stream *p);
-+size_t pa_stream_readable_size(const pa_stream *p);
- int pa_stream_peek(pa_stream* p, const void** data, size_t* nbytes);
- void pa_stream_set_read_callback(pa_stream* p, pa_stream_request_cb_t cb, void* userdata);
- void pa_stream_set_state_callback(pa_stream* s, pa_stream_notify_cb_t cb, void* userdata);
- int pa_stream_write(pa_stream* p, const void* data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
- void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
- void pa_stream_unref(pa_stream* s);
--int pa_context_errno(pa_context *c);
-+int pa_context_errno(const pa_context *c);
- const char* pa_strerror(int error);
- pa_cvolume* pa_cvolume_set(pa_cvolume* a, unsigned  channels, pa_volume_t v);
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..d53915f117b
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/patches/0100-qtbug-77364.patch b/srcpkgs/qt5/patches/0100-qtbug-77364.patch
deleted file mode 100644
index 5a3629bf0b7..00000000000
--- a/srcpkgs/qt5/patches/0100-qtbug-77364.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From c09cf578bd7267b867326101cd2d0f39e7c814fe Mon Sep 17 00:00:00 2001
-From: David Faure <david.faure@kdab.com>
-Date: Mon, 09 Sep 2019 18:12:26 +0200
-Subject: [PATCH] QWidget::setFocusProxy: adjust focus widget properly
-
-My commit 3e7463411e adjusted the focus widget by setting
-QApplicationPrivate::focus_widget directly, while there is a method for
-doing this properly, including setFocus_sys() and emitting signals.
-
-Fixes: QTBUG-77364
-Change-Id: I218acf7a9de39173d282ced46def4f65594f80b4
----
-
-diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
-index cf5a81c..6889c2e 100644
---- qtbase/src/widgets/kernel/qwidget.cpp
-+++ qtbase/src/widgets/kernel/qwidget.cpp
-@@ -6204,7 +6204,7 @@
- 
-     if (changingAppFocusWidget) {
-         QWidget *newDeepestFocusProxy = d_func()->deepestFocusProxy();
--        QApplicationPrivate::focus_widget = newDeepestFocusProxy ? newDeepestFocusProxy : this;
-+        QApplicationPrivate::setFocusWidget(newDeepestFocusProxy ? newDeepestFocusProxy : this, Qt::NoFocusReason);
-     }
- }
- 
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..8f6b9db6afe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 0b74add5101..912f335258b 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,8 +1,8 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.1
+version=5.14.0beta1
 revision=1
-wrksrc="qt-everywhere-src-${version}"
+wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
  protobuf python re2c ruby"
@@ -20,8 +20,8 @@ short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
-distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
+checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
@@ -413,6 +413,7 @@ do_configure() {
 
 do_build() {
 	export NINJAJOBS=${makejobs}
+	export NINJAJOBS=-j4
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes

From 11addb6b1925543d72dcd76e14fab55a26aa2418 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 2/7] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index be11cde6cfb..b2832680f75 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=1.8.15
-revision=1
+revision=2
 _libtgvoip_commit=d4a0f719ffd8d29e88474f67abc9fc862661c3b9
 _GSL_commit=d846fe50a3f0bb7767c7e087a05f4be95f4da0ec
 _variant_commit=550ac2f159ca883d360c196149b466955c77a573
@@ -18,7 +18,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  $(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.1<5.13.2"
+depends="qt5-imageformats qt5>=5.14.0beta1<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"

From f6c98ebe833aab42479312f642522671f9a15720 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 19:17:17 +0200
Subject: [PATCH 3/7] fixup! qt5: update to 5.14.0beta1.

---
 .../0090-hard-disable-qmlchachegen.patch      | 10 ----
 srcpkgs/qt5/files/qmlcachegen.pro             | 40 ++++++++++++++++
 srcpkgs/qt5/files/qmllint.pro                 | 17 ++++++-
 srcpkgs/qt5/files/qttools_src.pro             | 18 ++++----
 srcpkgs/qt5/files/uic.pro                     |  1 +
 .../qt5/patches/0023-enable_tools-cross.patch | 46 -------------------
 ...does-it-find-canon-file-name-on-musl.patch | 11 +++++
 srcpkgs/qt5/template                          | 31 ++-----------
 8 files changed, 81 insertions(+), 93 deletions(-)
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 create mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b08facb22d1
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,40 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp \
+    resourcefilemapper.cpp
+TARGET = qmlcachegen
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
+
+HEADERS += \
+    resourcefilemapper.h
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 912f335258b..3d64a8964b6 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -30,15 +30,6 @@ desc_option_webengine="Build Chromium-based WebEngine component"
 
 makedepends+=" harfbuzz-devel"
 
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in
@@ -293,7 +284,6 @@ do_configure() {
 				-e '/#error Read the comment at this location/d'
 			;;
 		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -341,6 +331,7 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	# Rely on auto detection (fails if forced for cross builds)
 	if [ "$build_option_webengine" ]; then
 		# opts+=" -webengine-alsa"
@@ -381,25 +372,12 @@ do_configure() {
 			fi
 			;;
 		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
-		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
-		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
-		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		#cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
+		#cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
+		#cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -488,6 +466,7 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"

From 99e309d3bc06a5b0e9568e10274d3e0ea3c22e49 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 20:04:04 +0200
Subject: [PATCH 4/7] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 3d64a8964b6..c375d89842d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -4,15 +4,15 @@ version=5.14.0beta1
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
+hostmakedepends="cmake clang flex git glib-devel pkg-config
  protobuf python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
  libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -28,8 +28,6 @@ replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0
 build_options="webengine"
 desc_option_webengine="Build Chromium-based WebEngine component"
 
-makedepends+=" harfbuzz-devel"
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in

From 593c70809187518c68071b7133d613836a4d2a6e Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:18:54 +0200
Subject: [PATCH 5/7] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index c375d89842d..bee836700ff 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,14 +5,14 @@ revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel pkg-config
- protobuf python re2c ruby"
+ python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
  gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
  libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -388,12 +388,7 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
-	export NINJAJOBS=-j4
-	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
-	# is not yet ready when it is to be included. Repeating make works around that
-	# problem without having to resort to disable_parallel_build=yes
-	make ${makejobs} || make ${makejobs}
+	make ${makejobs}
 }
 
 do_install() {
@@ -615,7 +610,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 

From f8af0a8e135a1878c29d3e3afd1ef8c310e27502 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 6/7] New package: qt5-webengine

---
 srcpkgs/qt5-webengine                         |  1 -
 srcpkgs/qt5-webengine-devel                   |  2 +-
 .../patches/qt5-webengine-linux-5.2.patch     | 42 +++++++++
 .../patches/qt5-webengine-system-icu.patch    | 32 +++++++
 srcpkgs/qt5-webengine/template                | 90 +++++++++++++++++++
 5 files changed, 165 insertions(+), 2 deletions(-)
 delete mode 120000 srcpkgs/qt5-webengine
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-webengine
deleted file mode 120000
index 75793eb6664..00000000000
--- a/srcpkgs/qt5-webengine
+++ /dev/null
@@ -1 +0,0 @@
-qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..f8e0a38ba38
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..e3035b15400
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..ba5a5e26a1d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,90 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.0beta1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
+#create_wrksrc=yes
+#only_for_archs="i686 x86_64"
+build_style=qmake
+configure_args=" -- -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if webengine '' '-no')-webengine-v8-snapshot"
+#make_build_args=""
+#make_install_args=""
+#conf_files=""
+#make_dirs="/var/log/dir 0755 root root"
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+depends=""
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
+checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+
+build_options="snapshot"
+build_options_default="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel"
+fi
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+#	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+#	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+#	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+}
+
+pre_build() {
+	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		vmove usr/lib/qt5/plugins/designer
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 44d89cf25013f9deb587bc3c67f4ffa15b3cc97c Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:20:27 +0200
Subject: [PATCH 7/7] [tmp]: messing around with the qmake build_style

---
 common/build-style/qmake.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d4549dae099 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,15 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
+		${configure_args}
 }
 
 do_build() {

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
  2019-10-15 11:21 ` [PR PATCH] [Updated] " voidlinux-github
  2019-10-15 11:21 ` voidlinux-github
@ 2019-11-11 19:23 ` voidlinux-github
  2019-11-12  0:23 ` voidlinux-github
                   ` (30 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2019-11-11 19:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled without webengine)
- [x] i686 (compiled)
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [x] armv6l (compiled without webengine)
- [x] aarch64-musl (compiled without webengine)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross
- split qt5-webengine
- rebase webengine ppc patches @q66 
- musl things (?)
- more things
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- visual bugs with KDE Plasma (e.g. logout/shutdown screen borked)
- force build qt5-designer for cross again

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 422674 bytes --]

From 7585635f67495db8316d34a51abe2c46585ec718 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 01/11] qt5: update to 5.14.0beta1.

---
 common/shlibs                                 |    3 +
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0042-arm-void-is-not-android.patch        |   18 +-
 .../qt5/patches/0044-qt-musl-execinfo.patch   |   13 -
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../0100-qt5-webengine-linux-5.2.patch        |   42 +
 .../0101-qt5-webengine-system-icu.patch       |   32 +
 srcpkgs/qt5/template                          |    9 +-
 13 files changed, 96 insertions(+), 7492 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 create mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch

diff --git a/common/shlibs b/common/shlibs
index 75e5418b687..66a2e9b39d5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1858,6 +1858,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1870,6 +1871,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
index b13290d3ccd..76de3dd5832 100644
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
@@ -1,13 +1,23 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-10 18:16:05.910690056 +0200
+@@ -16,9 +16,6 @@
+     if (arm_use_neon) {
+       # Enable build-time NEON selection.
+       defines = [ "DL_ARM_NEON" ]
+-    } else if (arm_optionally_use_neon) {
+-      # Enable run-time NEON selection.
+-      defines = [ "DL_ARM_NEON_OPTIONAL" ]
+     }
+   } else if (current_cpu == "arm64") {
+     # Enable build-time NEON selection.
+@@ -206,18 +203,6 @@
        "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
        "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
      ]
 -    if (arm_optionally_use_neon) {
 -      # Run-time NEON detection.
 -      deps = [
--        "//third_party/android_tools:cpu_features",
+-        "//third_party/android_sdk:cpu_features",
 -      ]
 -
 -      # To get the __android_log_print routine
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
index 98f3a38745a..c1cdb537212 100644
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
@@ -92,16 +92,3 @@
      !defined(OS_AIX)
    if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..d53915f117b
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..8f6b9db6afe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 8c62762e47a..912f335258b 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,8 +1,8 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
+version=5.14.0beta1
 revision=1
-wrksrc="qt-everywhere-src-${version}"
+wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
  protobuf python re2c ruby"
@@ -20,8 +20,8 @@ short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
-distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
+checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
@@ -413,6 +413,7 @@ do_configure() {
 
 do_build() {
 	export NINJAJOBS=${makejobs}
+	export NINJAJOBS=-j4
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes

From 7059f8b69707576a18b124b4f1e811da449d8fa9 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 02/11] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index cab544c532b..89ae4282bdb 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -18,7 +18,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  $(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5>=5.14.0beta2<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"

From 87949508182d9d18c77551cab34ac6b3f26153fc Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 19:17:17 +0200
Subject: [PATCH 03/11] fixup! qt5: update to 5.14.0beta1.

---
 .../0090-hard-disable-qmlchachegen.patch      | 10 ----
 srcpkgs/qt5/files/qmlcachegen.pro             | 40 ++++++++++++++++
 srcpkgs/qt5/files/qmllint.pro                 | 17 ++++++-
 srcpkgs/qt5/files/qttools_src.pro             | 18 ++++----
 srcpkgs/qt5/files/uic.pro                     |  1 +
 .../qt5/patches/0023-enable_tools-cross.patch | 46 -------------------
 ...does-it-find-canon-file-name-on-musl.patch | 11 +++++
 srcpkgs/qt5/template                          | 31 ++-----------
 8 files changed, 81 insertions(+), 93 deletions(-)
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 create mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b08facb22d1
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,40 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp \
+    resourcefilemapper.cpp
+TARGET = qmlcachegen
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
+
+HEADERS += \
+    resourcefilemapper.h
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 912f335258b..3d64a8964b6 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -30,15 +30,6 @@ desc_option_webengine="Build Chromium-based WebEngine component"
 
 makedepends+=" harfbuzz-devel"
 
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in
@@ -293,7 +284,6 @@ do_configure() {
 				-e '/#error Read the comment at this location/d'
 			;;
 		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -341,6 +331,7 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	# Rely on auto detection (fails if forced for cross builds)
 	if [ "$build_option_webengine" ]; then
 		# opts+=" -webengine-alsa"
@@ -381,25 +372,12 @@ do_configure() {
 			fi
 			;;
 		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
-		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
-		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
-		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		#cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
+		#cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
+		#cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -488,6 +466,7 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"

From bc5cc337f6fbc830c0c1bbb1b0618f9da8c31789 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 20:04:04 +0200
Subject: [PATCH 04/11] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 3d64a8964b6..c375d89842d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -4,15 +4,15 @@ version=5.14.0beta1
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
+hostmakedepends="cmake clang flex git glib-devel pkg-config
  protobuf python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
  libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -28,8 +28,6 @@ replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0
 build_options="webengine"
 desc_option_webengine="Build Chromium-based WebEngine component"
 
-makedepends+=" harfbuzz-devel"
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in

From 822868158e0865b8d17c407ea7a7914d551985dc Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:18:54 +0200
Subject: [PATCH 05/11] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index c375d89842d..bee836700ff 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,14 +5,14 @@ revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel pkg-config
- protobuf python re2c ruby"
+ python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
  gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
  libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -388,12 +388,7 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
-	export NINJAJOBS=-j4
-	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
-	# is not yet ready when it is to be included. Repeating make works around that
-	# problem without having to resort to disable_parallel_build=yes
-	make ${makejobs} || make ${makejobs}
+	make ${makejobs}
 }
 
 do_install() {
@@ -615,7 +610,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 

From 391edccc500a08da2997a680fa1d2ab6ad726c98 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 06/11] New package: qt5-webengine

---
 srcpkgs/qt5-webengine                         |  1 -
 srcpkgs/qt5-webengine-devel                   |  2 +-
 .../patches/qt5-webengine-linux-5.2.patch     | 42 +++++++++
 .../patches/qt5-webengine-system-icu.patch    | 32 +++++++
 srcpkgs/qt5-webengine/template                | 90 +++++++++++++++++++
 5 files changed, 165 insertions(+), 2 deletions(-)
 delete mode 120000 srcpkgs/qt5-webengine
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-webengine
deleted file mode 120000
index 75793eb6664..00000000000
--- a/srcpkgs/qt5-webengine
+++ /dev/null
@@ -1 +0,0 @@
-qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..f8e0a38ba38
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..e3035b15400
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..ba5a5e26a1d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,90 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.0beta1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
+#create_wrksrc=yes
+#only_for_archs="i686 x86_64"
+build_style=qmake
+configure_args=" -- -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if webengine '' '-no')-webengine-v8-snapshot"
+#make_build_args=""
+#make_install_args=""
+#conf_files=""
+#make_dirs="/var/log/dir 0755 root root"
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+depends=""
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
+checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+
+build_options="snapshot"
+build_options_default="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel"
+fi
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+#	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+#	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+#	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+}
+
+pre_build() {
+	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		vmove usr/lib/qt5/plugins/designer
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 6f70e4e4b91f700e9a1b0449a4d1896d79cb4f39 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:20:27 +0200
Subject: [PATCH 07/11] [tmp]: messing around with the qmake build_style

---
 common/build-style/qmake.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d4549dae099 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,15 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
+		${configure_args}
 }
 
 do_build() {

From 25dcd8129dae11b7de95f9b40545dd61b1393a26 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 14:12:11 +0100
Subject: [PATCH 08/11] Revert "[tmp]: messing around with the qmake
 build_style"

This reverts commit 6f70e4e4b91f700e9a1b0449a4d1896d79cb4f39.
---
 common/build-style/qmake.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index d4549dae099..63be5a3a568 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,15 +43,13 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} \
+	${qmake} ${qmake_args} ${configure_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}" \
-		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
-		${configure_args}
+		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From c7706f76cf9bd574cc583583e88cb2b030734145 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:14 +0100
Subject: [PATCH 09/11] qt5: update to 5.14.0beta2.

---
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 -------
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 -----
 .../patches/0004-musl-dispatch-to-musl.patch  | 103 ------------------
 .../qt5/patches/0008-musl-no-mallinfo.patch   |  31 ------
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |  10 --
 .../qt5/patches/0010-musl-pread-pwrite.patch  |  18 ---
 .../patches/0011-musl-replace-pvalloc.patch   |  14 ---
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |  26 -----
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |  18 ---
 .../qt5/patches/0017-musl-stackstart.patch    |  20 ----
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |  71 ------------
 ...0025-musl-chromium-default-stacksize.patch |  15 ---
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |  15 ---
 .../0032-musl-cross-no-asm_ptrace_h.patch     |  30 -----
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |  13 ---
 .../0042-arm-void-is-not-android.patch        |  31 ------
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  94 ----------------
 .../0045-qt-musl-thread-stacksize.patch       |  26 -----
 .../qt5/patches/0046-sandbox-membarrier.patch |  60 ----------
 .../qt5/patches/0047-gn-cross-sysroot.patch   |  24 ----
 .../0100-qt5-webengine-linux-5.2.patch        |  42 -------
 .../0101-qt5-webengine-system-icu.patch       |  32 ------
 ...does-it-find-canon-file-name-on-musl.patch |  11 --
 srcpkgs/qt5/template                          |   4 +-
 24 files changed, 2 insertions(+), 774 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 delete mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
 delete mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index 7b30717136a..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -94,7 +94,7 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index 76de3dd5832..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
-+++ -	2019-10-10 18:16:05.910690056 +0200
-@@ -16,9 +16,6 @@
-     if (arm_use_neon) {
-       # Enable build-time NEON selection.
-       defines = [ "DL_ARM_NEON" ]
--    } else if (arm_optionally_use_neon) {
--      # Enable run-time NEON selection.
--      defines = [ "DL_ARM_NEON_OPTIONAL" ]
-     }
-   } else if (current_cpu == "arm64") {
-     # Enable build-time NEON selection.
-@@ -206,18 +203,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_sdk:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index c1cdb537212..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
deleted file mode 100644
index d53915f117b..00000000000
--- a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
-Date: Wed, 29 May 2019 15:30:32 +0200
-Subject: Fix build with recent linux kernel.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Recent kernel commit[1] moved a bit the define for this constant. This revealed
-a missing include in WebRTC.
-
-[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
-
-Bug: webrtc:10677
-Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
-Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
-Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
-Cr-Commit-Position: refs/heads/master@{#28108}
-See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
-Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
----
- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-index 4845a73380c..c38d7fdfac9 100644
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-@@ -51,6 +51,10 @@
- #include "rtc_base/null_socket_server.h"
- #include "rtc_base/time_utils.h"
- 
-+#if defined(WEBRTC_LINUX)
-+#include <linux/sockios.h>
-+#endif
-+
- #if defined(WEBRTC_WIN)
- #define LAST_SYSTEM_ERROR (::GetLastError())
- #elif defined(__native_client__) && __native_client__
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
deleted file mode 100644
index 8f6b9db6afe..00000000000
--- a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
-From: Kirill Burtsev <kirill.burtsev@qt.io>
-Date: Fri, 23 Aug 2019 15:09:25 +0200
-Subject: [PATCH] Fix compilation with system ICU
-
-system_icu_config is missing default type for UCHAR_TYPE, that causes
-a mismatch of types all over Chromium. uint16_t is defined as a base type
-under linux in chromium/build/linux/unbundle/icu.gn.
-Necessary constructions were lost during recent refactorings,
-and seems to be restored in later chromium > 76.
-
-Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
----
-
-diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-index be3c919..639f8fd 100644
---- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-@@ -1175,6 +1175,12 @@
-     "USING_SYSTEM_ICU=1",
-     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
-   ]
-+
-+  if (is_win) {
-+    defines += [ "UCHAR_TYPE=wchar_t" ]
-+  } else {
-+    defines += [ "UCHAR_TYPE=uint16_t" ]
-+  }
- }
- 
- if (use_system_icu) {
-
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
deleted file mode 100644
index 893ed2d41bb..00000000000
--- a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
-+++ -	2019-10-11 06:27:28.450329986 +0200
-@@ -57,7 +57,7 @@
-  */
- char *nasm_realpath(const char *rel_path)
- {
--    char *rp = canonicalize_file_name(rel_path);
-+    char *rp = realpath(rel_path, NULL);
-     return rp ? rp : nasm_strdup(rel_path);
- }
- 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index bee836700ff..829bc7281bb 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,6 +1,6 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.14.0beta1
+version=5.14.0beta2
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
@@ -21,7 +21,7 @@ maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
-checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
+checksum=4e6b3eb4e93e9d96ab1d39aaf7d6a28164aec346f28571bf602c81d4279c15a4
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 

From 90ec274586cff9ca79e08d13d448d85ccd43b240 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:16 +0100
Subject: [PATCH 10/11] qt5-webengine: update to 5.14.0beta2.

---
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 +++++++
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 +++++
 .../patches/0004-musl-dispatch-to-musl.patch  | 103 ++++++++++++++++++
 .../patches/0008-musl-no-mallinfo.patch       |  40 +++++++
 .../patches/0009-musl-off_t.patch             |  10 ++
 .../patches/0010-musl-pread-pwrite.patch      |  18 +++
 .../patches/0011-musl-replace-pvalloc.patch   |  14 +++
 .../patches/0012-musl-resolve.patch           |  26 +++++
 .../patches/0015-musl-siginfo_t.patch         |  18 +++
 .../patches/0017-musl-stackstart.patch        |  20 ++++
 .../patches/0020-musl-sandbox.patch           |  71 ++++++++++++
 ...0025-musl-chromium-default-stacksize.patch |  15 +++
 .../patches/0026-data_pack-be.patch           |  15 +++
 .../0032-musl-cross-no-asm_ptrace_h.patch     |  30 +++++
 .../qt5-webengine/patches/0040-yasm-nls.patch |  13 +++
 .../patches/0044-qt-musl-execinfo.patch       |  94 ++++++++++++++++
 .../0045-qt-musl-thread-stacksize.patch       |  26 +++++
 .../patches/0046-sandbox-membarrier.patch     |  60 ++++++++++
 .../patches/0047-gn-cross-sysroot.patch       |  24 ++++
 ...ch => 0101-qt5-webengine-system-icu.patch} |   6 +-
 ...does-it-find-canon-file-name-on-musl.patch |  11 ++
 .../patches/qt5-webengine-linux-5.2.patch     |  42 -------
 srcpkgs/qt5-webengine/template                |  13 ++-
 23 files changed, 687 insertions(+), 50 deletions(-)
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
 rename srcpkgs/qt5-webengine/patches/{qt5-webengine-system-icu.patch => 0101-qt5-webengine-system-icu.patch} (76%)
 create mode 100644 srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
 delete mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch

diff --git a/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch b/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
new file mode 100644
index 00000000000..c113ddb6566
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
++++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
+@@ -383,12 +383,6 @@
+ 
+ bool DataPack::GetStringPiece(uint16_t resource_id,
+                               base::StringPiece* data) const {
+-  // It won't be hard to make this endian-agnostic, but it's not worth
+-  // bothering to do right now.
+-#if !defined(ARCH_CPU_LITTLE_ENDIAN)
+-#error "datapack assumes little endian"
+-#endif
+-
+   const Entry* target = LookupEntryById(resource_id);
+   if (!target)
+     return false;
diff --git a/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
similarity index 76%
rename from srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
rename to srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
index e3035b15400..8f6b9db6afe 100644
--- a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
+++ b/srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
@@ -12,10 +12,10 @@ and seems to be restored in later chromium > 76.
 Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
 ---
 
-diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
 index be3c919..639f8fd 100644
---- src/3rdparty/chromium/third_party/icu/BUILD.gn
-+++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
 @@ -1175,6 +1175,12 @@
      "USING_SYSTEM_ICU=1",
      "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
diff --git a/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
deleted file mode 100644
index f8e0a38ba38..00000000000
--- a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
-Date: Wed, 29 May 2019 15:30:32 +0200
-Subject: Fix build with recent linux kernel.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Recent kernel commit[1] moved a bit the define for this constant. This revealed
-a missing include in WebRTC.
-
-[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
-
-Bug: webrtc:10677
-Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
-Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
-Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
-Cr-Commit-Position: refs/heads/master@{#28108}
-See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
-Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
----
- chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-index 4845a73380c..c38d7fdfac9 100644
---- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-+++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-@@ -51,6 +51,10 @@
- #include "rtc_base/null_socket_server.h"
- #include "rtc_base/time_utils.h"
- 
-+#if defined(WEBRTC_LINUX)
-+#include <linux/sockios.h>
-+#endif
-+
- #if defined(WEBRTC_WIN)
- #define LAST_SYSTEM_ERROR (::GetLastError())
- #elif defined(__native_client__) && __native_client__
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index ba5a5e26a1d..f72bc352e3d 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,6 +1,6 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
-version=5.14.0beta1
+version=5.14.0beta2
 revision=1
 wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
 #create_wrksrc=yes
@@ -20,14 +20,16 @@ makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
  qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
  libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
  libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
- jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel"
 depends=""
 short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
-checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+checksum=5f0cd5bebb82d1a8a79c0855e1ad28395eab2d649a88d3798fe37e36f4aa4466
+patch_args="-Np1"
 
 build_options="snapshot"
 build_options_default="snapshot"
@@ -62,14 +64,15 @@ pre_configure() {
 #	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
 #	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 #	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
-	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+#	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	:
 }
 
 pre_build() {
 	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
 	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
-	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	#rm -f ${XBPS_WRAPPERDIR}/pkg-config
 	export NINJAJOBS=${makejobs}
 }
 

From ae246985d54489a378acb289cf81f41565408e61 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 11/11] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..4f79dc1843a 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,14 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		${configure_args}
 }
 
 do_build() {

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (2 preceding siblings ...)
  2019-11-11 19:23 ` [PR PATCH] [Updated] [WIP] qt5 update " voidlinux-github
@ 2019-11-12  0:23 ` voidlinux-github
  2020-01-03 10:46 ` voidlinux-github
                   ` (29 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2019-11-12  0:23 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled without webengine)
- [x] i686 (compiled)
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [x] armv6l (compiled without webengine)
- [x] aarch64-musl (compiled without webengine)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross
- split qt5-webengine
- rebase webengine ppc patches @q66 
- musl things (?)
- more things
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- visual bugs with KDE Plasma (e.g. logout/shutdown screen borked)
- force build qt5-designer for cross again

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 427134 bytes --]

From 7585635f67495db8316d34a51abe2c46585ec718 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 01/12] qt5: update to 5.14.0beta1.

---
 common/shlibs                                 |    3 +
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0042-arm-void-is-not-android.patch        |   18 +-
 .../qt5/patches/0044-qt-musl-execinfo.patch   |   13 -
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../0100-qt5-webengine-linux-5.2.patch        |   42 +
 .../0101-qt5-webengine-system-icu.patch       |   32 +
 srcpkgs/qt5/template                          |    9 +-
 13 files changed, 96 insertions(+), 7492 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 create mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch

diff --git a/common/shlibs b/common/shlibs
index 75e5418b687..66a2e9b39d5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1858,6 +1858,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1870,6 +1871,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
index b13290d3ccd..76de3dd5832 100644
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
@@ -1,13 +1,23 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-10 18:16:05.910690056 +0200
+@@ -16,9 +16,6 @@
+     if (arm_use_neon) {
+       # Enable build-time NEON selection.
+       defines = [ "DL_ARM_NEON" ]
+-    } else if (arm_optionally_use_neon) {
+-      # Enable run-time NEON selection.
+-      defines = [ "DL_ARM_NEON_OPTIONAL" ]
+     }
+   } else if (current_cpu == "arm64") {
+     # Enable build-time NEON selection.
+@@ -206,18 +203,6 @@
        "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
        "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
      ]
 -    if (arm_optionally_use_neon) {
 -      # Run-time NEON detection.
 -      deps = [
--        "//third_party/android_tools:cpu_features",
+-        "//third_party/android_sdk:cpu_features",
 -      ]
 -
 -      # To get the __android_log_print routine
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
index 98f3a38745a..c1cdb537212 100644
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
@@ -92,16 +92,3 @@
      !defined(OS_AIX)
    if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
      // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..d53915f117b
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..8f6b9db6afe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 8c62762e47a..912f335258b 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,8 +1,8 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
+version=5.14.0beta1
 revision=1
-wrksrc="qt-everywhere-src-${version}"
+wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
  protobuf python re2c ruby"
@@ -20,8 +20,8 @@ short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
-distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
+checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
@@ -413,6 +413,7 @@ do_configure() {
 
 do_build() {
 	export NINJAJOBS=${makejobs}
+	export NINJAJOBS=-j4
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes

From 7059f8b69707576a18b124b4f1e811da449d8fa9 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 02/12] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index cab544c532b..89ae4282bdb 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -18,7 +18,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  $(vopt_if pulseaudio 'pulseaudio-devel') qt5-devel range-v3 libva-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5>=5.14.0beta2<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"

From 87949508182d9d18c77551cab34ac6b3f26153fc Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 19:17:17 +0200
Subject: [PATCH 03/12] fixup! qt5: update to 5.14.0beta1.

---
 .../0090-hard-disable-qmlchachegen.patch      | 10 ----
 srcpkgs/qt5/files/qmlcachegen.pro             | 40 ++++++++++++++++
 srcpkgs/qt5/files/qmllint.pro                 | 17 ++++++-
 srcpkgs/qt5/files/qttools_src.pro             | 18 ++++----
 srcpkgs/qt5/files/uic.pro                     |  1 +
 .../qt5/patches/0023-enable_tools-cross.patch | 46 -------------------
 ...does-it-find-canon-file-name-on-musl.patch | 11 +++++
 srcpkgs/qt5/template                          | 31 ++-----------
 8 files changed, 81 insertions(+), 93 deletions(-)
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 create mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b08facb22d1
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,40 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp \
+    resourcefilemapper.cpp
+TARGET = qmlcachegen
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
+
+HEADERS += \
+    resourcefilemapper.h
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 912f335258b..3d64a8964b6 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -30,15 +30,6 @@ desc_option_webengine="Build Chromium-based WebEngine component"
 
 makedepends+=" harfbuzz-devel"
 
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in
@@ -293,7 +284,6 @@ do_configure() {
 				-e '/#error Read the comment at this location/d'
 			;;
 		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -341,6 +331,7 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	# Rely on auto detection (fails if forced for cross builds)
 	if [ "$build_option_webengine" ]; then
 		# opts+=" -webengine-alsa"
@@ -381,25 +372,12 @@ do_configure() {
 			fi
 			;;
 		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
-		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
-		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
-		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		#cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
+		#cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
+		#cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -488,6 +466,7 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"

From bc5cc337f6fbc830c0c1bbb1b0618f9da8c31789 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 12 Oct 2019 20:04:04 +0200
Subject: [PATCH 04/12] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 3d64a8964b6..c375d89842d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -4,15 +4,15 @@ version=5.14.0beta1
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
+hostmakedepends="cmake clang flex git glib-devel pkg-config
  protobuf python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
  libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -28,8 +28,6 @@ replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0
 build_options="webengine"
 desc_option_webengine="Build Chromium-based WebEngine component"
 
-makedepends+=" harfbuzz-devel"
-
 if [ "$build_option_webengine" ]; then
 	# v8 requires libatomic on ppc*/s390x/mips*
 	case "$XBPS_TARGET_MACHINE" in

From 822868158e0865b8d17c407ea7a7914d551985dc Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:18:54 +0200
Subject: [PATCH 05/12] fixup! qt5: update to 5.14.0beta1.

---
 srcpkgs/qt5/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index c375d89842d..bee836700ff 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,14 +5,14 @@ revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
 hostmakedepends="cmake clang flex git glib-devel pkg-config
- protobuf python re2c ruby"
+ python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
  gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
  libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
 depends="qtchooser"
@@ -388,12 +388,7 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
-	export NINJAJOBS=-j4
-	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
-	# is not yet ready when it is to be included. Repeating make works around that
-	# problem without having to resort to disable_parallel_build=yes
-	make ${makejobs} || make ${makejobs}
+	make ${makejobs}
 }
 
 do_install() {
@@ -615,7 +610,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 

From 391edccc500a08da2997a680fa1d2ab6ad726c98 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 06/12] New package: qt5-webengine

---
 srcpkgs/qt5-webengine                         |  1 -
 srcpkgs/qt5-webengine-devel                   |  2 +-
 .../patches/qt5-webengine-linux-5.2.patch     | 42 +++++++++
 .../patches/qt5-webengine-system-icu.patch    | 32 +++++++
 srcpkgs/qt5-webengine/template                | 90 +++++++++++++++++++
 5 files changed, 165 insertions(+), 2 deletions(-)
 delete mode 120000 srcpkgs/qt5-webengine
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-webengine
deleted file mode 120000
index 75793eb6664..00000000000
--- a/srcpkgs/qt5-webengine
+++ /dev/null
@@ -1 +0,0 @@
-qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
new file mode 100644
index 00000000000..f8e0a38ba38
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
@@ -0,0 +1,42 @@
+From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
+Date: Wed, 29 May 2019 15:30:32 +0200
+Subject: Fix build with recent linux kernel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent kernel commit[1] moved a bit the define for this constant. This revealed
+a missing include in WebRTC.
+
+[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
+
+Bug: webrtc:10677
+Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
+Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
+Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
+Cr-Commit-Position: refs/heads/master@{#28108}
+See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
+Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
+---
+ chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+index 4845a73380c..c38d7fdfac9 100644
+--- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
++++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
+@@ -51,6 +51,10 @@
+ #include "rtc_base/null_socket_server.h"
+ #include "rtc_base/time_utils.h"
+ 
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_WIN)
+ #define LAST_SYSTEM_ERROR (::GetLastError())
+ #elif defined(__native_client__) && __native_client__
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
new file mode 100644
index 00000000000..e3035b15400
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
@@ -0,0 +1,32 @@
+From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
+From: Kirill Burtsev <kirill.burtsev@qt.io>
+Date: Fri, 23 Aug 2019 15:09:25 +0200
+Subject: [PATCH] Fix compilation with system ICU
+
+system_icu_config is missing default type for UCHAR_TYPE, that causes
+a mismatch of types all over Chromium. uint16_t is defined as a base type
+under linux in chromium/build/linux/unbundle/icu.gn.
+Necessary constructions were lost during recent refactorings,
+and seems to be restored in later chromium > 76.
+
+Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
+---
+
+diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+index be3c919..639f8fd 100644
+--- src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+@@ -1175,6 +1175,12 @@
+     "USING_SYSTEM_ICU=1",
+     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+   ]
++
++  if (is_win) {
++    defines += [ "UCHAR_TYPE=wchar_t" ]
++  } else {
++    defines += [ "UCHAR_TYPE=uint16_t" ]
++  }
+ }
+ 
+ if (use_system_icu) {
+
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..ba5a5e26a1d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,90 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.0beta1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
+#create_wrksrc=yes
+#only_for_archs="i686 x86_64"
+build_style=qmake
+configure_args=" -- -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if webengine '' '-no')-webengine-v8-snapshot"
+#make_build_args=""
+#make_install_args=""
+#conf_files=""
+#make_dirs="/var/log/dir 0755 root root"
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+depends=""
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
+checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+
+build_options="snapshot"
+build_options_default="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel"
+fi
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+#	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+#	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+#	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+}
+
+pre_build() {
+	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
+	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
+	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
+	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		vmove usr/lib/qt5/plugins/designer
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 6f70e4e4b91f700e9a1b0449a4d1896d79cb4f39 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:20:27 +0200
Subject: [PATCH 07/12] [tmp]: messing around with the qmake build_style

---
 common/build-style/qmake.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d4549dae099 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,15 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
+		${configure_args}
 }
 
 do_build() {

From 25dcd8129dae11b7de95f9b40545dd61b1393a26 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 14:12:11 +0100
Subject: [PATCH 08/12] Revert "[tmp]: messing around with the qmake
 build_style"

This reverts commit 6f70e4e4b91f700e9a1b0449a4d1896d79cb4f39.
---
 common/build-style/qmake.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index d4549dae099..63be5a3a568 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,15 +43,13 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} \
+	${qmake} ${qmake_args} ${configure_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}" \
-		QMAKE_PKG_CONFIG="${XBPS_WRAPPERDIR}/pkg-config" \
-		${configure_args}
+		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From c7706f76cf9bd574cc583583e88cb2b030734145 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:14 +0100
Subject: [PATCH 09/12] qt5: update to 5.14.0beta2.

---
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 -------
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 -----
 .../patches/0004-musl-dispatch-to-musl.patch  | 103 ------------------
 .../qt5/patches/0008-musl-no-mallinfo.patch   |  31 ------
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |  10 --
 .../qt5/patches/0010-musl-pread-pwrite.patch  |  18 ---
 .../patches/0011-musl-replace-pvalloc.patch   |  14 ---
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |  26 -----
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |  18 ---
 .../qt5/patches/0017-musl-stackstart.patch    |  20 ----
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |  71 ------------
 ...0025-musl-chromium-default-stacksize.patch |  15 ---
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |  15 ---
 .../0032-musl-cross-no-asm_ptrace_h.patch     |  30 -----
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |  13 ---
 .../0042-arm-void-is-not-android.patch        |  31 ------
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  94 ----------------
 .../0045-qt-musl-thread-stacksize.patch       |  26 -----
 .../qt5/patches/0046-sandbox-membarrier.patch |  60 ----------
 .../qt5/patches/0047-gn-cross-sysroot.patch   |  24 ----
 .../0100-qt5-webengine-linux-5.2.patch        |  42 -------
 .../0101-qt5-webengine-system-icu.patch       |  32 ------
 ...does-it-find-canon-file-name-on-musl.patch |  11 --
 srcpkgs/qt5/template                          |   4 +-
 24 files changed, 2 insertions(+), 774 deletions(-)
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
 delete mode 100644 srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
 delete mode 100644 srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch

diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index 7b30717136a..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -94,7 +94,7 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index 76de3dd5832..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/openmax_dl/dl/BUILD.gn	2019-09-23 14:24:20.000000000 +0200
-+++ -	2019-10-10 18:16:05.910690056 +0200
-@@ -16,9 +16,6 @@
-     if (arm_use_neon) {
-       # Enable build-time NEON selection.
-       defines = [ "DL_ARM_NEON" ]
--    } else if (arm_optionally_use_neon) {
--      # Enable run-time NEON selection.
--      defines = [ "DL_ARM_NEON_OPTIONAL" ]
-     }
-   } else if (current_cpu == "arm64") {
-     # Enable build-time NEON selection.
-@@ -206,18 +203,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_sdk:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index c1cdb537212..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,94 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch b/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
deleted file mode 100644
index d53915f117b..00000000000
--- a/srcpkgs/qt5/patches/0100-qt5-webengine-linux-5.2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
-Date: Wed, 29 May 2019 15:30:32 +0200
-Subject: Fix build with recent linux kernel.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Recent kernel commit[1] moved a bit the define for this constant. This revealed
-a missing include in WebRTC.
-
-[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
-
-Bug: webrtc:10677
-Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
-Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
-Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
-Cr-Commit-Position: refs/heads/master@{#28108}
-See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
-Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
----
- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-index 4845a73380c..c38d7fdfac9 100644
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-@@ -51,6 +51,10 @@
- #include "rtc_base/null_socket_server.h"
- #include "rtc_base/time_utils.h"
- 
-+#if defined(WEBRTC_LINUX)
-+#include <linux/sockios.h>
-+#endif
-+
- #if defined(WEBRTC_WIN)
- #define LAST_SYSTEM_ERROR (::GetLastError())
- #elif defined(__native_client__) && __native_client__
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch b/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
deleted file mode 100644
index 8f6b9db6afe..00000000000
--- a/srcpkgs/qt5/patches/0101-qt5-webengine-system-icu.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 7bc2392c19118a80380c7661fb86c69022eb2b47 Mon Sep 17 00:00:00 2001
-From: Kirill Burtsev <kirill.burtsev@qt.io>
-Date: Fri, 23 Aug 2019 15:09:25 +0200
-Subject: [PATCH] Fix compilation with system ICU
-
-system_icu_config is missing default type for UCHAR_TYPE, that causes
-a mismatch of types all over Chromium. uint16_t is defined as a base type
-under linux in chromium/build/linux/unbundle/icu.gn.
-Necessary constructions were lost during recent refactorings,
-and seems to be restored in later chromium > 76.
-
-Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
----
-
-diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-index be3c919..639f8fd 100644
---- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
-@@ -1175,6 +1175,12 @@
-     "USING_SYSTEM_ICU=1",
-     "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
-   ]
-+
-+  if (is_win) {
-+    defines += [ "UCHAR_TYPE=wchar_t" ]
-+  } else {
-+    defines += [ "UCHAR_TYPE=uint16_t" ]
-+  }
- }
- 
- if (use_system_icu) {
-
diff --git a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
deleted file mode 100644
index 893ed2d41bb..00000000000
--- a/srcpkgs/qt5/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
-+++ -	2019-10-11 06:27:28.450329986 +0200
-@@ -57,7 +57,7 @@
-  */
- char *nasm_realpath(const char *rel_path)
- {
--    char *rp = canonicalize_file_name(rel_path);
-+    char *rp = realpath(rel_path, NULL);
-     return rp ? rp : nasm_strdup(rel_path);
- }
- 
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index bee836700ff..829bc7281bb 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,6 +1,6 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.14.0beta1
+version=5.14.0beta2
 revision=1
 wrksrc="qt-everywhere-src-${version/b/-b}"
 build_style=gnu-configure
@@ -21,7 +21,7 @@ maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/single/qt-everywhere-src-${version/b/-b}.tar.xz"
-checksum=f07cfc26762244bd343190b1b2e8b22708196f017024d6ab59f7fe1c8432f6b3
+checksum=4e6b3eb4e93e9d96ab1d39aaf7d6a28164aec346f28571bf602c81d4279c15a4
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 

From 90ec274586cff9ca79e08d13d448d85ccd43b240 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:16 +0100
Subject: [PATCH 10/12] qt5-webengine: update to 5.14.0beta2.

---
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 +++++++
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 +++++
 .../patches/0004-musl-dispatch-to-musl.patch  | 103 ++++++++++++++++++
 .../patches/0008-musl-no-mallinfo.patch       |  40 +++++++
 .../patches/0009-musl-off_t.patch             |  10 ++
 .../patches/0010-musl-pread-pwrite.patch      |  18 +++
 .../patches/0011-musl-replace-pvalloc.patch   |  14 +++
 .../patches/0012-musl-resolve.patch           |  26 +++++
 .../patches/0015-musl-siginfo_t.patch         |  18 +++
 .../patches/0017-musl-stackstart.patch        |  20 ++++
 .../patches/0020-musl-sandbox.patch           |  71 ++++++++++++
 ...0025-musl-chromium-default-stacksize.patch |  15 +++
 .../patches/0026-data_pack-be.patch           |  15 +++
 .../0032-musl-cross-no-asm_ptrace_h.patch     |  30 +++++
 .../qt5-webengine/patches/0040-yasm-nls.patch |  13 +++
 .../patches/0044-qt-musl-execinfo.patch       |  94 ++++++++++++++++
 .../0045-qt-musl-thread-stacksize.patch       |  26 +++++
 .../patches/0046-sandbox-membarrier.patch     |  60 ++++++++++
 .../patches/0047-gn-cross-sysroot.patch       |  24 ++++
 ...ch => 0101-qt5-webengine-system-icu.patch} |   6 +-
 ...does-it-find-canon-file-name-on-musl.patch |  11 ++
 .../patches/qt5-webengine-linux-5.2.patch     |  42 -------
 srcpkgs/qt5-webengine/template                |  13 ++-
 23 files changed, 687 insertions(+), 50 deletions(-)
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
 rename srcpkgs/qt5-webengine/patches/{qt5-webengine-system-icu.patch => 0101-qt5-webengine-system-icu.patch} (76%)
 create mode 100644 srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
 delete mode 100644 srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch

diff --git a/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0025-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch b/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
new file mode 100644
index 00000000000..c113ddb6566
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0026-data_pack-be.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
++++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
+@@ -383,12 +383,6 @@
+ 
+ bool DataPack::GetStringPiece(uint16_t resource_id,
+                               base::StringPiece* data) const {
+-  // It won't be hard to make this endian-agnostic, but it's not worth
+-  // bothering to do right now.
+-#if !defined(ARCH_CPU_LITTLE_ENDIAN)
+-#error "datapack assumes little endian"
+-#endif
+-
+   const Entry* target = LookupEntryById(resource_id);
+   if (!target)
+     return false;
diff --git a/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0032-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0040-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0044-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0045-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0046-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0047-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch b/srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
similarity index 76%
rename from srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
rename to srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
index e3035b15400..8f6b9db6afe 100644
--- a/srcpkgs/qt5-webengine/patches/qt5-webengine-system-icu.patch
+++ b/srcpkgs/qt5-webengine/patches/0101-qt5-webengine-system-icu.patch
@@ -12,10 +12,10 @@ and seems to be restored in later chromium > 76.
 Change-Id: Ie05c005ebcded9a228386db5d9abe9863787ec2b
 ---
 
-diff --git a/chromium/third_party/icu/BUILD.gn b/chromium/third_party/icu/BUILD.gn
+diff --git qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
 index be3c919..639f8fd 100644
---- src/3rdparty/chromium/third_party/icu/BUILD.gn
-+++ src/3rdparty/chromium/third_party/icu/BUILD.gn
+--- qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/icu/BUILD.gn
 @@ -1175,6 +1175,12 @@
      "USING_SYSTEM_ICU=1",
      "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
diff --git a/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch b/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0110-wtf-why-does-it-find-canon-file-name-on-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch b/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
deleted file mode 100644
index f8e0a38ba38..00000000000
--- a/srcpkgs/qt5-webengine/patches/qt5-webengine-linux-5.2.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 74e69da92d0a895122ca65922b9a2b8b3926c882 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@mozilla.com>
-Date: Wed, 29 May 2019 15:30:32 +0200
-Subject: Fix build with recent linux kernel.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Recent kernel commit[1] moved a bit the define for this constant. This revealed
-a missing include in WebRTC.
-
-[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0768e17073dc5
-
-Bug: webrtc:10677
-Change-Id: I6ed69d307599d077760ae6ad74be10bfbdd1cac6
-Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
-Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
-Cr-Commit-Position: refs/heads/master@{#28108}
-See-Also: https://chromium.googlesource.com/external/webrtc/+/6806550d5d51a820104a12205d1f37ce0acebf19
-Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
----
- chromium/third_party/webrtc/rtc_base/physical_socket_server.cc | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc b/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-index 4845a73380c..c38d7fdfac9 100644
---- src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-+++ src/3rdparty/chromium/third_party/webrtc/rtc_base/physical_socket_server.cc
-@@ -51,6 +51,10 @@
- #include "rtc_base/null_socket_server.h"
- #include "rtc_base/time_utils.h"
- 
-+#if defined(WEBRTC_LINUX)
-+#include <linux/sockios.h>
-+#endif
-+
- #if defined(WEBRTC_WIN)
- #define LAST_SYSTEM_ERROR (::GetLastError())
- #elif defined(__native_client__) && __native_client__
--- 
-cgit v1.2.1
-
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index ba5a5e26a1d..f72bc352e3d 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -1,6 +1,6 @@
 # Template file for 'qt5-webengine'
 pkgname=qt5-webengine
-version=5.14.0beta1
+version=5.14.0beta2
 revision=1
 wrksrc="qtwebengine-everywhere-src-${version/b/-b}"
 #create_wrksrc=yes
@@ -20,14 +20,16 @@ makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
  qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
  libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
  libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
- jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel"
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel"
 depends=""
 short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/development_releases/qt/${version%.*}/${version/b/-b}/submodules/qtwebengine-everywhere-src-${version/b/-b}.tar.xz"
-checksum=4255e0a4f1510b6cae552f053b774659d93116cf17080ac003884c82dc00961c
+checksum=5f0cd5bebb82d1a8a79c0855e1ad28395eab2d649a88d3798fe37e36f4aa4466
+patch_args="-Np1"
 
 build_options="snapshot"
 build_options_default="snapshot"
@@ -62,14 +64,15 @@ pre_configure() {
 #	export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
 #	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 #	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
-	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+#	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	:
 }
 
 pre_build() {
 	#export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
 	#export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 	#export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
-	rm -f ${XBPS_WRAPPERDIR}/pkg-config
+	#rm -f ${XBPS_WRAPPERDIR}/pkg-config
 	export NINJAJOBS=${makejobs}
 }
 

From ae246985d54489a378acb289cf81f41565408e61 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 11/12] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..4f79dc1843a 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -43,13 +43,14 @@ TargetSpec=linux-g++
 _EOF
 		qmake_args="-qtconf ${wrksrc}/qt.conf"
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
+	${qmake} ${qmake_args} \
 		PREFIX=/usr \
 		LIB=/usr/lib \
 		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
 		QMAKE_CFLAGS="${CFLAGS}" \
 		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
+		QMAKE_LFLAGS="${LDFLAGS}" \
+		${configure_args}
 }
 
 do_build() {

From a8e26ae892253abe46c6e5277c54208457e277db Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 12 Nov 2019 01:22:59 +0100
Subject: [PATCH 12/12] fixup! qt5-webengine: update to 5.14.0beta2.

---
 srcpkgs/qt5-webengine/files/resolv_compat.h   | 29 +++++++++++++++++++
 .../patches/msgvec-push_back.patch            | 14 +++++++++
 .../patches/sandbox-sched_getparam.patch      | 24 +++++++++++++++
 srcpkgs/qt5-webengine/template                |  2 +-
 4 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webengine/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5-webengine/patches/msgvec-push_back.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/sandbox-sched_getparam.patch

diff --git a/srcpkgs/qt5-webengine/files/resolv_compat.h b/srcpkgs/qt5-webengine/files/resolv_compat.h
new file mode 100644
index 00000000000..4f0e852a19d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/files/resolv_compat.h
@@ -0,0 +1,29 @@
+#if !defined(__GLIBC__)
+/***************************************************************************
+ * resolv_compat.h
+ *
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
+ * Note: res_init() is actually deprecated according to
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
+ **************************************************************************/
+#include <string.h>
+
+static inline int res_ninit(res_state statp)
+{
+	int rc = res_init();
+	if (statp != &_res) {
+		memcpy(statp, &_res, sizeof(*statp));
+	}
+	return rc;
+}
+
+static inline int res_nclose(res_state statp)
+{
+	if (!statp)
+		return -1;
+	if (statp != &_res) {
+		memset(statp, 0, sizeof(*statp));
+	}
+	return 0;
+}
+#endif
diff --git a/srcpkgs/qt5-webengine/patches/msgvec-push_back.patch b/srcpkgs/qt5-webengine/patches/msgvec-push_back.patch
new file mode 100644
index 00000000000..75481a2889f
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/msgvec-push_back.patch
@@ -0,0 +1,14 @@
+--- qtwebengine-everywhere-src-5.14.0-beta2/src/3rdparty/chromium/net/socket/udp_socket_posix.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:41:46.699068889 +0100
+@@ -1191,7 +1191,11 @@
+     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+   msgvec->reserve(buffers.size());
+   for (size_t j = 0; j < buffers.size(); j++)
++#if defined(__GLIBC__)
+     msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++#else
++    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
++#endif
+   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+   SendResult send_result(0, 0, std::move(buffers));
+   if (result < 0) {
diff --git a/srcpkgs/qt5-webengine/patches/sandbox-sched_getparam.patch b/srcpkgs/qt5-webengine/patches/sandbox-sched_getparam.patch
new file mode 100644
index 00000000000..a91e85eca3c
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/sandbox-sched_getparam.patch
@@ -0,0 +1,24 @@
+Allow SYS_sched_getparam and SYS_sched_getscheduler
+musl uses them for pthread_getschedparam()
+
+source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
+
+--- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:33:51.865153684 +0100
+@@ -88,10 +88,16 @@
+     case __NR_sysinfo:
+     case __NR_times:
+     case __NR_uname:
++#if !defined(__GLIBC__)
++    case __NR_sched_getparam:
++    case __NR_sched_getscheduler:
++#endif
+       return Allow();
+     case __NR_sched_getaffinity:
++#if defined(__GLIBC__)
+     case __NR_sched_getparam:
+     case __NR_sched_getscheduler:
++#endif
+     case __NR_sched_setscheduler:
+       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+     case __NR_prlimit64:
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
index f72bc352e3d..dc6211d7621 100644
--- a/srcpkgs/qt5-webengine/template
+++ b/srcpkgs/qt5-webengine/template
@@ -65,7 +65,7 @@ pre_configure() {
 #	export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 #	export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
 #	rm -f ${XBPS_WRAPPERDIR}/pkg-config
-	:
+	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns
 }
 
 pre_build() {

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (3 preceding siblings ...)
  2019-11-12  0:23 ` voidlinux-github
@ 2020-01-03 10:46 ` voidlinux-github
  2020-01-28 17:04 ` voidlinux-github
                   ` (28 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2020-01-03 10:46 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [ ] x86_64 (compiled and runtime)
- [ ] x86_64-musl (compiled, webengine seems to work https://i.imgur.com/0jpOBet.png (segfaults with sndio (?) also currently tries to fetch resources from `/share` instead of `/usr/share`, needs to be fixed.)
- [ ] i686 ()
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [ ] armv6l (compiled without webengine)
- [ ] aarch64-musl (compiled)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross (for some qmake packages)
- rebase webengine ppc patches @q66 
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- fix webengine loading resources from `/share` instead of `/usr/share`

# Bugs

- webengine currently tries to fetch resources from `/share` instead of `/usr/share
- Plasmashell wayland on musl crashes regulary 

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 443378 bytes --]

From 7d7700986dbe1c981da7ef9f053cf92478cfe106 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 1/9] qt5: update to 5.14.0

---
 common/shlibs                                 |   33 +-
 srcpkgs/{qt5-webengine => qt5-base-docs}      |    0
 srcpkgs/qt5-concurrent                        |    1 +
 srcpkgs/qt5-core                              |    1 +
 srcpkgs/qt5-dbus                              |    1 +
 srcpkgs/qt5-gui                               |    1 +
 srcpkgs/qt5-network                           |    1 +
 srcpkgs/qt5-opengl                            |    1 +
 srcpkgs/qt5-printsupport                      |    1 +
 srcpkgs/qt5-sql                               |    1 +
 srcpkgs/qt5-test                              |    1 +
 srcpkgs/qt5-widgets                           |    1 +
 srcpkgs/qt5-xml                               |    1 +
 .../0090-hard-disable-qmlchachegen.patch      |   10 -
 srcpkgs/qt5/files/qmlcachegen.pro             |   38 +
 srcpkgs/qt5/files/qmlimportscanner.pro        |    2 +
 srcpkgs/qt5/files/qmllint.pro                 |   17 +-
 srcpkgs/qt5/files/qttools_src.pro             |   18 +-
 srcpkgs/qt5/files/resolv_compat.h             |   29 -
 srcpkgs/qt5/files/uic.pro                     |    1 +
 srcpkgs/qt5/files/uitools.pro                 |   15 +
 ...te-instead-of-_libc_fpstate-on-linux.patch |   42 -
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |   26 -
 .../patches/0004-musl-dispatch-to-musl.patch  |  103 -
 .../qt5/patches/0008-musl-no-mallinfo.patch   |   40 -
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |   10 -
 .../qt5/patches/0010-musl-pread-pwrite.patch  |   18 -
 .../patches/0011-musl-replace-pvalloc.patch   |   14 -
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |   26 -
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |   18 -
 .../qt5/patches/0017-musl-stackstart.patch    |   20 -
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |   71 -
 .../qt5/patches/0023-enable_tools-cross.patch |   46 -
 ...0025-musl-chromium-default-stacksize.patch |   15 -
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |   15 -
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0032-musl-cross-no-asm_ptrace_h.patch     |   30 -
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |   13 -
 .../0042-arm-void-is-not-android.patch        |   21 -
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  107 -
 .../0045-qt-musl-thread-stacksize.patch       |   26 -
 .../qt5/patches/0046-sandbox-membarrier.patch |   60 -
 .../qt5/patches/0047-gn-cross-sysroot.patch   |   24 -
 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch  |   33 +
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../patches/0100-sandbox-sched_getparam.patch |   24 -
 .../0100-wayland-cursor-flickering.patch      |  122 +
 srcpkgs/qt5/template                          |  340 +-
 53 files changed, 410 insertions(+), 8499 deletions(-)
 rename srcpkgs/{qt5-webengine => qt5-base-docs} (100%)
 create mode 120000 srcpkgs/qt5-concurrent
 create mode 120000 srcpkgs/qt5-core
 create mode 120000 srcpkgs/qt5-dbus
 create mode 120000 srcpkgs/qt5-gui
 create mode 120000 srcpkgs/qt5-network
 create mode 120000 srcpkgs/qt5-opengl
 create mode 120000 srcpkgs/qt5-printsupport
 create mode 120000 srcpkgs/qt5-sql
 create mode 120000 srcpkgs/qt5-test
 create mode 120000 srcpkgs/qt5-widgets
 create mode 120000 srcpkgs/qt5-xml
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5/files/uitools.pro
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
 create mode 100644 srcpkgs/qt5/patches/0100-wayland-cursor-flickering.patch

diff --git a/common/shlibs b/common/shlibs
index 611abc88b12..a511b2e23fe 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1884,6 +1884,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1896,6 +1897,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
@@ -1932,21 +1935,21 @@ libQt5WebEngineWidgets.so.5 qt5-webengine-5.6.0_1
 libQt5WebSockets.so.5 qt5-websockets-5.6.0_1
 libQt5X11Extras.so.5 qt5-x11extras-5.6.0_1
 libQt5XmlPatterns.so.5 qt5-xmlpatterns-5.6.0_1
-libQt5Core.so.5 qt5-5.6.0_1
-libQt5EglFSDeviceIntegration.so.5 qt5-5.8.0_1
-libQt5Network.so.5 qt5-5.6.0_1
-libQt5Sql.so.5 qt5-5.6.0_1
-libQt5Xml.so.5 qt5-5.6.0_1
-libQt5Gui.so.5 qt5-5.6.0_1
-libQt5Widgets.so.5 qt5-5.6.0_1
-libQt5Test.so.5 qt5-5.6.0_1
-libQt5DBus.so.5 qt5-5.6.0_1
-libQt5Concurrent.so.5 qt5-5.6.0_1
-libQt5OpenGL.so.5 qt5-5.6.0_1
-libQt5PrintSupport.so.5 qt5-5.6.0_1
-libQt5XcbQpa.so.5 qt5-5.6.0_1
-libQt5EglDeviceIntegration.so.5 qt5-5.6.0_1
-libQt5EglFsKmsSupport.so.5 qt5-5.7.1_1
+libQt5Core.so.5 qt5-core-5.14.0_1
+libQt5EglFSDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5Network.so.5 qt5-network-5.14.0_1
+libQt5Sql.so.5 qt5-sql-5.14.0_1
+libQt5Xml.so.5 qt5-xml-5.14.0_1
+libQt5Gui.so.5 qt5-gui-5.14.0_1
+libQt5Widgets.so.5 qt5-widgets-5.14.0_1
+libQt5Test.so.5 qt5-test-5.14.0_1
+libQt5DBus.so.5 qt5-dbus-5.14.0_1
+libQt5Concurrent.so.5 qt5-concurrent-5.14.0_1
+libQt5OpenGL.so.5 qt5-opengl-5.14.0_1
+libQt5PrintSupport.so.5 qt5-printsupport-5.14.0_1
+libQt5XcbQpa.so.5 qt5-gui-5.14.0_1
+libQt5EglDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5EglFsKmsSupport.so.5 qt5-gui-5.14.0_1
 libQt5WebKit.so.5 qt5-webkit-5.6.0_1
 libQt5WebKitWidgets.so.5 qt5-webkit-5.6.0_1
 libQt5TextToSpeech.so.5 qt5-speech-5.8.0_1
diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-base-docs
similarity index 100%
rename from srcpkgs/qt5-webengine
rename to srcpkgs/qt5-base-docs
diff --git a/srcpkgs/qt5-concurrent b/srcpkgs/qt5-concurrent
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-concurrent
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-core b/srcpkgs/qt5-core
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-core
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-dbus b/srcpkgs/qt5-dbus
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-dbus
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-gui b/srcpkgs/qt5-gui
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-gui
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-network b/srcpkgs/qt5-network
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-network
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-opengl b/srcpkgs/qt5-opengl
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-opengl
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-printsupport b/srcpkgs/qt5-printsupport
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-printsupport
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-sql b/srcpkgs/qt5-sql
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-sql
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-test b/srcpkgs/qt5-test
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-test
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-widgets b/srcpkgs/qt5-widgets
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-widgets
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xml b/srcpkgs/qt5-xml
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xml
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b5963becd6c
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,38 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp
+TARGET = qmlcachegen
+
+include(../shared/shared.pri)
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmlimportscanner.pro b/srcpkgs/qt5/files/qmlimportscanner.pro
index 57c228b8540..ab1e851293a 100644
--- a/srcpkgs/qt5/files/qmlimportscanner.pro
+++ b/srcpkgs/qt5/files/qmlimportscanner.pro
@@ -3,6 +3,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
 
 SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
 
+include(../shared/shared.pri)
+
 QMAKE_TARGET_DESCRIPTION = QML Import Scanner
 
 load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/resolv_compat.h b/srcpkgs/qt5/files/resolv_compat.h
deleted file mode 100644
index 4f0e852a19d..00000000000
--- a/srcpkgs/qt5/files/resolv_compat.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#if !defined(__GLIBC__)
-/***************************************************************************
- * resolv_compat.h
- *
- * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
- * Note: res_init() is actually deprecated according to
- * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
- **************************************************************************/
-#include <string.h>
-
-static inline int res_ninit(res_state statp)
-{
-	int rc = res_init();
-	if (statp != &_res) {
-		memcpy(statp, &_res, sizeof(*statp));
-	}
-	return rc;
-}
-
-static inline int res_nclose(res_state statp)
-{
-	if (!statp)
-		return -1;
-	if (statp != &_res) {
-		memset(statp, 0, sizeof(*statp));
-	}
-	return 0;
-}
-#endif
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/files/uitools.pro b/srcpkgs/qt5/files/uitools.pro
new file mode 100644
index 00000000000..51e22b14506
--- /dev/null
+++ b/srcpkgs/qt5/files/uitools.pro
@@ -0,0 +1,15 @@
+TARGET = QtUiTools
+CONFIG += static
+
+include(../lib/uilib/uilib.pri)
+
+QMAKE_DOCS = $$PWD/doc/qtuitools.qdocconf
+
+HEADERS += quiloader.h
+SOURCES += quiloader.cpp
+
+DEFINES += \
+    QFORMINTERNAL_NAMESPACE \
+    QT_DESIGNER_STATIC
+
+load(qt_module)
diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index c332b92b69d..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -100,14 +100,14 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
- #else
-   return minfo.hblkhd + minfo.arena;
- #endif
--#elif defined(OS_FUCHSIA)
-+#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
-   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
-   return 0;
- #endif
-
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index b13290d3ccd..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_tools:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index 98f3a38745a..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,107 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
new file mode 100644
index 00000000000..2eeae632cfe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
@@ -0,0 +1,33 @@
+Submodule qtbase contains untracked content
+Submodule qtbase contains modified content
+diff --git qtbase/mkspecs/features/qt_build_config.prf qtbase/mkspecs/features/qt_build_config.prf
+index 8273ba3fe1..b674f42109 100644
+--- qtbase/mkspecs/features/qt_build_config.prf
++++ qtbase/mkspecs/features/qt_build_config.prf
+@@ -11,6 +11,10 @@
+ 
+ !contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
+     QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
++    defined(QMAKE_TARGET_MODULE,var):exists($$QMAKE_TARGET_MODULE) {
++        QMAKE_QT_MODULE = $$QMAKE_TARGET_MODULE
++        message("Trying .qmodule.pri from ($$QMAKE_QT_CONFIG)")
++    }
+     !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) {
+         debug(1, "Cannot load qmodule.pri!")
+     } else {
+diff --git qtbase/mkspecs/features/qt_config.prf qtbase/mkspecs/features/qt_config.prf
+index 93c54e3010..aaff26b52a 100644
+--- qtbase/mkspecs/features/qt_config.prf
++++ qtbase/mkspecs/features/qt_config.prf
+@@ -1,6 +1,10 @@
+ # This file is loaded as one of the last things by all qmakespecs.
+ 
+ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
++defined(QMAKE_TARGET_CONFIG,var):exists($$QMAKE_TARGET_CONFIG) {
++   QMAKE_QT_CONFIG = $$QMAKE_TARGET_CONFIG
++   message("Trying .qconfig.pri from ($$QMAKE_QT_CONFIG)")
++}
+ !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
+    debug(1, "Cannot load qconfig.pri!")
+ } else {
+Submodule qtwebengine contains untracked content
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch b/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
deleted file mode 100644
index 15c33a57f03..00000000000
--- a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Allow SYS_sched_getparam and SYS_sched_getscheduler
-musl uses them for pthread_getschedparam()
-
-source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
-
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-11-12 20:48:20.013724661 +0100
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc.patched	2019-11-12 20:58:57.330695676 +0100
-@@ -93,10 +93,16 @@
-     case __NR_sysinfo:
-     case __NR_times:
-     case __NR_uname:
-+#if !defined(__GLIBC__)
-+    case __NR_sched_getparam:
-+    case __NR_sched_getscheduler:
-+#endif
-       return Allow();
-     case __NR_sched_getaffinity:
-+#if defined(__GLIBC__)
-     case __NR_sched_getparam:
-     case __NR_sched_getscheduler:
-+#endif
-     case __NR_sched_setscheduler:
-       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
-     case __NR_prlimit64:
diff --git a/srcpkgs/qt5/patches/0100-wayland-cursor-flickering.patch b/srcpkgs/qt5/patches/0100-wayland-cursor-flickering.patch
new file mode 100644
index 00000000000..da09e0d63a6
--- /dev/null
+++ b/srcpkgs/qt5/patches/0100-wayland-cursor-flickering.patch
@@ -0,0 +1,122 @@
+From 36974955d13578071387695adb13a47be33e4d32 Mon Sep 17 00:00:00 2001
+From: David Edmundson <davidedmundson@kde.org>
+Date: Thu, 28 Nov 2019 02:31:17 +0100
+Subject: Avoid animating single frame cursors
+
+Currently to determine if a cursor is animated or not we check the
+cursor theme delay.
+
+This doesn't work in practice as by default many cursor themes have a
+delay of 50 set even if they don't animate.
+
+This comes from xcursorgen which specifies a delay of 50ms if there
+isn't anything set in the config.
+(https://github.com/freedesktop/xcursorgen/blob/master/xcursorgen.c#L92)
+
+Given many themes will have a delay we should also check the number of
+images in a given cursor.
+
+In order to do that without a double lookup QWaylandCursor needed to
+return the native wl_cursor, not wl_cursor_image and move the relevant
+logic.
+
+Change-Id: Ie782ace8054910ae76e61cab33ceca0377194929
+Reviewed-by: Johan Helsing <johan.helsing@qt.io>
+---
+ src/client/qwaylandcursor.cpp      | 12 ++----------
+ src/client/qwaylandcursor_p.h      |  3 +--
+ src/client/qwaylandinputdevice.cpp | 16 ++++++++++++----
+ 3 files changed, 15 insertions(+), 16 deletions(-)
+
+diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp
+index 4356b23a..1d3d88be 100644
+--- qtwayland/src/client/qwaylandcursor.cpp
++++ qtwayland/src/client/qwaylandcursor.cpp
+@@ -219,7 +219,7 @@ wl_cursor *QWaylandCursorTheme::requestCursor(WaylandCursor shape)
+     return nullptr;
+ }
+ 
+-::wl_cursor_image *QWaylandCursorTheme::cursorImage(Qt::CursorShape shape, uint millisecondsIntoAnimation)
++::wl_cursor *QWaylandCursorTheme::cursor(Qt::CursorShape shape)
+ {
+     struct wl_cursor *waylandCursor = nullptr;
+ 
+@@ -237,15 +237,7 @@ wl_cursor *QWaylandCursorTheme::requestCursor(WaylandCursor shape)
+         return nullptr;
+     }
+ 
+-    int frame = wl_cursor_frame(waylandCursor, millisecondsIntoAnimation);
+-    ::wl_cursor_image *image = waylandCursor->images[frame];
+-    ::wl_buffer *buffer = wl_cursor_image_get_buffer(image);
+-    if (!buffer) {
+-        qCWarning(lcQpaWayland) << "Could not find buffer for cursor";
+-        return nullptr;
+-    }
+-
+-    return image;
++    return waylandCursor;
+ }
+ 
+ QWaylandCursor::QWaylandCursor(QWaylandDisplay *display)
+diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h
+index a4605f3d..751ffa68 100644
+--- qtwayland/src/client/qwaylandcursor_p.h
++++ qtwayland/src/client/qwaylandcursor_p.h
+@@ -75,7 +75,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandCursorTheme
+ public:
+     static QWaylandCursorTheme *create(QWaylandShm *shm, int size, const QString &themeName);
+     ~QWaylandCursorTheme();
+-    ::wl_cursor_image *cursorImage(Qt::CursorShape shape, uint millisecondsIntoAnimation = 0);
++    ::wl_cursor *cursor(Qt::CursorShape shape);
+ 
+ private:
+     enum WaylandCursor {
+@@ -129,7 +129,6 @@ public:
+     void setPos(const QPoint &pos) override;
+ 
+     static QSharedPointer<QWaylandBuffer> cursorBitmapBuffer(QWaylandDisplay *display, const QCursor *cursor);
+-    struct wl_cursor_image *cursorImage(Qt::CursorShape shape);
+ 
+ private:
+     QWaylandDisplay *mDisplay = nullptr;
+diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
+index a4098edd..d812918e 100644
+--- qtwayland/src/client/qwaylandinputdevice.cpp
++++ qtwayland/src/client/qwaylandinputdevice.cpp
+@@ -283,8 +283,8 @@ void QWaylandInputDevice::Pointer::updateCursorTheme()
+     if (!mCursor.theme)
+         return; // A warning has already been printed in loadCursorTheme
+ 
+-    if (auto *arrow = mCursor.theme->cursorImage(Qt::ArrowCursor)) {
+-        int arrowPixelSize = qMax(arrow->width, arrow->height); // Not all cursor themes are square
++    if (auto *arrow = mCursor.theme->cursor(Qt::ArrowCursor)) {
++        int arrowPixelSize = qMax(arrow->images[0]->width, arrow->images[0]->height); // Not all cursor themes are square
+         while (scale > 1 && arrowPixelSize / scale < cursorSize())
+             --scale;
+     } else {
+@@ -326,12 +326,20 @@ void QWaylandInputDevice::Pointer::updateCursor()
+ 
+     // Set from shape using theme
+     uint time = seat()->mCursor.animationTimer.elapsed();
+-    if (struct ::wl_cursor_image *image = mCursor.theme->cursorImage(shape, time)) {
++
++    if (struct ::wl_cursor *waylandCursor = mCursor.theme->cursor(shape)) {
++        int frame = wl_cursor_frame(waylandCursor, time);
++        ::wl_cursor_image *image = waylandCursor->images[frame];
++
+         struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
++        if (!buffer) {
++            qCWarning(lcQpaWayland) << "Could not find buffer for cursor" << shape;
++            return;
++        }
+         int bufferScale = mCursor.themeBufferScale;
+         QPoint hotspot = QPoint(image->hotspot_x, image->hotspot_y) / bufferScale;
+         QSize size = QSize(image->width, image->height) / bufferScale;
+-        bool animated = image->delay > 0;
++        bool animated = waylandCursor->image_count > 1 && image->delay > 0;
+         getOrCreateCursorSurface()->update(buffer, hotspot, size, bufferScale, animated);
+         return;
+     }
+-- 
+cgit v1.2.1
+
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 02779a02751..68399d01b94 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,84 +1,31 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
-revision=2
+version=5.14.0
+revision=1
 wrksrc="qt-everywhere-src-${version}"
-build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
- protobuf python re2c ruby"
+build_style=meta
+hostmakedepends="cmake clang flex git glib-devel pkg-config
+ python re2c ruby"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
-depends="qtchooser"
+depends="qt5-dbus qt5-gui qt5-core qt5-widgets qt5-network qt5-xml
+ qt5-test qt5-sql qt5-concurrent qt5-printsupport qt5-opengl"
 short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+checksum=be9a77cd4e1f9d70b58621d0753be19ea498e6b0da0398753e5038426f76a8ba
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
-build_options="webengine"
-desc_option_webengine="Build Chromium-based WebEngine component"
-
-makedepends+=" harfbuzz-devel"
-
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
-if [ "$build_option_webengine" ]; then
-	# v8 requires libatomic on ppc*/s390x/mips*
-	case "$XBPS_TARGET_MACHINE" in
-		mips*|ppc*) makedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-	# also need it on host when it's one of those archs
-	case "$XBPS_MACHINE" in
-		mips*|ppc*) hostmakedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-fi
-
-subpackages="qt5-3d qt5-3d-devel qt5-charts qt5-charts-devel
- qt5-connectivity qt5-connectivity-devel qt5-datavis3d qt5-datavis3d-devel
- qt5-declarative qt5-declarative-devel qt5-devel qt5-examples qt5-gamepad
- qt5-gamepad-devel qt5-graphicaleffects qt5-host-tools qt5-imageformats
- qt5-location qt5-location-devel qt5-multimedia qt5-multimedia-devel
- qt5-networkauth qt5-networkauth-devel qt5-plugin-mysql qt5-plugin-odbc
- qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds qt5-purchasing
- qt5-purchasing-devel qt5-qmake qt5-quickcontrols qt5-quickcontrols2
- qt5-quickcontrols2-devel qt5-remoteobjects qt5-remoteobjects-devel
- qt5-script qt5-script-devel qt5-scxml qt5-scxml-devel qt5-sensors
- qt5-sensors-devel qt5-serialbus qt5-serialbus-devel qt5-serialport
- qt5-serialport-devel qt5-speech qt5-speech-devel qt5-svg qt5-svg-devel
- qt5-tools qt5-tools-devel qt5-translations qt5-virtualkeyboard
- qt5-virtualkeyboard-devel qt5-wayland qt5-wayland-devel qt5-webchannel
- qt5-webchannel-devel qt5-webglplugin qt5-webglplugin-devel qt5-websockets
- qt5-websockets-devel qt5-webview qt5-webview-devel qt5-x11extras
- qt5-x11extras-devel qt5-xmlpatterns qt5-xmlpatterns-devel
- qt5-lottie qt5-lottie-devel"
-
-if [ "$build_option_webengine" ]; then
-	subpackages+=" qt5-webengine qt5-webengine-devel"
-fi
-
-if [ "$XBPS_WORDSIZE" -eq 32 ]; then
-	nodebug=yes  # prevent OOM
-fi
-
 # Work around SSLv3_{client,server}_method missing in libressl-2.3.3
 CFLAGS="-DOPENSSL_NO_PSK -DOPENSSL_NO_NEXTPROTONEG"
 CXXFLAGS="${CFLAGS} -Wno-deprecated-declarations -Wno-class-memaccess -Wno-packed-not-aligned"
@@ -90,26 +37,8 @@ if [ "$CROSS_BUILD" ]; then
 	# wayland-devel contains /usr/bin/wayland-scanner
 	hostmakedepends+=" icu-devel wayland-devel zlib-devel"
 	hostmakedepends+=" postgresql-libs-devel"
-	# Cross building qtwebengine requires some more host packages
-	if [ "$build_option_webengine" ]; then
-		hostmakedepends+=" nss-devel libevent-devel"
-	fi
 fi
 
-_bootstrap_gn() {
-	# Bootstrap gn (generate ninja)
-	echo "Bootstrapping 'gn'"
-	cd ${wrksrc}/qtwebengine/src/3rdparty/gn
-	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
-	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
-		python2 build/gen.py --no-last-commit-position --out-path \
-			${wrksrc}/qtwebengine/src/3rdparty/gn/out/Release --cc "$CC_host" \
-			--cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
-	ninja -C out/Release gn
-	cd ${wrksrc}
-}
-
-
 _cleanup_wrksrc_leak() {
 	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
 		# Replace references to ${wrksrc} in cmake files
@@ -164,6 +93,11 @@ _install_devel() {
 	local module=$1
 	cd ${wrksrc}/${module}
 	make INSTALL_ROOT=${PKGDESTDIR} install
+	vmkdir usr/lib/qt5/mkspecs/modules
+	if [ -d "${PKGDESTDIR}${wrksrc}/host/mkspecs/modules" ]; then
+		mv -nv ${PKGDESTDIR}${wrksrc}/host/mkspecs/modules/* \
+			${PKGDESTDIR}/usr/lib/qt5/mkspecs/modules/
+	fi
 	rm -rf ${PKGDESTDIR}/builddir
 	rm -rf ${PKGDESTDIR}/usr/share
 	rm -rf ${PKGDESTDIR}/usr/lib/qt5/bin
@@ -234,32 +168,6 @@ _msg_cross() {
 do_configure() {
 	local opts spec
 
-	# Compatibility functions res_ninit() and res_nclose() for musl libc
-	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/qtwebengine/src/3rdparty/chromium/net/dns
-
-	case "$XBPS_TARGET_MACHINE" in
-	armv5*|armv6*)	# Disable "yield" assembler instruction
-		sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
-			qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
-			-e 's;"yield";"nop";'
-		;;
-	esac
-
-	case "$XBPS_TARGET_MACHINE" in
-	*-musl)
-		# Patch .../linux/*/config.{h,asm} to define HAVE_SYSCTL 0
-		local config chromium=${wrksrc}/qtwebengine/src/3rdparty/chromium
-		for config in $(find ${chromium}/third_party/ffmpeg/chromium/config -name "config\.*" | grep linux); do
-			sed -i ${config} -e "s;HAVE_SYSCTL 1;HAVE_SYSCTL 0;"
-		done
-		# Do not use allocator shim (incompatible with musl libc)
-		sed -i qtwebengine/src/3rdparty/chromium/build/config/allocator.gni \
-			-e "s;\(use_allocator_shim\) = .*;\1 = false;"
-		# Define to set 2 MiB stack size for qthread
-		export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152"
-		;;
-	esac
-
 	# Cross build patches
 	if [ "$CROSS_BUILD" ]; then
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
@@ -272,28 +180,6 @@ do_configure() {
 		for d in $(ls ${wrksrc}/qtbase/include); do
 			ln -sfv ${version}/${d}/private qtbase/include/${d}/private
 		done
-		if [ "$build_option_webengine" ]; then
-			_bootstrap_gn
-		fi
-
-		case "$XBPS_TARGET_MACHINE" in
-		mips*)	# sgidefs.h is in /usr/include/asm
-			for f in \
-				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
-				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
-				sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
-			done
-			# Assume that RGBA order is correct for big endian CPUs
-			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
-				-e '/#error Read the comment at this location/d'
-			;;
-		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -341,29 +227,10 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
-	# Rely on auto detection (fails if forced for cross builds)
-	if [ "$build_option_webengine" ]; then
-		# opts+=" -webengine-alsa"
-		opts+=" -no-webengine-embedded-build"
-		opts+=" -webengine-icu"
-		opts+=" -webengine-ffmpeg"
-		opts+=" -webengine-opus"
-		opts+=" -webengine-webp"
-		opts+=" -webengine-pepper-plugins"
-		opts+=" -webengine-printing-and-pdf"
-		opts+=" -webengine-proprietary-codecs"
-		opts+=" -webengine-pulseaudio"
-		opts+=" -webengine-spellchecker"
-		opts+=" -webengine-webrtc"
-		opts+=" -webengine-geolocation"
-		opts+=" -webengine-v8-snapshot"
-	fi
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	opts+=" -silent"
 	# opts+=" -v"
-	# make sure to disable webengine on platforms that we don't build it for
-	if [ -z "$build_option_webengine" ]; then
-		opts+=" -skip qtwebengine"
-	fi
+	opts+=" -skip qtwebengine"
 	LDFLAGS+=" -Wl,--no-keep-memory"  # needs more than 8GB RAM else
 	if [ "$CROSS_BUILD" ]; then
 		spec=void-${XBPS_CROSS_TRIPLET}-g++
@@ -373,33 +240,13 @@ do_configure() {
 		opts+=" -sysroot ${XBPS_CROSS_BASE}"
 		opts+=" -hostprefix host"
 		opts+=" -extprefix /usr"
-		case "$XBPS_TARGET_MACHINE" in
-		arm*|mips*)
-			if [ "$build_option_webengine" ]; then
-				# V8 snapshot can't be built with a 64 bit host compiler
-				opts+=" -no-webengine-v8-snapshot"
-			fi
-			;;
-		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
 		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
 		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
 		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		cp -v ${FILESDIR}/uitools.pro qttools/src/designer/src/uitools/uitools.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -412,10 +259,10 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes
+	# or some other files
 	make ${makejobs} || make ${makejobs}
 }
 
@@ -487,12 +334,15 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"
 		dirs+=" qtbase/src/tools/uic"
 		dirs+=" qtbase/src/tools/qdbuscpp2xml"
 		dirs+=" qtbase/src/tools/qdbusxml2cpp"
+		dirs+=" qtbase/src/tools/qvkgen"
+		dirs+=" qtbase/src/tools/tracegen"
 		dirs+=" qtbase/src/tools/qlalr"
 		dirs+=" qt3d/tools/qgltf"
 		dirs+=" qtremoteobjects/tools/repc"
@@ -564,6 +414,102 @@ do_install() {
 	rm -rf ${DESTDIR}/builddir
 }
 
+qt5-gui_package() {
+	short_desc+=" - Gui"
+	pkg_install() {
+		vmove "usr/lib/libQt5Gui.so*"
+		vmove "usr/lib/libQt5XcbQpa.so*"
+		vmove "usr/lib/libQt5EglFSDeviceIntegration.so*"
+		vmove "usr/lib/libQt5EglFsKmsSupport.so*"
+		vmove usr/lib/qt5/plugins/generic
+		vmove usr/lib/qt5/plugins/platforms
+		vmove usr/lib/qt5/plugins/xcbglintegrations
+		vmove usr/lib/qt5/plugins/imageformats
+		vmove usr/lib/qt5/plugins/egldeviceintegrations
+		vmove usr/lib/qt5/plugins/platforminputcontexts
+		vmove usr/lib/qt5/plugins/platformthemes
+	}
+}
+
+qt5-dbus_package() {
+	short_desc+=" - DBus"
+	pkg_install() {
+		vmove "usr/lib/libQt5DBus.so*"
+	}
+}
+
+qt5-core_package() {
+	short_desc+=" - Core"
+	pkg_install() {
+		vmove "usr/lib/libQt5Core.so*"
+	}
+}
+
+qt5-opengl_package() {
+	short_desc+=" - OpenGL"
+	pkg_install() {
+		vmove "usr/lib/libQt5OpenGL.so*"
+	}
+}
+
+qt5-printsupport_package() {
+	short_desc+=" - Print Support"
+	pkg_install() {
+		vmove "usr/lib/libQt5PrintSupport.so*"
+		vmove usr/lib/qt5/plugins/printsupport
+	}
+}
+
+qt5-concurrent_package() {
+	short_desc+=" - Concurrency"
+	pkg_install() {
+		vmove "usr/lib/libQt5Concurrent.so*"
+	}
+}
+
+qt5-widgets_package() {
+	short_desc+=" - Widgets"
+	pkg_install() {
+		vmove "usr/lib/libQt5Widgets.so*"
+	}
+}
+
+qt5-network_package() {
+	short_desc+=" - Network"
+	pkg_install() {
+		vmove "usr/lib/libQt5Network.so*"
+		vmove usr/lib/qt5/plugins/bearer
+	}
+}
+
+qt5-sql_package() {
+	short_desc+=" - Sql"
+	pkg_install() {
+		vmove "usr/lib/libQt5Sql.so*"
+	}
+}
+
+qt5-test_package() {
+	short_desc+=" - Test"
+	pkg_install() {
+		vmove "usr/lib/libQt5Test.so*"
+	}
+}
+
+qt5-xml_package() {
+	short_desc+=" - Xml"
+	pkg_install() {
+		vmove "usr/lib/libQt5Xml.so*"
+	}
+}
+
+qt5-base-docs_package() {
+	short_desc+=" - Documentation"
+	pkg_install() {
+		vmove usr/share/doc/qt5
+	}
+}
+
 qt5-3d-devel_package() {
 	short_desc+=" - C++ and QML APIs for 3D graphics (development)"
 	depends="qt5-3d-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -637,7 +583,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 
@@ -784,6 +730,13 @@ qt5-quickcontrols2_package() {
 	}
 }
 
+qt5-quicktimeline_package() {
+	short_desc+=" - Keyframe-based animations"
+	pkg_install() {
+		_install_subpkg qtquicktimeline
+	}
+}
+
 qt5-remoteobjects-devel_package() {
 	short_desc+=" - Remote Objects (development)"
 	depends="qt5-remoteobjects-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -952,21 +905,6 @@ qt5-webchannel_package() {
 	}
 }
 
-qt5-webengine-devel_package() {
-	short_desc+=" - WebEngine component (development)"
-	depends="qt5-webengine-${version}_${revision} qt5-devel-${version}_${revision}"
-	pkg_install() {
-		_install_devel qtwebengine
-	}
-}
-
-qt5-webengine_package() {
-	short_desc+=" - WebEngine component"
-	pkg_install() {
-		_install_subpkg qtwebengine
-	}
-}
-
 qt5-webglplugin-devel_package() {
 	short_desc+=" - WebGL plugin (development)"
 	depends="qt5-webglplugin-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -1037,6 +975,7 @@ qt5-xmlpatterns-devel_package() {
 
 qt5-xmlpatterns_package() {
 	short_desc+=" - XML components"
+	depends="qtchooser"
 	pkg_install() {
 		_install_subpkg qtxmlpatterns
 	}
@@ -1051,12 +990,13 @@ qt5-translations_package() {
 
 qt5-host-tools_package() {
 	short_desc+=" - Tools required when cross compiling"
+	depends="qtchooser"
 	pkg_install() {
 		local dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-tools-${version}
 		vmkdir usr/lib/qt5/bin
 		vmkdir usr/bin
-		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp \
-			lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
+		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp qvkgen fixqt4headers.pl tracegen \
+			syncqt.pl lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
 			if [ -r ${dest}/usr/lib/qt5/bin/${f} ]; then
 				mv -v ${dest}/usr/lib/qt5/bin/${f} ${PKGDESTDIR}/usr/lib/qt5/bin/
 			fi
@@ -1085,7 +1025,7 @@ qt5-tools-devel_package() {
 
 qt5-tools_package() {
 	short_desc+=" - Development tools"
-	depends="qt5-translations desktop-file-utils hicolor-icon-theme"
+	depends="qtchooser qt5-translations desktop-file-utils hicolor-icon-theme"
 	pkg_install() {
 		local f dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-host-tools-${version}
 		_install_subpkg qttools
@@ -1126,8 +1066,19 @@ qt5-tools_package() {
 qt5-devel_package() {
 	depends="zlib-devel libressl-devel>=2.1.4 libXext-devel libXrender-devel
 		fontconfig-devel libglib-devel MesaLib-devel mtdev-devel
-		dbus-devel icu-devel cups-devel qt5-${version}_${revision}
+		dbus-devel icu-devel cups-devel
+		qt5-gui-${version}_${revision}
+		qt5-dbus-${version}_${revision}
+		qt5-core-${version}_${revision}
+		qt5-widgets-${version}_${revision}
 		qt5-qmake-${version}_${revision}
+		qt5-opengl-${version}_${revision}
+		qt5-printsupport-${version}_${revision}
+		qt5-concurrent-${version}_${revision}
+		qt5-sql-${version}_${revision}
+		qt5-test-${version}_${revision}
+		qt5-network-${version}_${revision}
+		qt5-xml-${version}_${revision}
 		qt5-host-tools-${version}_${revision}"
 	short_desc+=" - Development files"
 	# qt5-enginio-devel is gone
@@ -1178,6 +1129,7 @@ qt5-plugin-tds_package() {
 
 qt5-qmake_package() {
 	short_desc+=" - Qmake Makefile generator tool"
+	depends="qtchooser"
 	pkg_install() {
 		vmove usr/lib/qt5/bin/qmake
 		vmove usr/lib/qt5/mkspecs

From 5a34b9ac34398403a198e65353f70dc2af97c884 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 2/9] New package: qt5-webengine-5.14.0

---
 srcpkgs/qt5-webengine-devel                   |   2 +-
 srcpkgs/qt5-webengine/files/resolv_compat.h   |  29 ++++
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 +++++
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 +++
 .../patches/0003-musl-dispatch-to-musl.patch  | 103 ++++++++++++
 .../patches/0004-musl-no-mallinfo.patch       |  40 +++++
 .../patches/0005-musl-off_t.patch             |  10 ++
 .../patches/0006-musl-pread-pwrite.patch      |  18 +++
 .../patches/0007-musl-replace-pvalloc.patch   |  14 ++
 .../patches/0008-musl-resolve.patch           |  26 +++
 .../patches/0009-musl-siginfo_t.patch         |  18 +++
 .../patches/0010-musl-stackstart.patch        |  20 +++
 .../patches/0011-musl-sandbox.patch           |  71 ++++++++
 ...0012-musl-chromium-default-stacksize.patch |  15 ++
 .../patches/0013-data_pack-be.patch           |  15 ++
 .../0014-musl-cross-no-asm_ptrace_h.patch     |  30 ++++
 .../qt5-webengine/patches/0015-yasm-nls.patch |  13 ++
 .../patches/0016-qt-musl-execinfo.patch       |  94 +++++++++++
 .../0017-qt-musl-thread-stacksize.patch       |  26 +++
 .../patches/0018-sandbox-membarrier.patch     |  60 +++++++
 .../patches/0019-gn-cross-sysroot.patch       |  24 +++
 .../patches/0020-msgvec-push_back.patch       |  14 ++
 .../patches/0021-sandbox-sched_getparam.patch |  24 +++
 .../0022-canonicalize-file-name-musl.patch    |  11 ++
 srcpkgs/qt5-webengine/template                | 151 ++++++++++++++++++
 25 files changed, 895 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webengine/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/files/resolv_compat.h b/srcpkgs/qt5-webengine/files/resolv_compat.h
new file mode 100644
index 00000000000..4f0e852a19d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/files/resolv_compat.h
@@ -0,0 +1,29 @@
+#if !defined(__GLIBC__)
+/***************************************************************************
+ * resolv_compat.h
+ *
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
+ * Note: res_init() is actually deprecated according to
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
+ **************************************************************************/
+#include <string.h>
+
+static inline int res_ninit(res_state statp)
+{
+	int rc = res_init();
+	if (statp != &_res) {
+		memcpy(statp, &_res, sizeof(*statp));
+	}
+	return rc;
+}
+
+static inline int res_nclose(res_state statp)
+{
+	if (!statp)
+		return -1;
+	if (statp != &_res) {
+		memset(statp, 0, sizeof(*statp));
+	}
+	return 0;
+}
+#endif
diff --git a/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch b/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
new file mode 100644
index 00000000000..c113ddb6566
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
++++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
+@@ -383,12 +383,6 @@
+ 
+ bool DataPack::GetStringPiece(uint16_t resource_id,
+                               base::StringPiece* data) const {
+-  // It won't be hard to make this endian-agnostic, but it's not worth
+-  // bothering to do right now.
+-#if !defined(ARCH_CPU_LITTLE_ENDIAN)
+-#error "datapack assumes little endian"
+-#endif
+-
+   const Entry* target = LookupEntryById(resource_id);
+   if (!target)
+     return false;
diff --git a/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
new file mode 100644
index 00000000000..75481a2889f
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
@@ -0,0 +1,14 @@
+--- qtwebengine-everywhere-src-5.14.0-beta2/src/3rdparty/chromium/net/socket/udp_socket_posix.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:41:46.699068889 +0100
+@@ -1191,7 +1191,11 @@
+     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+   msgvec->reserve(buffers.size());
+   for (size_t j = 0; j < buffers.size(); j++)
++#if defined(__GLIBC__)
+     msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++#else
++    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
++#endif
+   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+   SendResult send_result(0, 0, std::move(buffers));
+   if (result < 0) {
diff --git a/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
new file mode 100644
index 00000000000..a91e85eca3c
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
@@ -0,0 +1,24 @@
+Allow SYS_sched_getparam and SYS_sched_getscheduler
+musl uses them for pthread_getschedparam()
+
+source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
+
+--- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:33:51.865153684 +0100
+@@ -88,10 +88,16 @@
+     case __NR_sysinfo:
+     case __NR_times:
+     case __NR_uname:
++#if !defined(__GLIBC__)
++    case __NR_sched_getparam:
++    case __NR_sched_getscheduler:
++#endif
+       return Allow();
+     case __NR_sched_getaffinity:
++#if defined(__GLIBC__)
+     case __NR_sched_getparam:
+     case __NR_sched_getscheduler:
++#endif
+     case __NR_sched_setscheduler:
+       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+     case __NR_prlimit64:
diff --git a/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..e8b672569b5
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,151 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.0
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version}"
+archs="x86_64* i686* armv[67]* ppc64* aarch64*"
+build_style=qmake
+configure_args="--
+ -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if snapshot '' '-no')-webengine-v8-snapshot"
+# Rely on auto detection (fails if forced for cross builds) -webengine-alsa
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel MesaLib-devel"
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebengine-everywhere-src-${version}.tar.xz"
+checksum=74f8c11cc318612c8d9dc87cf791badb1efe7080c10d8b3ed5843b249a942d32
+patch_args="-Np1"
+
+build_options="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel qt5-location-devel
+	 qt5-declarative-devel"
+fi
+
+if [ "$XBPS_WORDSIZE" -eq 32 ]; then
+	nodebug=yes  # prevent OOM
+fi
+
+if [ ! "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
+	#TODO: look into working around this with -32bit packages
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	mips*|ppc*) makedepends+=" libatomic-devel" ;;
+	*) ;;
+esac
+
+# TODO: likely related to not matching wordsize
+case "$XBPS_TARGET_MACHINE" in
+	arm*|mips*);;
+	*) build_options_default="snapshot";;
+esac
+
+_bootstrap_gn() {
+	# Bootstrap gn (generate ninja)
+	echo "Bootstrapping 'gn'"
+	cd ${wrksrc}/src/3rdparty/gn
+	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
+	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
+		python2 build/gen.py --no-last-commit-position --out-path \
+			${wrksrc}/src/3rdparty/gn/out/Release --cc "$CC_host" \
+                        --cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
+	ninja -C out/Release gn
+	cd ${wrksrc}
+}
+
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+	export PATH=${PATH/\/builddir\/.xbps-qt5-webengine\/wrappers:/}
+	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns
+	
+	case "$XBPS_TARGET_MACHINE" in
+		armv5*|armv6*)  # Disable "yield" assembler instruction
+			sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
+				qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
+				-e 's;"yield";"nop";'
+			;;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl) export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152";;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		mips*)  # sgidefs.h is in /usr/include/asm
+			for f in \
+				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
+				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
+					sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
+			done
+			# Assume that RGBA order is correct for big endian CPUs
+			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
+				-e '/#error Read the comment at this location/d'
+			;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		_bootstrap_gn
+	fi
+}
+
+pre_build() {
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		#TODO: FIX!!!
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove usr/lib/qt5/plugins/designer
+		fi
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From dc23188f1f0d54c92f423d03cef906f8b8b73752 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 3/9] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 99 ++++++++++++++++++++++++++++++++-----
 1 file changed, 88 insertions(+), 11 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d024a8a6770 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -16,10 +16,76 @@ do_configure() {
 		msg_error "${pkgver}: Could not find qmake - missing in hostdepends?\n"
 	fi
 	if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
+		case $XBPS_TARGET_MACHINE in
+			i686*) _qt_arch=i386;;
+			x86_64*) _qt_arch=x86_64;;
+			aarch64*) _qt_arch=arm64;;
+			arm*) _qt_arch=arm;;
+			mips*) _qt_arch=mips;;
+		esac
+		mkdir -p "${wrksrc}/.target-spec/linux-g++"
+		cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC}
+QMAKE_CXX               = ${CXX}
+QMAKE_LINK              = ${CXX}
+QMAKE_LINK_C            = ${CC}
+QMAKE_LINK_SHLIB        = ${CXX}
+
+QMAKE_AR                = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY}
+QMAKE_NM                = ${NM} -P
+QMAKE_STRIP             = ${STRIP}
+
+QMAKE_CFLAGS            = ${CFLAGS}
+QMAKE_CXXFLAGS          = ${CXXFLAGS}
+QMAKE_LFLAGS            = ${LDFLAGS}
+load(qt_config)
+_EOF
+		echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
+
+		mkdir -p "${wrksrc}/.host-spec/linux-g++"
+		cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC_host}
+QMAKE_CXX               = ${CXX_host}
+QMAKE_LINK              = ${CXX_host}
+QMAKE_LINK_C            = ${CC_host}
+QMAKE_LINK_SHLIB        = ${CXX_host}
+
+QMAKE_AR                = gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY_host}
+QMAKE_NM                = ${NM_host} -P
+QMAKE_STRIP             = ${STRIP_host}
+
+QMAKE_CFLAGS            = ${CFLAGS_host}
+QMAKE_CXXFLAGS          = ${CXXFLAGS_host}
+QMAKE_LFLAGS            = ${LDFLAGS_host}
+load(qt_config)
+_EOF
+echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
 		cat > "${wrksrc}/qt.conf" <<_EOF
 [Paths]
 Sysroot=${XBPS_CROSS_BASE}
-Prefix=${XBPS_CROSS_BASE}/usr
+Prefix=/usr
 ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
 Data=${XBPS_CROSS_BASE}/usr/share/qt5
 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
@@ -38,18 +104,29 @@ HostPrefix=/usr
 HostData=/usr/lib/qt5
 HostBinaries=/usr/lib/qt5/bin
 HostLibraries=/usr/lib
-Spec=linux-g++
-TargetSpec=linux-g++
+Spec=${wrksrc}/.host-spec/linux-g++
+TargetSpec=${wrksrc}/.target-spec/linux-g++
 _EOF
-		qmake_args="-qtconf ${wrksrc}/qt.conf"
+		qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/pkg-config"
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			${configure_args}
+	else
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			QMAKE_CC=$CC QMAKE_CXX=$CXX \
+			QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
+			QMAKE_CFLAGS="${CFLAGS}" \
+			QMAKE_CXXFLAGS="${CXXFLAGS}" \
+			QMAKE_LFLAGS="${LDFLAGS}" \
+			${configure_args}
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
-		PREFIX=/usr \
-		LIB=/usr/lib \
-		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
-		QMAKE_CFLAGS="${CFLAGS}" \
-		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From e19004709408185a7d8f040b680e9debd2d4520f Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 4/9] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index 2519560d236..509c2319133 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -12,7 +12,7 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+3-devel libappindicator-devel
  libdbusmenu-glib-devel libopenal-devel minizip-devel opus-devel xxHash-devel
  pulseaudio-devel qt5-devel range-v3 libva-devel enchant2-devel
  rapidjson liblz4-devel rlottie-devel MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5-core>=5.14.0<5.14.1"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"
@@ -44,7 +44,7 @@ fi
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From c776bd35f2786a10b41b5f413ef27b7ce648fbbd Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:05:28 +0100
Subject: [PATCH 5/9] qt5-styleplugins: rebuild against qt5.14

---
 srcpkgs/qt5-styleplugins/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5-styleplugins/template b/srcpkgs/qt5-styleplugins/template
index f6c511cad4c..a6b058c8640 100644
--- a/srcpkgs/qt5-styleplugins/template
+++ b/srcpkgs/qt5-styleplugins/template
@@ -1,13 +1,13 @@
 # Template file for 'qt5-styleplugins'
 pkgname=qt5-styleplugins
 version=5.0.0
-revision=11
+revision=12
 _gitrev=335dbece103e2cbf6c7cf819ab6672c2956b17b3
 wrksrc="qtstyleplugins-${_gitrev}"
 build_style=qmake
 hostmakedepends="pkg-config qt5-host-tools qt5-devel"
 makedepends="libxcb-devel libxkbcommon-devel libinput-devel tslib-devel gtk+-devel qt5-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5>=5.14.0beta3<5.14.1"
 short_desc="Additional style plugins for Qt5"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="LGPL-2.1-only, LGPL-3.0-only"

From 11351c8832ada649272846e147ed6f7dbe72866f Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:27:31 +0100
Subject: [PATCH 6/9] qt5dxcb-plugin: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5dxcb-plugin/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/qt5dxcb-plugin/template b/srcpkgs/qt5dxcb-plugin/template
index b5408ed89fb..a10b5f70e02 100644
--- a/srcpkgs/qt5dxcb-plugin/template
+++ b/srcpkgs/qt5dxcb-plugin/template
@@ -1,14 +1,14 @@
 # Template file for 'qt5dxcb-plugin'
 pkgname=qt5dxcb-plugin
 version=5.0.1
-revision=3
+revision=4
 build_style=qmake
 make_build_args="VERSION=${version}"
 hostmakedepends="pkg-config qt5-qmake"
 makedepends="cairo-devel libSM-devel libXi-devel libxkbcommon-devel
  qt5-x11extras-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5>=5.14.0beta3<5.14.1"
 short_desc="Qt platform plugins for DDE"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later"
@@ -18,6 +18,8 @@ distfiles="https://github.com/linuxdeepin/qt5dxcb-plugin/archive/${version}.tar.
 checksum=b19253f9f577b2a9d86774ba95d252318f3d692ab92d2e62fbf0578d56db453d
 patch_args="-Np1"
 
+broken="TODO: USE THE CORRECT HEADERS"
+
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
@@ -33,7 +35,7 @@ pre_configure() {
 	# no headers for 5.13.1 yet; 5.13.0 headers are the same for this
 	# remove on next version upgrade (after upstream has added them)
 	ln -s ${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.0 \
-		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.2
+		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.14.0
 }
 
 if [ "$CROSS_BUILD" ]; then

From 9cf5091029f6511969131c04d65734feca9853fe Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Thu, 5 Dec 2019 08:42:41 +0100
Subject: [PATCH 7/9] kwin: rebuild against qt5.14.0

[ci skip]
---
 srcpkgs/kwin/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kwin/template b/srcpkgs/kwin/template
index fc6b1745e7d..e7f65c4724c 100644
--- a/srcpkgs/kwin/template
+++ b/srcpkgs/kwin/template
@@ -1,7 +1,7 @@
 # Template file for 'kwin'
 pkgname=kwin
 version=5.17.4
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules breeze pkg-config"
@@ -9,7 +9,7 @@ makedepends="plasma-framework-devel kcmutils-devel knewstuff-devel
  kscreenlocker-devel kinit-devel xcb-util-cursor-devel qt5-multimedia-devel
  kdecoration-devel libxkbcommon-devel libinput-devel libSM-devel
  libICE-devel xcb-util-wm-devel qt5-sensors-devel libcap-devel"
-depends="breeze hicolor-icon-theme kinit qt5>=5.13.2<5.13.3"
+depends="breeze hicolor-icon-theme kinit qt5-core>=5.14.0<5.14.1"
 short_desc="KDE Window manager"
 maintainer="John <johnz@posteo.net>"
 license="GPL-2.0-or-later"
@@ -29,7 +29,7 @@ esac
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 976dda224a1006d634a3762e4927f75c32c55a8e Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 13:31:14 +0100
Subject: [PATCH 8/9] plasma-framework: add patch for qt5.14

---
 srcpkgs/plasma-framework/patches/qt5.14.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/plasma-framework/patches/qt5.14.patch

diff --git a/srcpkgs/plasma-framework/patches/qt5.14.patch b/srcpkgs/plasma-framework/patches/qt5.14.patch
new file mode 100644
index 00000000000..c8b08ba04ba
--- /dev/null
+++ b/srcpkgs/plasma-framework/patches/qt5.14.patch
@@ -0,0 +1,18 @@
+Source: @Johnnynator
+Upstream: no (Need to verify if this isn't a qt5 bug)
+Reason: QLocale().uiLanguages() in Qt5.14 can return an empty list,
+	in previous Qt versions it had a minimum size of one with
+	locale"C" as content.
+
+--- src/declarativeimports/calendar/calendar.cpp	2019-11-02 14:02:23.000000000 +0100
++++ -	2019-12-13 19:22:09.178234731 +0100
+@@ -199,7 +199,8 @@
+     // locale and take the month name from that.
+     //
+     // See https://bugs.kde.org/show_bug.cgi?id=353715
+-    const QString lang = QLocale().uiLanguages().at(0);
++    const QStringList languages = QLocale().uiLanguages();
++    const QString lang = languages.size() > 0 ? languages.at(0) : QString();
+     // If lang is empty, it will create just a system locale
+     QLocale langLocale(lang);
+     return langLocale.standaloneMonthName(m_displayedDate.month());

From e59e4bbdfb035950c01757c81af5c9b717f57618 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 15:13:35 +0100
Subject: [PATCH 9/9] qt5-webkit: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5-webkit/patches/qt5.14.patch      | 93 ++++++++++++++++++++
 srcpkgs/qt5-webkit/patches/qt5.14.patch.args |  1 +
 srcpkgs/qt5-webkit/template                  |  2 +-
 3 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch.args

diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch b/srcpkgs/qt5-webkit/patches/qt5.14.patch
new file mode 100644
index 00000000000..799d53f1f55
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch
@@ -0,0 +1,93 @@
+From c344187a099f8fd749dc84ffcc125c0925103819 Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Tue, 10 Sep 2019 03:51:42 +0300
+Subject: Fix compilation of HTTP2 settings with Qt >= 5.14
+
+Public API QHttp2Configuration was added, so we use it now instead of
+ugly hack required for previous versions. Workaround for QTBUG-77308 is
+no loger needed in 5.14, so we only enable server push.
+
+Change-Id: I3e6817d8fa274c3a849f09b23ca58f93318be6c4
+---
+ .../network/qt/QNetworkReplyHandler.cpp       |  6 +++---
+ .../platform/network/qt/ResourceRequestQt.cpp | 20 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+index 0da45fbc79a5..7924595582ac 100644
+--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
++++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+@@ -41,7 +41,7 @@
+ 
+ #include <QCoreApplication>
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ #include <private/http2protocol_p.h>
+ #include <cstdlib>
+@@ -62,7 +62,7 @@ ProtocolParameters::ProtocolParameters()
+ 
+ QT_END_NAMESPACE
+ 
+-#endif // USE(HTTP2)
++#endif // USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ static const int gMaxRedirections = 10;
+ 
+@@ -797,7 +797,7 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
+     if (!manager)
+         return 0;
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+     static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
+     if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
+         Http2::ProtocolParameters params;
+diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+index 2cf2e7750dde..310738449b75 100644
+--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
++++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+@@ -29,7 +29,10 @@
+ 
+ #if USE(HTTP2)
+ #include <QSslSocket>
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++#include <QHttp2Configuration>
+ #endif
++#endif // USE(HTTP2)
+ 
+ namespace WebCore {
+ 
+@@ -65,6 +68,16 @@ bool ResourceRequest::alpnIsSupported()
+     return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
+         QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
+ }
++
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++static QHttp2Configuration createHttp2Configuration()
++{
++    QHttp2Configuration params;
++    params.setServerPushEnabled(true);
++    return params;
++}
++#endif
++
+ #endif
+ 
+ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
+@@ -76,8 +89,13 @@ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) co
+ 
+ #if USE(HTTP2)
+     static const bool NegotiateHttp2ForHttps = alpnIsSupported();
+-    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps)
++    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps) {
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++        static const auto params = createHttp2Configuration();
++        request.setHttp2Configuration(params);
++#endif
+         request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
++    }
+ #endif // USE(HTTP2)
+ 
+     const HTTPHeaderMap &headers = httpHeaderFields();
diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch.args b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
new file mode 100644
index 00000000000..2eba1cb3c5c
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
@@ -0,0 +1 @@
+-Np1
diff --git a/srcpkgs/qt5-webkit/template b/srcpkgs/qt5-webkit/template
index c7c09c1376e..4c8b3f6414f 100644
--- a/srcpkgs/qt5-webkit/template
+++ b/srcpkgs/qt5-webkit/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webkit'
 pkgname=qt5-webkit
 version=5.212.0
-revision=6
+revision=7
 _snap=1565895469
 _v=${version%.*}
 wrksrc="qtwebkit-everywhere-src-${_v}"

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (4 preceding siblings ...)
  2020-01-03 10:46 ` voidlinux-github
@ 2020-01-28 17:04 ` voidlinux-github
  2020-02-02 16:03 ` voidlinux-github
                   ` (27 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2020-01-28 17:04 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [ ] x86_64 (compiled and runtime)
- [ ] x86_64-musl (compiled, webengine seems to work https://i.imgur.com/0jpOBet.png (segfaults with sndio (?) also currently tries to fetch resources from `/share` instead of `/usr/share`, needs to be fixed.)
- [ ] i686 ()
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [ ] armv6l (compiled without webengine)
- [ ] aarch64-musl (compiled)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross (for some qmake packages)
- rebase webengine ppc patches @q66 
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- fix webengine loading resources from `/share` instead of `/usr/share`

# Bugs

- webengine currently tries to fetch resources from `/share` instead of `/usr/share
- Plasmashell wayland on musl crashes regulary 

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 440589 bytes --]

From a1624c4a1a972e3fe153e08e5e5094b2e474bff8 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 01/10] qt5: update to 5.14.1

---
 common/shlibs                                 |   33 +-
 srcpkgs/{qt5-webengine => qt5-base-docs}      |    0
 srcpkgs/qt5-concurrent                        |    1 +
 srcpkgs/qt5-core                              |    1 +
 srcpkgs/qt5-dbus                              |    1 +
 srcpkgs/qt5-gui                               |    1 +
 srcpkgs/qt5-network                           |    1 +
 srcpkgs/qt5-opengl                            |    1 +
 srcpkgs/qt5-printsupport                      |    1 +
 srcpkgs/qt5-quicktimeline                     |    1 +
 srcpkgs/qt5-sql                               |    1 +
 srcpkgs/qt5-test                              |    1 +
 srcpkgs/qt5-widgets                           |    1 +
 srcpkgs/qt5-xml                               |    1 +
 .../0090-hard-disable-qmlchachegen.patch      |   10 -
 srcpkgs/qt5/files/qmlcachegen.pro             |   38 +
 srcpkgs/qt5/files/qmlimportscanner.pro        |    2 +
 srcpkgs/qt5/files/qmllint.pro                 |   17 +-
 srcpkgs/qt5/files/qttools_src.pro             |   18 +-
 srcpkgs/qt5/files/resolv_compat.h             |   29 -
 srcpkgs/qt5/files/uic.pro                     |    1 +
 srcpkgs/qt5/files/uitools.pro                 |   15 +
 srcpkgs/qt5/patches/0001-musl-addlr.patch     |   23 +
 ...te-instead-of-_libc_fpstate-on-linux.patch |   42 -
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |   26 -
 .../patches/0004-musl-dispatch-to-musl.patch  |  103 -
 .../qt5/patches/0008-musl-no-mallinfo.patch   |   40 -
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |   10 -
 .../qt5/patches/0010-musl-pread-pwrite.patch  |   18 -
 .../patches/0011-musl-replace-pvalloc.patch   |   14 -
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |   26 -
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |   18 -
 .../qt5/patches/0017-musl-stackstart.patch    |   20 -
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |   71 -
 .../qt5/patches/0023-enable_tools-cross.patch |   46 -
 ...0025-musl-chromium-default-stacksize.patch |   15 -
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |   15 -
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0032-musl-cross-no-asm_ptrace_h.patch     |   30 -
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |   13 -
 .../0042-arm-void-is-not-android.patch        |   21 -
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  107 -
 .../0045-qt-musl-thread-stacksize.patch       |   26 -
 .../qt5/patches/0046-sandbox-membarrier.patch |   60 -
 .../qt5/patches/0047-gn-cross-sysroot.patch   |   24 -
 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch  |   33 +
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../patches/0100-sandbox-sched_getparam.patch |   24 -
 srcpkgs/qt5/template                          |  347 +-
 54 files changed, 312 insertions(+), 8506 deletions(-)
 rename srcpkgs/{qt5-webengine => qt5-base-docs} (100%)
 create mode 120000 srcpkgs/qt5-concurrent
 create mode 120000 srcpkgs/qt5-core
 create mode 120000 srcpkgs/qt5-dbus
 create mode 120000 srcpkgs/qt5-gui
 create mode 120000 srcpkgs/qt5-network
 create mode 120000 srcpkgs/qt5-opengl
 create mode 120000 srcpkgs/qt5-printsupport
 create mode 120000 srcpkgs/qt5-quicktimeline
 create mode 120000 srcpkgs/qt5-sql
 create mode 120000 srcpkgs/qt5-test
 create mode 120000 srcpkgs/qt5-widgets
 create mode 120000 srcpkgs/qt5-xml
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5/files/uitools.pro
 create mode 100644 srcpkgs/qt5/patches/0001-musl-addlr.patch
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch

diff --git a/common/shlibs b/common/shlibs
index 23d0a6a3c8e..95834e7fb29 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1918,6 +1918,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1930,6 +1931,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
@@ -1966,21 +1969,21 @@ libQt5WebEngineWidgets.so.5 qt5-webengine-5.6.0_1
 libQt5WebSockets.so.5 qt5-websockets-5.6.0_1
 libQt5X11Extras.so.5 qt5-x11extras-5.6.0_1
 libQt5XmlPatterns.so.5 qt5-xmlpatterns-5.6.0_1
-libQt5Core.so.5 qt5-5.6.0_1
-libQt5EglFSDeviceIntegration.so.5 qt5-5.8.0_1
-libQt5Network.so.5 qt5-5.6.0_1
-libQt5Sql.so.5 qt5-5.6.0_1
-libQt5Xml.so.5 qt5-5.6.0_1
-libQt5Gui.so.5 qt5-5.6.0_1
-libQt5Widgets.so.5 qt5-5.6.0_1
-libQt5Test.so.5 qt5-5.6.0_1
-libQt5DBus.so.5 qt5-5.6.0_1
-libQt5Concurrent.so.5 qt5-5.6.0_1
-libQt5OpenGL.so.5 qt5-5.6.0_1
-libQt5PrintSupport.so.5 qt5-5.6.0_1
-libQt5XcbQpa.so.5 qt5-5.6.0_1
-libQt5EglDeviceIntegration.so.5 qt5-5.6.0_1
-libQt5EglFsKmsSupport.so.5 qt5-5.7.1_1
+libQt5Core.so.5 qt5-core-5.14.0_1
+libQt5EglFSDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5Network.so.5 qt5-network-5.14.0_1
+libQt5Sql.so.5 qt5-sql-5.14.0_1
+libQt5Xml.so.5 qt5-xml-5.14.0_1
+libQt5Gui.so.5 qt5-gui-5.14.0_1
+libQt5Widgets.so.5 qt5-widgets-5.14.0_1
+libQt5Test.so.5 qt5-test-5.14.0_1
+libQt5DBus.so.5 qt5-dbus-5.14.0_1
+libQt5Concurrent.so.5 qt5-concurrent-5.14.0_1
+libQt5OpenGL.so.5 qt5-opengl-5.14.0_1
+libQt5PrintSupport.so.5 qt5-printsupport-5.14.0_1
+libQt5XcbQpa.so.5 qt5-gui-5.14.0_1
+libQt5EglDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5EglFsKmsSupport.so.5 qt5-gui-5.14.0_1
 libQt5WebKit.so.5 qt5-webkit-5.6.0_1
 libQt5WebKitWidgets.so.5 qt5-webkit-5.6.0_1
 libQt5TextToSpeech.so.5 qt5-speech-5.8.0_1
diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-base-docs
similarity index 100%
rename from srcpkgs/qt5-webengine
rename to srcpkgs/qt5-base-docs
diff --git a/srcpkgs/qt5-concurrent b/srcpkgs/qt5-concurrent
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-concurrent
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-core b/srcpkgs/qt5-core
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-core
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-dbus b/srcpkgs/qt5-dbus
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-dbus
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-gui b/srcpkgs/qt5-gui
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-gui
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-network b/srcpkgs/qt5-network
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-network
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-opengl b/srcpkgs/qt5-opengl
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-opengl
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-printsupport b/srcpkgs/qt5-printsupport
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-printsupport
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-quicktimeline b/srcpkgs/qt5-quicktimeline
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-quicktimeline
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-sql b/srcpkgs/qt5-sql
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-sql
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-test b/srcpkgs/qt5-test
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-test
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-widgets b/srcpkgs/qt5-widgets
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-widgets
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xml b/srcpkgs/qt5-xml
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xml
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b5963becd6c
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,38 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp
+TARGET = qmlcachegen
+
+include(../shared/shared.pri)
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmlimportscanner.pro b/srcpkgs/qt5/files/qmlimportscanner.pro
index 57c228b8540..ab1e851293a 100644
--- a/srcpkgs/qt5/files/qmlimportscanner.pro
+++ b/srcpkgs/qt5/files/qmlimportscanner.pro
@@ -3,6 +3,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
 
 SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
 
+include(../shared/shared.pri)
+
 QMAKE_TARGET_DESCRIPTION = QML Import Scanner
 
 load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/resolv_compat.h b/srcpkgs/qt5/files/resolv_compat.h
deleted file mode 100644
index 4f0e852a19d..00000000000
--- a/srcpkgs/qt5/files/resolv_compat.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#if !defined(__GLIBC__)
-/***************************************************************************
- * resolv_compat.h
- *
- * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
- * Note: res_init() is actually deprecated according to
- * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
- **************************************************************************/
-#include <string.h>
-
-static inline int res_ninit(res_state statp)
-{
-	int rc = res_init();
-	if (statp != &_res) {
-		memcpy(statp, &_res, sizeof(*statp));
-	}
-	return rc;
-}
-
-static inline int res_nclose(res_state statp)
-{
-	if (!statp)
-		return -1;
-	if (statp != &_res) {
-		memset(statp, 0, sizeof(*statp));
-	}
-	return 0;
-}
-#endif
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/files/uitools.pro b/srcpkgs/qt5/files/uitools.pro
new file mode 100644
index 00000000000..51e22b14506
--- /dev/null
+++ b/srcpkgs/qt5/files/uitools.pro
@@ -0,0 +1,15 @@
+TARGET = QtUiTools
+CONFIG += static
+
+include(../lib/uilib/uilib.pri)
+
+QMAKE_DOCS = $$PWD/doc/qtuitools.qdocconf
+
+HEADERS += quiloader.h
+SOURCES += quiloader.cpp
+
+DEFINES += \
+    QFORMINTERNAL_NAMESPACE \
+    QT_DESIGNER_STATIC
+
+load(qt_module)
diff --git a/srcpkgs/qt5/patches/0001-musl-addlr.patch b/srcpkgs/qt5/patches/0001-musl-addlr.patch
new file mode 100644
index 00000000000..6dd1694cdde
--- /dev/null
+++ b/srcpkgs/qt5/patches/0001-musl-addlr.patch
@@ -0,0 +1,23 @@
+Source: John <johnz@posteo.net>
+Upsteam: No
+Subject: Musl returns /lib/libQt5Core.so.5 for Dl_info.dli_fname. 
+GLIBC's dl behaves differently and therefore the path is prefixed with /usr.
+This broke e.g. qt5-webengine on musl.
+---
+diff --git qtbasesrc/corelib/global/qlibraryinfo.cpp qtbasesrc/corelib/global/qlibraryinfo.cpp
+index 8bcf67e73d..28d7355310 100644
+--- qtbase/src/corelib/global/qlibraryinfo.cpp
++++ qtbase/src/corelib/global/qlibraryinfo.cpp
+@@ -558,6 +558,12 @@ static QString getRelocatablePrefix()
+     int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info);
+     if (result > 0 && info.dli_fname)
+         prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLatin1(info.dli_fname));
++#ifndef __GLIBC__
++    QDir prefixDir(prefixPath);
++    if (prefixDir.isRoot()) {
++        prefixPath = "/usr";
++    }
++#endif
+ #elif defined(Q_OS_WIN)
+     HMODULE hModule = getWindowsModuleHandle();
+     const int kBufferSize = 4096;
diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index c332b92b69d..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -100,14 +100,14 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
- #else
-   return minfo.hblkhd + minfo.arena;
- #endif
--#elif defined(OS_FUCHSIA)
-+#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
-   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
-   return 0;
- #endif
-
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index b13290d3ccd..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_tools:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index 98f3a38745a..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,107 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
new file mode 100644
index 00000000000..2eeae632cfe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
@@ -0,0 +1,33 @@
+Submodule qtbase contains untracked content
+Submodule qtbase contains modified content
+diff --git qtbase/mkspecs/features/qt_build_config.prf qtbase/mkspecs/features/qt_build_config.prf
+index 8273ba3fe1..b674f42109 100644
+--- qtbase/mkspecs/features/qt_build_config.prf
++++ qtbase/mkspecs/features/qt_build_config.prf
+@@ -11,6 +11,10 @@
+ 
+ !contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
+     QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
++    defined(QMAKE_TARGET_MODULE,var):exists($$QMAKE_TARGET_MODULE) {
++        QMAKE_QT_MODULE = $$QMAKE_TARGET_MODULE
++        message("Trying .qmodule.pri from ($$QMAKE_QT_CONFIG)")
++    }
+     !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) {
+         debug(1, "Cannot load qmodule.pri!")
+     } else {
+diff --git qtbase/mkspecs/features/qt_config.prf qtbase/mkspecs/features/qt_config.prf
+index 93c54e3010..aaff26b52a 100644
+--- qtbase/mkspecs/features/qt_config.prf
++++ qtbase/mkspecs/features/qt_config.prf
+@@ -1,6 +1,10 @@
+ # This file is loaded as one of the last things by all qmakespecs.
+ 
+ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
++defined(QMAKE_TARGET_CONFIG,var):exists($$QMAKE_TARGET_CONFIG) {
++   QMAKE_QT_CONFIG = $$QMAKE_TARGET_CONFIG
++   message("Trying .qconfig.pri from ($$QMAKE_QT_CONFIG)")
++}
+ !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
+    debug(1, "Cannot load qconfig.pri!")
+ } else {
+Submodule qtwebengine contains untracked content
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch b/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
deleted file mode 100644
index 15c33a57f03..00000000000
--- a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Allow SYS_sched_getparam and SYS_sched_getscheduler
-musl uses them for pthread_getschedparam()
-
-source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
-
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-11-12 20:48:20.013724661 +0100
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc.patched	2019-11-12 20:58:57.330695676 +0100
-@@ -93,10 +93,16 @@
-     case __NR_sysinfo:
-     case __NR_times:
-     case __NR_uname:
-+#if !defined(__GLIBC__)
-+    case __NR_sched_getparam:
-+    case __NR_sched_getscheduler:
-+#endif
-       return Allow();
-     case __NR_sched_getaffinity:
-+#if defined(__GLIBC__)
-     case __NR_sched_getparam:
-     case __NR_sched_getscheduler:
-+#endif
-     case __NR_sched_setscheduler:
-       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
-     case __NR_prlimit64:
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b0205530a13..22c09d55b05 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,91 +1,31 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
-revision=2
+version=5.14.1
+revision=1
+build_style=meta
 wrksrc="qt-everywhere-src-${version}"
-build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
- protobuf python re2c ruby which"
+hostmakedepends="cmake clang flex git glib-devel pkg-config
+ python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
-depends="qtchooser"
+depends="qt5-dbus qt5-gui qt5-core qt5-widgets qt5-network qt5-xml
+ qt5-test qt5-sql qt5-concurrent qt5-printsupport qt5-opengl"
 short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+checksum=6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
-build_options="webengine"
-desc_option_webengine="Build Chromium-based WebEngine component"
-
-makedepends+=" harfbuzz-devel"
-
-if [ "$XBPS_LIBC" = "musl" ]; then
-	hostmakedepends+=" musl-legacy-compat"
-fi
-if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat"
-fi
-
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
-if [ "$build_option_webengine" ]; then
-	# v8 requires libatomic on armv[56]*/ppc*/s390x/mips*
-	case "$XBPS_TARGET_MACHINE" in
-		armv[56]*|mips*|ppc*) makedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-	# also need it on host when it's one of those archs
-	case "$XBPS_MACHINE" in
-		armv[56]*|mips*|ppc*) hostmakedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-fi
-
-subpackages="qt5-3d qt5-3d-devel qt5-charts qt5-charts-devel
- qt5-connectivity qt5-connectivity-devel qt5-datavis3d qt5-datavis3d-devel
- qt5-declarative qt5-declarative-devel qt5-devel qt5-examples qt5-gamepad
- qt5-gamepad-devel qt5-graphicaleffects qt5-host-tools qt5-imageformats
- qt5-location qt5-location-devel qt5-multimedia qt5-multimedia-devel
- qt5-networkauth qt5-networkauth-devel qt5-plugin-mysql qt5-plugin-odbc
- qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds qt5-purchasing
- qt5-purchasing-devel qt5-qmake qt5-quickcontrols qt5-quickcontrols2
- qt5-quickcontrols2-devel qt5-remoteobjects qt5-remoteobjects-devel
- qt5-script qt5-script-devel qt5-scxml qt5-scxml-devel qt5-sensors
- qt5-sensors-devel qt5-serialbus qt5-serialbus-devel qt5-serialport
- qt5-serialport-devel qt5-speech qt5-speech-devel qt5-svg qt5-svg-devel
- qt5-tools qt5-tools-devel qt5-translations qt5-virtualkeyboard
- qt5-virtualkeyboard-devel qt5-wayland qt5-wayland-devel qt5-webchannel
- qt5-webchannel-devel qt5-webglplugin qt5-webglplugin-devel qt5-websockets
- qt5-websockets-devel qt5-webview qt5-webview-devel qt5-x11extras
- qt5-x11extras-devel qt5-xmlpatterns qt5-xmlpatterns-devel
- qt5-lottie qt5-lottie-devel"
-
-if [ "$build_option_webengine" ]; then
-	subpackages+=" qt5-webengine qt5-webengine-devel"
-fi
-
-if [ "$XBPS_WORDSIZE" -eq 32 ]; then
-	nodebug=yes  # prevent OOM
-fi
-
 # Work around SSLv3_{client,server}_method missing in libressl-2.3.3
 CFLAGS="-DOPENSSL_NO_PSK -DOPENSSL_NO_NEXTPROTONEG"
 CXXFLAGS="${CFLAGS} -Wno-deprecated-declarations -Wno-class-memaccess -Wno-packed-not-aligned"
@@ -97,26 +37,8 @@ if [ "$CROSS_BUILD" ]; then
 	# wayland-devel contains /usr/bin/wayland-scanner
 	hostmakedepends+=" icu-devel wayland-devel zlib-devel"
 	hostmakedepends+=" postgresql-libs-devel"
-	# Cross building qtwebengine requires some more host packages
-	if [ "$build_option_webengine" ]; then
-		hostmakedepends+=" nss-devel libevent-devel"
-	fi
 fi
 
-_bootstrap_gn() {
-	# Bootstrap gn (generate ninja)
-	echo "Bootstrapping 'gn'"
-	cd ${wrksrc}/qtwebengine/src/3rdparty/gn
-	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
-	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
-		python2 build/gen.py --no-last-commit-position --out-path \
-			${wrksrc}/qtwebengine/src/3rdparty/gn/out/Release --cc "$CC_host" \
-			--cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
-	ninja -C out/Release gn
-	cd ${wrksrc}
-}
-
-
 _cleanup_wrksrc_leak() {
 	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
 		# Replace references to ${wrksrc} in cmake files
@@ -171,6 +93,11 @@ _install_devel() {
 	local module=$1
 	cd ${wrksrc}/${module}
 	make INSTALL_ROOT=${PKGDESTDIR} install
+	vmkdir usr/lib/qt5/mkspecs/modules
+	if [ -d "${PKGDESTDIR}${wrksrc}/host/mkspecs/modules" ]; then
+		mv -nv ${PKGDESTDIR}${wrksrc}/host/mkspecs/modules/* \
+			${PKGDESTDIR}/usr/lib/qt5/mkspecs/modules/
+	fi
 	rm -rf ${PKGDESTDIR}/builddir
 	rm -rf ${PKGDESTDIR}/usr/share
 	rm -rf ${PKGDESTDIR}/usr/lib/qt5/bin
@@ -241,32 +168,6 @@ _msg_cross() {
 do_configure() {
 	local opts spec
 
-	# Compatibility functions res_ninit() and res_nclose() for musl libc
-	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/qtwebengine/src/3rdparty/chromium/net/dns
-
-	case "$XBPS_TARGET_MACHINE" in
-	armv5*|armv6*)	# Disable "yield" assembler instruction
-		sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
-			qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
-			-e 's;"yield";"nop";'
-		;;
-	esac
-
-	case "$XBPS_TARGET_MACHINE" in
-	*-musl)
-		# Patch .../linux/*/config.{h,asm} to define HAVE_SYSCTL 0
-		local config chromium=${wrksrc}/qtwebengine/src/3rdparty/chromium
-		for config in $(find ${chromium}/third_party/ffmpeg/chromium/config -name "config\.*" | grep linux); do
-			sed -i ${config} -e "s;HAVE_SYSCTL 1;HAVE_SYSCTL 0;"
-		done
-		# Do not use allocator shim (incompatible with musl libc)
-		sed -i qtwebengine/src/3rdparty/chromium/build/config/allocator.gni \
-			-e "s;\(use_allocator_shim\) = .*;\1 = false;"
-		# Define to set 2 MiB stack size for qthread
-		export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152"
-		;;
-	esac
-
 	# Cross build patches
 	if [ "$CROSS_BUILD" ]; then
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
@@ -279,28 +180,6 @@ do_configure() {
 		for d in $(ls ${wrksrc}/qtbase/include); do
 			ln -sfv ${version}/${d}/private qtbase/include/${d}/private
 		done
-		if [ "$build_option_webengine" ]; then
-			_bootstrap_gn
-		fi
-
-		case "$XBPS_TARGET_MACHINE" in
-		mips*)	# sgidefs.h is in /usr/include/asm
-			for f in \
-				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
-				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
-				sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
-			done
-			# Assume that RGBA order is correct for big endian CPUs
-			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
-				-e '/#error Read the comment at this location/d'
-			;;
-		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -348,29 +227,10 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
-	# Rely on auto detection (fails if forced for cross builds)
-	if [ "$build_option_webengine" ]; then
-		# opts+=" -webengine-alsa"
-		opts+=" -no-webengine-embedded-build"
-		opts+=" -webengine-icu"
-		opts+=" -webengine-ffmpeg"
-		opts+=" -webengine-opus"
-		opts+=" -webengine-webp"
-		opts+=" -webengine-pepper-plugins"
-		opts+=" -webengine-printing-and-pdf"
-		opts+=" -webengine-proprietary-codecs"
-		opts+=" -webengine-pulseaudio"
-		opts+=" -webengine-spellchecker"
-		opts+=" -webengine-webrtc"
-		opts+=" -webengine-geolocation"
-		opts+=" -webengine-v8-snapshot"
-	fi
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	opts+=" -silent"
 	# opts+=" -v"
-	# make sure to disable webengine on platforms that we don't build it for
-	if [ -z "$build_option_webengine" ]; then
-		opts+=" -skip qtwebengine"
-	fi
+	opts+=" -skip qtwebengine"
 	LDFLAGS+=" -Wl,--no-keep-memory"  # needs more than 8GB RAM else
 	if [ "$CROSS_BUILD" ]; then
 		spec=void-${XBPS_CROSS_TRIPLET}-g++
@@ -380,33 +240,13 @@ do_configure() {
 		opts+=" -sysroot ${XBPS_CROSS_BASE}"
 		opts+=" -hostprefix host"
 		opts+=" -extprefix /usr"
-		case "$XBPS_TARGET_MACHINE" in
-		arm*|mips*)
-			if [ "$build_option_webengine" ]; then
-				# V8 snapshot can't be built with a 64 bit host compiler
-				opts+=" -no-webengine-v8-snapshot"
-			fi
-			;;
-		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
 		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
 		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
 		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		cp -v ${FILESDIR}/uitools.pro qttools/src/designer/src/uitools/uitools.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -419,10 +259,10 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes
+	# or some other files
 	make ${makejobs} || make ${makejobs}
 }
 
@@ -494,12 +334,15 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"
 		dirs+=" qtbase/src/tools/uic"
 		dirs+=" qtbase/src/tools/qdbuscpp2xml"
 		dirs+=" qtbase/src/tools/qdbusxml2cpp"
+		dirs+=" qtbase/src/tools/qvkgen"
+		dirs+=" qtbase/src/tools/tracegen"
 		dirs+=" qtbase/src/tools/qlalr"
 		dirs+=" qt3d/tools/qgltf"
 		dirs+=" qtremoteobjects/tools/repc"
@@ -571,6 +414,102 @@ do_install() {
 	rm -rf ${DESTDIR}/builddir
 }
 
+qt5-gui_package() {
+	short_desc+=" - Gui"
+	pkg_install() {
+		vmove "usr/lib/libQt5Gui.so*"
+		vmove "usr/lib/libQt5XcbQpa.so*"
+		vmove "usr/lib/libQt5EglFSDeviceIntegration.so*"
+		vmove "usr/lib/libQt5EglFsKmsSupport.so*"
+		vmove usr/lib/qt5/plugins/generic
+		vmove usr/lib/qt5/plugins/platforms
+		vmove usr/lib/qt5/plugins/xcbglintegrations
+		vmove usr/lib/qt5/plugins/imageformats
+		vmove usr/lib/qt5/plugins/egldeviceintegrations
+		vmove usr/lib/qt5/plugins/platforminputcontexts
+		vmove usr/lib/qt5/plugins/platformthemes
+	}
+}
+
+qt5-dbus_package() {
+	short_desc+=" - DBus"
+	pkg_install() {
+		vmove "usr/lib/libQt5DBus.so*"
+	}
+}
+
+qt5-core_package() {
+	short_desc+=" - Core"
+	pkg_install() {
+		vmove "usr/lib/libQt5Core.so*"
+	}
+}
+
+qt5-opengl_package() {
+	short_desc+=" - OpenGL"
+	pkg_install() {
+		vmove "usr/lib/libQt5OpenGL.so*"
+	}
+}
+
+qt5-printsupport_package() {
+	short_desc+=" - Print Support"
+	pkg_install() {
+		vmove "usr/lib/libQt5PrintSupport.so*"
+		vmove usr/lib/qt5/plugins/printsupport
+	}
+}
+
+qt5-concurrent_package() {
+	short_desc+=" - Concurrency"
+	pkg_install() {
+		vmove "usr/lib/libQt5Concurrent.so*"
+	}
+}
+
+qt5-widgets_package() {
+	short_desc+=" - Widgets"
+	pkg_install() {
+		vmove "usr/lib/libQt5Widgets.so*"
+	}
+}
+
+qt5-network_package() {
+	short_desc+=" - Network"
+	pkg_install() {
+		vmove "usr/lib/libQt5Network.so*"
+		vmove usr/lib/qt5/plugins/bearer
+	}
+}
+
+qt5-sql_package() {
+	short_desc+=" - Sql"
+	pkg_install() {
+		vmove "usr/lib/libQt5Sql.so*"
+	}
+}
+
+qt5-test_package() {
+	short_desc+=" - Test"
+	pkg_install() {
+		vmove "usr/lib/libQt5Test.so*"
+	}
+}
+
+qt5-xml_package() {
+	short_desc+=" - Xml"
+	pkg_install() {
+		vmove "usr/lib/libQt5Xml.so*"
+	}
+}
+
+qt5-base-docs_package() {
+	short_desc+=" - Documentation"
+	pkg_install() {
+		vmove usr/share/doc/qt5
+	}
+}
+
 qt5-3d-devel_package() {
 	short_desc+=" - C++ and QML APIs for 3D graphics (development)"
 	depends="qt5-3d-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -644,7 +583,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 
@@ -791,6 +730,13 @@ qt5-quickcontrols2_package() {
 	}
 }
 
+qt5-quicktimeline_package() {
+	short_desc+=" - Keyframe-based animations"
+	pkg_install() {
+		_install_subpkg qtquicktimeline
+	}
+}
+
 qt5-remoteobjects-devel_package() {
 	short_desc+=" - Remote Objects (development)"
 	depends="qt5-remoteobjects-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -959,21 +905,6 @@ qt5-webchannel_package() {
 	}
 }
 
-qt5-webengine-devel_package() {
-	short_desc+=" - WebEngine component (development)"
-	depends="qt5-webengine-${version}_${revision} qt5-devel-${version}_${revision}"
-	pkg_install() {
-		_install_devel qtwebengine
-	}
-}
-
-qt5-webengine_package() {
-	short_desc+=" - WebEngine component"
-	pkg_install() {
-		_install_subpkg qtwebengine
-	}
-}
-
 qt5-webglplugin-devel_package() {
 	short_desc+=" - WebGL plugin (development)"
 	depends="qt5-webglplugin-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -1044,6 +975,7 @@ qt5-xmlpatterns-devel_package() {
 
 qt5-xmlpatterns_package() {
 	short_desc+=" - XML components"
+	depends="qtchooser"
 	pkg_install() {
 		_install_subpkg qtxmlpatterns
 	}
@@ -1058,12 +990,13 @@ qt5-translations_package() {
 
 qt5-host-tools_package() {
 	short_desc+=" - Tools required when cross compiling"
+	depends="qtchooser"
 	pkg_install() {
 		local dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-tools-${version}
 		vmkdir usr/lib/qt5/bin
 		vmkdir usr/bin
-		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp \
-			lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
+		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp qvkgen fixqt4headers.pl tracegen \
+			syncqt.pl lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
 			if [ -r ${dest}/usr/lib/qt5/bin/${f} ]; then
 				mv -v ${dest}/usr/lib/qt5/bin/${f} ${PKGDESTDIR}/usr/lib/qt5/bin/
 			fi
@@ -1092,7 +1025,7 @@ qt5-tools-devel_package() {
 
 qt5-tools_package() {
 	short_desc+=" - Development tools"
-	depends="qt5-translations desktop-file-utils hicolor-icon-theme"
+	depends="qtchooser qt5-translations desktop-file-utils hicolor-icon-theme"
 	pkg_install() {
 		local f dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-host-tools-${version}
 		_install_subpkg qttools
@@ -1133,8 +1066,19 @@ qt5-tools_package() {
 qt5-devel_package() {
 	depends="zlib-devel libressl-devel>=2.1.4 libXext-devel libXrender-devel
 		fontconfig-devel libglib-devel MesaLib-devel mtdev-devel
-		dbus-devel icu-devel cups-devel qt5-${version}_${revision}
+		dbus-devel icu-devel cups-devel
+		qt5-gui-${version}_${revision}
+		qt5-dbus-${version}_${revision}
+		qt5-core-${version}_${revision}
+		qt5-widgets-${version}_${revision}
 		qt5-qmake-${version}_${revision}
+		qt5-opengl-${version}_${revision}
+		qt5-printsupport-${version}_${revision}
+		qt5-concurrent-${version}_${revision}
+		qt5-sql-${version}_${revision}
+		qt5-test-${version}_${revision}
+		qt5-network-${version}_${revision}
+		qt5-xml-${version}_${revision}
 		qt5-host-tools-${version}_${revision}"
 	short_desc+=" - Development files"
 	# qt5-enginio-devel is gone
@@ -1185,6 +1129,7 @@ qt5-plugin-tds_package() {
 
 qt5-qmake_package() {
 	short_desc+=" - Qmake Makefile generator tool"
+	depends="qtchooser"
 	pkg_install() {
 		vmove usr/lib/qt5/bin/qmake
 		vmove usr/lib/qt5/mkspecs

From d48a1f6a6a353f79dbdb63ea59a22cc678489f3e Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 02/10] New package: qt5-webengine-5.14.1

---
 srcpkgs/qt5-webengine-devel                   |   2 +-
 srcpkgs/qt5-webengine/files/resolv_compat.h   |  29 ++++
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 +++++
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 +++
 .../patches/0003-musl-dispatch-to-musl.patch  | 103 ++++++++++++
 .../patches/0004-musl-no-mallinfo.patch       |  40 +++++
 .../patches/0005-musl-off_t.patch             |  10 ++
 .../patches/0006-musl-pread-pwrite.patch      |  18 +++
 .../patches/0007-musl-replace-pvalloc.patch   |  14 ++
 .../patches/0008-musl-resolve.patch           |  26 +++
 .../patches/0009-musl-siginfo_t.patch         |  18 +++
 .../patches/0010-musl-stackstart.patch        |  20 +++
 .../patches/0011-musl-sandbox.patch           |  71 ++++++++
 ...0012-musl-chromium-default-stacksize.patch |  15 ++
 .../patches/0013-data_pack-be.patch           |  15 ++
 .../0014-musl-cross-no-asm_ptrace_h.patch     |  30 ++++
 .../qt5-webengine/patches/0015-yasm-nls.patch |  13 ++
 .../patches/0016-qt-musl-execinfo.patch       |  94 +++++++++++
 .../0017-qt-musl-thread-stacksize.patch       |  26 +++
 .../patches/0018-sandbox-membarrier.patch     |  60 +++++++
 .../patches/0019-gn-cross-sysroot.patch       |  24 +++
 .../patches/0020-msgvec-push_back.patch       |  14 ++
 .../patches/0021-sandbox-sched_getparam.patch |  24 +++
 .../0022-canonicalize-file-name-musl.patch    |  11 ++
 srcpkgs/qt5-webengine/template                | 151 ++++++++++++++++++
 25 files changed, 895 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webengine/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/files/resolv_compat.h b/srcpkgs/qt5-webengine/files/resolv_compat.h
new file mode 100644
index 00000000000..4f0e852a19d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/files/resolv_compat.h
@@ -0,0 +1,29 @@
+#if !defined(__GLIBC__)
+/***************************************************************************
+ * resolv_compat.h
+ *
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
+ * Note: res_init() is actually deprecated according to
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
+ **************************************************************************/
+#include <string.h>
+
+static inline int res_ninit(res_state statp)
+{
+	int rc = res_init();
+	if (statp != &_res) {
+		memcpy(statp, &_res, sizeof(*statp));
+	}
+	return rc;
+}
+
+static inline int res_nclose(res_state statp)
+{
+	if (!statp)
+		return -1;
+	if (statp != &_res) {
+		memset(statp, 0, sizeof(*statp));
+	}
+	return 0;
+}
+#endif
diff --git a/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch b/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
new file mode 100644
index 00000000000..c113ddb6566
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0013-data_pack-be.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
++++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
+@@ -383,12 +383,6 @@
+ 
+ bool DataPack::GetStringPiece(uint16_t resource_id,
+                               base::StringPiece* data) const {
+-  // It won't be hard to make this endian-agnostic, but it's not worth
+-  // bothering to do right now.
+-#if !defined(ARCH_CPU_LITTLE_ENDIAN)
+-#error "datapack assumes little endian"
+-#endif
+-
+   const Entry* target = LookupEntryById(resource_id);
+   if (!target)
+     return false;
diff --git a/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
new file mode 100644
index 00000000000..75481a2889f
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
@@ -0,0 +1,14 @@
+--- qtwebengine-everywhere-src-5.14.0-beta2/src/3rdparty/chromium/net/socket/udp_socket_posix.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:41:46.699068889 +0100
+@@ -1191,7 +1191,11 @@
+     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+   msgvec->reserve(buffers.size());
+   for (size_t j = 0; j < buffers.size(); j++)
++#if defined(__GLIBC__)
+     msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++#else
++    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
++#endif
+   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+   SendResult send_result(0, 0, std::move(buffers));
+   if (result < 0) {
diff --git a/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
new file mode 100644
index 00000000000..a91e85eca3c
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
@@ -0,0 +1,24 @@
+Allow SYS_sched_getparam and SYS_sched_getscheduler
+musl uses them for pthread_getschedparam()
+
+source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
+
+--- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:33:51.865153684 +0100
+@@ -88,10 +88,16 @@
+     case __NR_sysinfo:
+     case __NR_times:
+     case __NR_uname:
++#if !defined(__GLIBC__)
++    case __NR_sched_getparam:
++    case __NR_sched_getscheduler:
++#endif
+       return Allow();
+     case __NR_sched_getaffinity:
++#if defined(__GLIBC__)
+     case __NR_sched_getparam:
+     case __NR_sched_getscheduler:
++#endif
+     case __NR_sched_setscheduler:
+       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+     case __NR_prlimit64:
diff --git a/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..84f7530aca7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,151 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version}"
+archs="x86_64* i686* armv[67]* ppc64* aarch64*"
+build_style=qmake
+configure_args="--
+ -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if snapshot '' '-no')-webengine-v8-snapshot"
+# Rely on auto detection (fails if forced for cross builds) -webengine-alsa
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel MesaLib-devel musl-legacy-compat"
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebengine-everywhere-src-${version}.tar.xz"
+checksum=4ec77040a876a83aa2a833ebfe7b3e88dcc167ceb317095eb226a0b8d455e887
+patch_args="-Np1"
+
+build_options="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel qt5-location-devel
+	 qt5-declarative-devel"
+fi
+
+if [ "$XBPS_WORDSIZE" -eq 32 ]; then
+	nodebug=yes  # prevent OOM
+fi
+
+if [ ! "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
+	#TODO: look into working around this with -32bit packages
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	mips*|ppc*) makedepends+=" libatomic-devel" ;;
+	*) ;;
+esac
+
+# TODO: likely related to not matching wordsize
+case "$XBPS_TARGET_MACHINE" in
+	arm*|mips*);;
+	*) build_options_default="snapshot";;
+esac
+
+_bootstrap_gn() {
+	# Bootstrap gn (generate ninja)
+	echo "Bootstrapping 'gn'"
+	cd ${wrksrc}/src/3rdparty/gn
+	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
+	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
+		python2 build/gen.py --no-last-commit-position --out-path \
+			${wrksrc}/src/3rdparty/gn/out/Release --cc "$CC_host" \
+                        --cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
+	ninja -C out/Release gn
+	cd ${wrksrc}
+}
+
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+	export PATH=${PATH/\/builddir\/.xbps-qt5-webengine\/wrappers:/}
+	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns
+	
+	case "$XBPS_TARGET_MACHINE" in
+		armv5*|armv6*)  # Disable "yield" assembler instruction
+			sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
+				qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
+				-e 's;"yield";"nop";'
+			;;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl) export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152";;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		mips*)  # sgidefs.h is in /usr/include/asm
+			for f in \
+				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
+				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
+					sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
+			done
+			# Assume that RGBA order is correct for big endian CPUs
+			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
+				-e '/#error Read the comment at this location/d'
+			;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		_bootstrap_gn
+	fi
+}
+
+pre_build() {
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		#TODO: FIX!!!
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove usr/lib/qt5/plugins/designer
+		fi
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From affd953b8ad9e04ae2ffe9525e74ca5c9cef1974 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 03/10] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 99 ++++++++++++++++++++++++++++++++-----
 1 file changed, 88 insertions(+), 11 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..d024a8a6770 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -16,10 +16,76 @@ do_configure() {
 		msg_error "${pkgver}: Could not find qmake - missing in hostdepends?\n"
 	fi
 	if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
+		case $XBPS_TARGET_MACHINE in
+			i686*) _qt_arch=i386;;
+			x86_64*) _qt_arch=x86_64;;
+			aarch64*) _qt_arch=arm64;;
+			arm*) _qt_arch=arm;;
+			mips*) _qt_arch=mips;;
+		esac
+		mkdir -p "${wrksrc}/.target-spec/linux-g++"
+		cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC}
+QMAKE_CXX               = ${CXX}
+QMAKE_LINK              = ${CXX}
+QMAKE_LINK_C            = ${CC}
+QMAKE_LINK_SHLIB        = ${CXX}
+
+QMAKE_AR                = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY}
+QMAKE_NM                = ${NM} -P
+QMAKE_STRIP             = ${STRIP}
+
+QMAKE_CFLAGS            = ${CFLAGS}
+QMAKE_CXXFLAGS          = ${CXXFLAGS}
+QMAKE_LFLAGS            = ${LDFLAGS}
+load(qt_config)
+_EOF
+		echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
+
+		mkdir -p "${wrksrc}/.host-spec/linux-g++"
+		cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC_host}
+QMAKE_CXX               = ${CXX_host}
+QMAKE_LINK              = ${CXX_host}
+QMAKE_LINK_C            = ${CC_host}
+QMAKE_LINK_SHLIB        = ${CXX_host}
+
+QMAKE_AR                = gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY_host}
+QMAKE_NM                = ${NM_host} -P
+QMAKE_STRIP             = ${STRIP_host}
+
+QMAKE_CFLAGS            = ${CFLAGS_host}
+QMAKE_CXXFLAGS          = ${CXXFLAGS_host}
+QMAKE_LFLAGS            = ${LDFLAGS_host}
+load(qt_config)
+_EOF
+echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
 		cat > "${wrksrc}/qt.conf" <<_EOF
 [Paths]
 Sysroot=${XBPS_CROSS_BASE}
-Prefix=${XBPS_CROSS_BASE}/usr
+Prefix=/usr
 ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
 Data=${XBPS_CROSS_BASE}/usr/share/qt5
 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
@@ -38,18 +104,29 @@ HostPrefix=/usr
 HostData=/usr/lib/qt5
 HostBinaries=/usr/lib/qt5/bin
 HostLibraries=/usr/lib
-Spec=linux-g++
-TargetSpec=linux-g++
+Spec=${wrksrc}/.host-spec/linux-g++
+TargetSpec=${wrksrc}/.target-spec/linux-g++
 _EOF
-		qmake_args="-qtconf ${wrksrc}/qt.conf"
+		qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/pkg-config"
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			${configure_args}
+	else
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			QMAKE_CC=$CC QMAKE_CXX=$CXX \
+			QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
+			QMAKE_CFLAGS="${CFLAGS}" \
+			QMAKE_CXXFLAGS="${CXXFLAGS}" \
+			QMAKE_LFLAGS="${LDFLAGS}" \
+			${configure_args}
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
-		PREFIX=/usr \
-		LIB=/usr/lib \
-		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
-		QMAKE_CFLAGS="${CFLAGS}" \
-		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From 338bb78eeef23aabcc9ce0261a6ccddc071e238a Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 04/10] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index 37ab5801d84..5dacb026d4a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=1.9.8
-revision=1
+revision=2
 wrksrc="tdesktop-${version}-full"
 build_style=cmake
 build_helper="qemu"
@@ -17,7 +17,7 @@ makedepends="alsa-lib-devel ffmpeg-devel libdbusmenu-glib-devel libopenal-devel
  minizip-devel opus-devel xxHash-devel pulseaudio-devel qt5-devel range-v3
  libva-devel enchant2-devel rapidjson liblz4-devel liblzma-devel rlottie-devel
  MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5-core>=5.14.1<5.14.2"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"
@@ -49,7 +49,7 @@ fi
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 7507a143784d378c937749adff2aa5411a0f1da3 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:05:28 +0100
Subject: [PATCH 05/10] qt5-styleplugins: rebuild against qt5.14

---
 srcpkgs/qt5-styleplugins/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5-styleplugins/template b/srcpkgs/qt5-styleplugins/template
index f6c511cad4c..10fc6e4fa26 100644
--- a/srcpkgs/qt5-styleplugins/template
+++ b/srcpkgs/qt5-styleplugins/template
@@ -1,13 +1,13 @@
 # Template file for 'qt5-styleplugins'
 pkgname=qt5-styleplugins
 version=5.0.0
-revision=11
+revision=12
 _gitrev=335dbece103e2cbf6c7cf819ab6672c2956b17b3
 wrksrc="qtstyleplugins-${_gitrev}"
 build_style=qmake
 hostmakedepends="pkg-config qt5-host-tools qt5-devel"
 makedepends="libxcb-devel libxkbcommon-devel libinput-devel tslib-devel gtk+-devel qt5-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5>=5.14.1<5.14.2"
 short_desc="Additional style plugins for Qt5"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="LGPL-2.1-only, LGPL-3.0-only"

From 3f26890562bf69593db1e94b35913421b9657e1b Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:27:31 +0100
Subject: [PATCH 06/10] qt5dxcb-plugin: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5dxcb-plugin/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/qt5dxcb-plugin/template b/srcpkgs/qt5dxcb-plugin/template
index b5408ed89fb..b48a9fb1658 100644
--- a/srcpkgs/qt5dxcb-plugin/template
+++ b/srcpkgs/qt5dxcb-plugin/template
@@ -1,14 +1,14 @@
 # Template file for 'qt5dxcb-plugin'
 pkgname=qt5dxcb-plugin
 version=5.0.1
-revision=3
+revision=4
 build_style=qmake
 make_build_args="VERSION=${version}"
 hostmakedepends="pkg-config qt5-qmake"
 makedepends="cairo-devel libSM-devel libXi-devel libxkbcommon-devel
  qt5-x11extras-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5-core>=5.14.1<5.14.2"
 short_desc="Qt platform plugins for DDE"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later"
@@ -18,6 +18,8 @@ distfiles="https://github.com/linuxdeepin/qt5dxcb-plugin/archive/${version}.tar.
 checksum=b19253f9f577b2a9d86774ba95d252318f3d692ab92d2e62fbf0578d56db453d
 patch_args="-Np1"
 
+broken="TODO: USE THE CORRECT HEADERS"
+
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
@@ -33,7 +35,7 @@ pre_configure() {
 	# no headers for 5.13.1 yet; 5.13.0 headers are the same for this
 	# remove on next version upgrade (after upstream has added them)
 	ln -s ${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.0 \
-		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.2
+		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.14.0
 }
 
 if [ "$CROSS_BUILD" ]; then

From 93c8a355035a7b3de7f1ca405939d5166e257435 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Thu, 5 Dec 2019 08:42:41 +0100
Subject: [PATCH 07/10] kwin: rebuild against qt5.14.0

[ci skip]
---
 srcpkgs/kwin/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kwin/template b/srcpkgs/kwin/template
index 8f8b04b4317..42ffe893193 100644
--- a/srcpkgs/kwin/template
+++ b/srcpkgs/kwin/template
@@ -1,7 +1,7 @@
 # Template file for 'kwin'
 pkgname=kwin
 version=5.17.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext breeze pkg-config"
@@ -9,7 +9,7 @@ makedepends="plasma-framework-devel kcmutils-devel knewstuff-devel
  kscreenlocker-devel kinit-devel xcb-util-cursor-devel qt5-multimedia-devel
  kdecoration-devel libxkbcommon-devel libinput-devel libSM-devel
  libICE-devel xcb-util-wm-devel qt5-sensors-devel libcap-devel"
-depends="breeze hicolor-icon-theme kinit qt5>=5.13.2<5.13.3"
+depends="breeze hicolor-icon-theme kinit qt5-core>=5.14.1<5.14.2"
 short_desc="KDE Window manager"
 maintainer="John <johnz@posteo.net>"
 license="GPL-2.0-or-later"
@@ -29,7 +29,7 @@ esac
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 2568f25413722900135c2b7bdaa731c7611e88d7 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 13:31:14 +0100
Subject: [PATCH 08/10] plasma-framework: add patch for qt5.14

---
 srcpkgs/plasma-framework/patches/qt5.14.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 srcpkgs/plasma-framework/patches/qt5.14.patch

diff --git a/srcpkgs/plasma-framework/patches/qt5.14.patch b/srcpkgs/plasma-framework/patches/qt5.14.patch
new file mode 100644
index 00000000000..c8b08ba04ba
--- /dev/null
+++ b/srcpkgs/plasma-framework/patches/qt5.14.patch
@@ -0,0 +1,18 @@
+Source: @Johnnynator
+Upstream: no (Need to verify if this isn't a qt5 bug)
+Reason: QLocale().uiLanguages() in Qt5.14 can return an empty list,
+	in previous Qt versions it had a minimum size of one with
+	locale"C" as content.
+
+--- src/declarativeimports/calendar/calendar.cpp	2019-11-02 14:02:23.000000000 +0100
++++ -	2019-12-13 19:22:09.178234731 +0100
+@@ -199,7 +199,8 @@
+     // locale and take the month name from that.
+     //
+     // See https://bugs.kde.org/show_bug.cgi?id=353715
+-    const QString lang = QLocale().uiLanguages().at(0);
++    const QStringList languages = QLocale().uiLanguages();
++    const QString lang = languages.size() > 0 ? languages.at(0) : QString();
+     // If lang is empty, it will create just a system locale
+     QLocale langLocale(lang);
+     return langLocale.standaloneMonthName(m_displayedDate.month());

From 1e8916a9b99dc8c9b6d87c874f4b89f73602b020 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 28 Jan 2020 18:03:47 +0100
Subject: [PATCH 09/10] plasma-integration: rebuild for qt5-5.14.1

---
 srcpkgs/plasma-integration/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/plasma-integration/template b/srcpkgs/plasma-integration/template
index 5a1059fbf75..559a9abf5ff 100644
--- a/srcpkgs/plasma-integration/template
+++ b/srcpkgs/plasma-integration/template
@@ -1,7 +1,7 @@
 # Template file for 'plasma-integration'
 pkgname=plasma-integration
 version=5.17.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules pkg-config qt5-qmake qt5-host-tools

From d859f39569fd038033111c29e45cb9a8fd7489c0 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 15:13:35 +0100
Subject: [PATCH 10/10] qt5-webkit: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5-webkit/patches/qt5.14.patch      | 93 ++++++++++++++++++++
 srcpkgs/qt5-webkit/patches/qt5.14.patch.args |  1 +
 srcpkgs/qt5-webkit/template                  |  2 +-
 3 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch.args

diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch b/srcpkgs/qt5-webkit/patches/qt5.14.patch
new file mode 100644
index 00000000000..799d53f1f55
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch
@@ -0,0 +1,93 @@
+From c344187a099f8fd749dc84ffcc125c0925103819 Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Tue, 10 Sep 2019 03:51:42 +0300
+Subject: Fix compilation of HTTP2 settings with Qt >= 5.14
+
+Public API QHttp2Configuration was added, so we use it now instead of
+ugly hack required for previous versions. Workaround for QTBUG-77308 is
+no loger needed in 5.14, so we only enable server push.
+
+Change-Id: I3e6817d8fa274c3a849f09b23ca58f93318be6c4
+---
+ .../network/qt/QNetworkReplyHandler.cpp       |  6 +++---
+ .../platform/network/qt/ResourceRequestQt.cpp | 20 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+index 0da45fbc79a5..7924595582ac 100644
+--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
++++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+@@ -41,7 +41,7 @@
+ 
+ #include <QCoreApplication>
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ #include <private/http2protocol_p.h>
+ #include <cstdlib>
+@@ -62,7 +62,7 @@ ProtocolParameters::ProtocolParameters()
+ 
+ QT_END_NAMESPACE
+ 
+-#endif // USE(HTTP2)
++#endif // USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ static const int gMaxRedirections = 10;
+ 
+@@ -797,7 +797,7 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
+     if (!manager)
+         return 0;
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+     static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
+     if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
+         Http2::ProtocolParameters params;
+diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+index 2cf2e7750dde..310738449b75 100644
+--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
++++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+@@ -29,7 +29,10 @@
+ 
+ #if USE(HTTP2)
+ #include <QSslSocket>
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++#include <QHttp2Configuration>
+ #endif
++#endif // USE(HTTP2)
+ 
+ namespace WebCore {
+ 
+@@ -65,6 +68,16 @@ bool ResourceRequest::alpnIsSupported()
+     return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
+         QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
+ }
++
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++static QHttp2Configuration createHttp2Configuration()
++{
++    QHttp2Configuration params;
++    params.setServerPushEnabled(true);
++    return params;
++}
++#endif
++
+ #endif
+ 
+ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
+@@ -76,8 +89,13 @@ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) co
+ 
+ #if USE(HTTP2)
+     static const bool NegotiateHttp2ForHttps = alpnIsSupported();
+-    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps)
++    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps) {
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++        static const auto params = createHttp2Configuration();
++        request.setHttp2Configuration(params);
++#endif
+         request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
++    }
+ #endif // USE(HTTP2)
+ 
+     const HTTPHeaderMap &headers = httpHeaderFields();
diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch.args b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
new file mode 100644
index 00000000000..2eba1cb3c5c
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
@@ -0,0 +1 @@
+-Np1
diff --git a/srcpkgs/qt5-webkit/template b/srcpkgs/qt5-webkit/template
index c7c09c1376e..4c8b3f6414f 100644
--- a/srcpkgs/qt5-webkit/template
+++ b/srcpkgs/qt5-webkit/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webkit'
 pkgname=qt5-webkit
 version=5.212.0
-revision=6
+revision=7
 _snap=1565895469
 _v=${version%.*}
 wrksrc="qtwebkit-everywhere-src-${_v}"

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (5 preceding siblings ...)
  2020-01-28 17:04 ` voidlinux-github
@ 2020-02-02 16:03 ` voidlinux-github
  2020-03-18 18:37 ` streaksu
                   ` (26 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: voidlinux-github @ 2020-02-02 16:03 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [ ] x86_64 (compiled and runtime)
- [ ] x86_64-musl (compiled, webengine seems to work https://i.imgur.com/0jpOBet.png (segfaults with sndio (?) also currently tries to fetch resources from `/share` instead of `/usr/share`, needs to be fixed.)
- [ ] i686 ()
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [ ] armv6l (compiled without webengine)
- [ ] aarch64-musl (compiled)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross (for some qmake packages)
- rebase webengine ppc patches @q66 
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- fix webengine loading resources from `/share` instead of `/usr/share`

# Bugs

- webengine currently tries to fetch resources from `/share` instead of `/usr/share
- Plasmashell wayland on musl crashes regulary 

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 441193 bytes --]

From 9ca5da8c1d18681d268a05439a27ed029f6c39ff Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 01/10] qt5: update to 5.14.1

---
 common/shlibs                                 |   33 +-
 srcpkgs/{qt5-webengine => qt5-base-docs}      |    0
 srcpkgs/qt5-concurrent                        |    1 +
 srcpkgs/qt5-core                              |    1 +
 srcpkgs/qt5-dbus                              |    1 +
 srcpkgs/qt5-gui                               |    1 +
 srcpkgs/qt5-network                           |    1 +
 srcpkgs/qt5-opengl                            |    1 +
 srcpkgs/qt5-printsupport                      |    1 +
 srcpkgs/qt5-quicktimeline                     |    1 +
 srcpkgs/qt5-sql                               |    1 +
 srcpkgs/qt5-test                              |    1 +
 srcpkgs/qt5-widgets                           |    1 +
 srcpkgs/qt5-xcb-private-headers               |    1 +
 srcpkgs/qt5-xml                               |    1 +
 .../0090-hard-disable-qmlchachegen.patch      |   10 -
 srcpkgs/qt5/files/qmlcachegen.pro             |   38 +
 srcpkgs/qt5/files/qmlimportscanner.pro        |    2 +
 srcpkgs/qt5/files/qmllint.pro                 |   17 +-
 srcpkgs/qt5/files/qttools_src.pro             |   18 +-
 srcpkgs/qt5/files/resolv_compat.h             |   29 -
 srcpkgs/qt5/files/uic.pro                     |    1 +
 srcpkgs/qt5/files/uitools.pro                 |   15 +
 srcpkgs/qt5/patches/0001-addlr.patch          |   23 +
 ...te-instead-of-_libc_fpstate-on-linux.patch |   42 -
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |   26 -
 .../patches/0004-musl-dispatch-to-musl.patch  |  103 -
 .../qt5/patches/0008-musl-no-mallinfo.patch   |   40 -
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |   10 -
 .../qt5/patches/0010-musl-pread-pwrite.patch  |   18 -
 .../patches/0011-musl-replace-pvalloc.patch   |   14 -
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |   26 -
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |   18 -
 .../qt5/patches/0017-musl-stackstart.patch    |   20 -
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |   71 -
 .../qt5/patches/0023-enable_tools-cross.patch |   46 -
 ...0025-musl-chromium-default-stacksize.patch |   15 -
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |   15 -
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0032-musl-cross-no-asm_ptrace_h.patch     |   30 -
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |   13 -
 .../0042-arm-void-is-not-android.patch        |   21 -
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  107 -
 .../0045-qt-musl-thread-stacksize.patch       |   26 -
 .../qt5/patches/0046-sandbox-membarrier.patch |   60 -
 .../qt5/patches/0047-gn-cross-sysroot.patch   |   24 -
 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch  |   33 +
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../patches/0100-sandbox-sched_getparam.patch |   24 -
 srcpkgs/qt5/template                          |  357 +-
 55 files changed, 323 insertions(+), 8506 deletions(-)
 rename srcpkgs/{qt5-webengine => qt5-base-docs} (100%)
 create mode 120000 srcpkgs/qt5-concurrent
 create mode 120000 srcpkgs/qt5-core
 create mode 120000 srcpkgs/qt5-dbus
 create mode 120000 srcpkgs/qt5-gui
 create mode 120000 srcpkgs/qt5-network
 create mode 120000 srcpkgs/qt5-opengl
 create mode 120000 srcpkgs/qt5-printsupport
 create mode 120000 srcpkgs/qt5-quicktimeline
 create mode 120000 srcpkgs/qt5-sql
 create mode 120000 srcpkgs/qt5-test
 create mode 120000 srcpkgs/qt5-widgets
 create mode 120000 srcpkgs/qt5-xcb-private-headers
 create mode 120000 srcpkgs/qt5-xml
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5/files/uitools.pro
 create mode 100644 srcpkgs/qt5/patches/0001-addlr.patch
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch

diff --git a/common/shlibs b/common/shlibs
index 35c51bac5dc..598d24cd684 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1918,6 +1918,7 @@ libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
 libQt53DExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
 libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.13.0_1
 libQt5Charts.so.5 qt5-charts-5.7.1_1
 libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
 libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
@@ -1930,6 +1931,8 @@ libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
 libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
 libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
 libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.0_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.0_1
 libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
 libQt5Positioning.so.5 qt5-location-5.6.0_1
@@ -1966,21 +1969,21 @@ libQt5WebEngineWidgets.so.5 qt5-webengine-5.6.0_1
 libQt5WebSockets.so.5 qt5-websockets-5.6.0_1
 libQt5X11Extras.so.5 qt5-x11extras-5.6.0_1
 libQt5XmlPatterns.so.5 qt5-xmlpatterns-5.6.0_1
-libQt5Core.so.5 qt5-5.6.0_1
-libQt5EglFSDeviceIntegration.so.5 qt5-5.8.0_1
-libQt5Network.so.5 qt5-5.6.0_1
-libQt5Sql.so.5 qt5-5.6.0_1
-libQt5Xml.so.5 qt5-5.6.0_1
-libQt5Gui.so.5 qt5-5.6.0_1
-libQt5Widgets.so.5 qt5-5.6.0_1
-libQt5Test.so.5 qt5-5.6.0_1
-libQt5DBus.so.5 qt5-5.6.0_1
-libQt5Concurrent.so.5 qt5-5.6.0_1
-libQt5OpenGL.so.5 qt5-5.6.0_1
-libQt5PrintSupport.so.5 qt5-5.6.0_1
-libQt5XcbQpa.so.5 qt5-5.6.0_1
-libQt5EglDeviceIntegration.so.5 qt5-5.6.0_1
-libQt5EglFsKmsSupport.so.5 qt5-5.7.1_1
+libQt5Core.so.5 qt5-core-5.14.0_1
+libQt5EglFSDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5Network.so.5 qt5-network-5.14.0_1
+libQt5Sql.so.5 qt5-sql-5.14.0_1
+libQt5Xml.so.5 qt5-xml-5.14.0_1
+libQt5Gui.so.5 qt5-gui-5.14.0_1
+libQt5Widgets.so.5 qt5-widgets-5.14.0_1
+libQt5Test.so.5 qt5-test-5.14.0_1
+libQt5DBus.so.5 qt5-dbus-5.14.0_1
+libQt5Concurrent.so.5 qt5-concurrent-5.14.0_1
+libQt5OpenGL.so.5 qt5-opengl-5.14.0_1
+libQt5PrintSupport.so.5 qt5-printsupport-5.14.0_1
+libQt5XcbQpa.so.5 qt5-gui-5.14.0_1
+libQt5EglDeviceIntegration.so.5 qt5-gui-5.14.0_1
+libQt5EglFsKmsSupport.so.5 qt5-gui-5.14.0_1
 libQt5WebKit.so.5 qt5-webkit-5.6.0_1
 libQt5WebKitWidgets.so.5 qt5-webkit-5.6.0_1
 libQt5TextToSpeech.so.5 qt5-speech-5.8.0_1
diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-base-docs
similarity index 100%
rename from srcpkgs/qt5-webengine
rename to srcpkgs/qt5-base-docs
diff --git a/srcpkgs/qt5-concurrent b/srcpkgs/qt5-concurrent
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-concurrent
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-core b/srcpkgs/qt5-core
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-core
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-dbus b/srcpkgs/qt5-dbus
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-dbus
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-gui b/srcpkgs/qt5-gui
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-gui
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-network b/srcpkgs/qt5-network
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-network
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-opengl b/srcpkgs/qt5-opengl
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-opengl
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-printsupport b/srcpkgs/qt5-printsupport
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-printsupport
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-quicktimeline b/srcpkgs/qt5-quicktimeline
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-quicktimeline
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-sql b/srcpkgs/qt5-sql
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-sql
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-test b/srcpkgs/qt5-test
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-test
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-widgets b/srcpkgs/qt5-widgets
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-widgets
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xcb-private-headers b/srcpkgs/qt5-xcb-private-headers
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xcb-private-headers
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xml b/srcpkgs/qt5-xml
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xml
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b5963becd6c
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,38 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp
+TARGET = qmlcachegen
+
+include(../shared/shared.pri)
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmlimportscanner.pro b/srcpkgs/qt5/files/qmlimportscanner.pro
index 57c228b8540..ab1e851293a 100644
--- a/srcpkgs/qt5/files/qmlimportscanner.pro
+++ b/srcpkgs/qt5/files/qmlimportscanner.pro
@@ -3,6 +3,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
 
 SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
 
+include(../shared/shared.pri)
+
 QMAKE_TARGET_DESCRIPTION = QML Import Scanner
 
 load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/resolv_compat.h b/srcpkgs/qt5/files/resolv_compat.h
deleted file mode 100644
index 4f0e852a19d..00000000000
--- a/srcpkgs/qt5/files/resolv_compat.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#if !defined(__GLIBC__)
-/***************************************************************************
- * resolv_compat.h
- *
- * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
- * Note: res_init() is actually deprecated according to
- * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
- **************************************************************************/
-#include <string.h>
-
-static inline int res_ninit(res_state statp)
-{
-	int rc = res_init();
-	if (statp != &_res) {
-		memcpy(statp, &_res, sizeof(*statp));
-	}
-	return rc;
-}
-
-static inline int res_nclose(res_state statp)
-{
-	if (!statp)
-		return -1;
-	if (statp != &_res) {
-		memset(statp, 0, sizeof(*statp));
-	}
-	return 0;
-}
-#endif
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/files/uitools.pro b/srcpkgs/qt5/files/uitools.pro
new file mode 100644
index 00000000000..51e22b14506
--- /dev/null
+++ b/srcpkgs/qt5/files/uitools.pro
@@ -0,0 +1,15 @@
+TARGET = QtUiTools
+CONFIG += static
+
+include(../lib/uilib/uilib.pri)
+
+QMAKE_DOCS = $$PWD/doc/qtuitools.qdocconf
+
+HEADERS += quiloader.h
+SOURCES += quiloader.cpp
+
+DEFINES += \
+    QFORMINTERNAL_NAMESPACE \
+    QT_DESIGNER_STATIC
+
+load(qt_module)
diff --git a/srcpkgs/qt5/patches/0001-addlr.patch b/srcpkgs/qt5/patches/0001-addlr.patch
new file mode 100644
index 00000000000..e415332dd89
--- /dev/null
+++ b/srcpkgs/qt5/patches/0001-addlr.patch
@@ -0,0 +1,23 @@
+Source: @Johnnynator
+Upsteam: No
+Subject: Musl always returns /lib/libQt5Core.so.5 for Dl_info.dli_fname. 
+On GLIBC this seems to only happen with programs that load qt5-webengine(?)
+
+---
+diff --git qtbasesrc/corelib/global/qlibraryinfo.cpp qtbasesrc/corelib/global/qlibraryinfo.cpp
+index 8bcf67e73d..28d7355310 100644
+--- qtbase/src/corelib/global/qlibraryinfo.cpp
++++ qtbase/src/corelib/global/qlibraryinfo.cpp
+@@ -558,6 +558,12 @@ static QString getRelocatablePrefix()
+     int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info);
+     if (result > 0 && info.dli_fname)
+         prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLatin1(info.dli_fname));
++#if 1
++    QDir preDir(prefixPath);
++    if (preDir.isRoot()) {
++        prefixPath = QStringLiteral("/usr");
++    }
++#endif
+ #elif defined(Q_OS_WIN)
+     HMODULE hModule = getWindowsModuleHandle();
+     const int kBufferSize = 4096;
diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index c332b92b69d..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -100,14 +100,14 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
- #else
-   return minfo.hblkhd + minfo.arena;
- #endif
--#elif defined(OS_FUCHSIA)
-+#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
-   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
-   return 0;
- #endif
-
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index b13290d3ccd..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_tools:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index 98f3a38745a..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,107 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
new file mode 100644
index 00000000000..2eeae632cfe
--- /dev/null
+++ b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
@@ -0,0 +1,33 @@
+Submodule qtbase contains untracked content
+Submodule qtbase contains modified content
+diff --git qtbase/mkspecs/features/qt_build_config.prf qtbase/mkspecs/features/qt_build_config.prf
+index 8273ba3fe1..b674f42109 100644
+--- qtbase/mkspecs/features/qt_build_config.prf
++++ qtbase/mkspecs/features/qt_build_config.prf
+@@ -11,6 +11,10 @@
+ 
+ !contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
+     QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
++    defined(QMAKE_TARGET_MODULE,var):exists($$QMAKE_TARGET_MODULE) {
++        QMAKE_QT_MODULE = $$QMAKE_TARGET_MODULE
++        message("Trying .qmodule.pri from ($$QMAKE_QT_CONFIG)")
++    }
+     !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) {
+         debug(1, "Cannot load qmodule.pri!")
+     } else {
+diff --git qtbase/mkspecs/features/qt_config.prf qtbase/mkspecs/features/qt_config.prf
+index 93c54e3010..aaff26b52a 100644
+--- qtbase/mkspecs/features/qt_config.prf
++++ qtbase/mkspecs/features/qt_config.prf
+@@ -1,6 +1,10 @@
+ # This file is loaded as one of the last things by all qmakespecs.
+ 
+ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
++defined(QMAKE_TARGET_CONFIG,var):exists($$QMAKE_TARGET_CONFIG) {
++   QMAKE_QT_CONFIG = $$QMAKE_TARGET_CONFIG
++   message("Trying .qconfig.pri from ($$QMAKE_QT_CONFIG)")
++}
+ !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
+    debug(1, "Cannot load qconfig.pri!")
+ } else {
+Submodule qtwebengine contains untracked content
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch b/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
deleted file mode 100644
index 15c33a57f03..00000000000
--- a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Allow SYS_sched_getparam and SYS_sched_getscheduler
-musl uses them for pthread_getschedparam()
-
-source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
-
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-11-12 20:48:20.013724661 +0100
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc.patched	2019-11-12 20:58:57.330695676 +0100
-@@ -93,10 +93,16 @@
-     case __NR_sysinfo:
-     case __NR_times:
-     case __NR_uname:
-+#if !defined(__GLIBC__)
-+    case __NR_sched_getparam:
-+    case __NR_sched_getscheduler:
-+#endif
-       return Allow();
-     case __NR_sched_getaffinity:
-+#if defined(__GLIBC__)
-     case __NR_sched_getparam:
-     case __NR_sched_getscheduler:
-+#endif
-     case __NR_sched_setscheduler:
-       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
-     case __NR_prlimit64:
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index b0205530a13..1765a94f16a 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,91 +1,31 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
-revision=2
+version=5.14.1
+revision=1
+build_style=meta
 wrksrc="qt-everywhere-src-${version}"
-build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
- protobuf python re2c ruby which"
+hostmakedepends="cmake clang flex git glib-devel pkg-config
+ python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
-depends="qtchooser"
+depends="qt5-dbus qt5-gui qt5-core qt5-widgets qt5-network qt5-xml
+ qt5-test qt5-sql qt5-concurrent qt5-printsupport qt5-opengl"
 short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+checksum=6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
 
-build_options="webengine"
-desc_option_webengine="Build Chromium-based WebEngine component"
-
-makedepends+=" harfbuzz-devel"
-
-if [ "$XBPS_LIBC" = "musl" ]; then
-	hostmakedepends+=" musl-legacy-compat"
-fi
-if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat"
-fi
-
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
-if [ "$build_option_webengine" ]; then
-	# v8 requires libatomic on armv[56]*/ppc*/s390x/mips*
-	case "$XBPS_TARGET_MACHINE" in
-		armv[56]*|mips*|ppc*) makedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-	# also need it on host when it's one of those archs
-	case "$XBPS_MACHINE" in
-		armv[56]*|mips*|ppc*) hostmakedepends+=" libatomic-devel" ;;
-		*) ;;
-	esac
-fi
-
-subpackages="qt5-3d qt5-3d-devel qt5-charts qt5-charts-devel
- qt5-connectivity qt5-connectivity-devel qt5-datavis3d qt5-datavis3d-devel
- qt5-declarative qt5-declarative-devel qt5-devel qt5-examples qt5-gamepad
- qt5-gamepad-devel qt5-graphicaleffects qt5-host-tools qt5-imageformats
- qt5-location qt5-location-devel qt5-multimedia qt5-multimedia-devel
- qt5-networkauth qt5-networkauth-devel qt5-plugin-mysql qt5-plugin-odbc
- qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds qt5-purchasing
- qt5-purchasing-devel qt5-qmake qt5-quickcontrols qt5-quickcontrols2
- qt5-quickcontrols2-devel qt5-remoteobjects qt5-remoteobjects-devel
- qt5-script qt5-script-devel qt5-scxml qt5-scxml-devel qt5-sensors
- qt5-sensors-devel qt5-serialbus qt5-serialbus-devel qt5-serialport
- qt5-serialport-devel qt5-speech qt5-speech-devel qt5-svg qt5-svg-devel
- qt5-tools qt5-tools-devel qt5-translations qt5-virtualkeyboard
- qt5-virtualkeyboard-devel qt5-wayland qt5-wayland-devel qt5-webchannel
- qt5-webchannel-devel qt5-webglplugin qt5-webglplugin-devel qt5-websockets
- qt5-websockets-devel qt5-webview qt5-webview-devel qt5-x11extras
- qt5-x11extras-devel qt5-xmlpatterns qt5-xmlpatterns-devel
- qt5-lottie qt5-lottie-devel"
-
-if [ "$build_option_webengine" ]; then
-	subpackages+=" qt5-webengine qt5-webengine-devel"
-fi
-
-if [ "$XBPS_WORDSIZE" -eq 32 ]; then
-	nodebug=yes  # prevent OOM
-fi
-
 # Work around SSLv3_{client,server}_method missing in libressl-2.3.3
 CFLAGS="-DOPENSSL_NO_PSK -DOPENSSL_NO_NEXTPROTONEG"
 CXXFLAGS="${CFLAGS} -Wno-deprecated-declarations -Wno-class-memaccess -Wno-packed-not-aligned"
@@ -97,26 +37,8 @@ if [ "$CROSS_BUILD" ]; then
 	# wayland-devel contains /usr/bin/wayland-scanner
 	hostmakedepends+=" icu-devel wayland-devel zlib-devel"
 	hostmakedepends+=" postgresql-libs-devel"
-	# Cross building qtwebengine requires some more host packages
-	if [ "$build_option_webengine" ]; then
-		hostmakedepends+=" nss-devel libevent-devel"
-	fi
 fi
 
-_bootstrap_gn() {
-	# Bootstrap gn (generate ninja)
-	echo "Bootstrapping 'gn'"
-	cd ${wrksrc}/qtwebengine/src/3rdparty/gn
-	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
-	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
-		python2 build/gen.py --no-last-commit-position --out-path \
-			${wrksrc}/qtwebengine/src/3rdparty/gn/out/Release --cc "$CC_host" \
-			--cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
-	ninja -C out/Release gn
-	cd ${wrksrc}
-}
-
-
 _cleanup_wrksrc_leak() {
 	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
 		# Replace references to ${wrksrc} in cmake files
@@ -171,6 +93,11 @@ _install_devel() {
 	local module=$1
 	cd ${wrksrc}/${module}
 	make INSTALL_ROOT=${PKGDESTDIR} install
+	vmkdir usr/lib/qt5/mkspecs/modules
+	if [ -d "${PKGDESTDIR}${wrksrc}/host/mkspecs/modules" ]; then
+		mv -nv ${PKGDESTDIR}${wrksrc}/host/mkspecs/modules/* \
+			${PKGDESTDIR}/usr/lib/qt5/mkspecs/modules/
+	fi
 	rm -rf ${PKGDESTDIR}/builddir
 	rm -rf ${PKGDESTDIR}/usr/share
 	rm -rf ${PKGDESTDIR}/usr/lib/qt5/bin
@@ -241,32 +168,6 @@ _msg_cross() {
 do_configure() {
 	local opts spec
 
-	# Compatibility functions res_ninit() and res_nclose() for musl libc
-	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/qtwebengine/src/3rdparty/chromium/net/dns
-
-	case "$XBPS_TARGET_MACHINE" in
-	armv5*|armv6*)	# Disable "yield" assembler instruction
-		sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
-			qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
-			-e 's;"yield";"nop";'
-		;;
-	esac
-
-	case "$XBPS_TARGET_MACHINE" in
-	*-musl)
-		# Patch .../linux/*/config.{h,asm} to define HAVE_SYSCTL 0
-		local config chromium=${wrksrc}/qtwebengine/src/3rdparty/chromium
-		for config in $(find ${chromium}/third_party/ffmpeg/chromium/config -name "config\.*" | grep linux); do
-			sed -i ${config} -e "s;HAVE_SYSCTL 1;HAVE_SYSCTL 0;"
-		done
-		# Do not use allocator shim (incompatible with musl libc)
-		sed -i qtwebengine/src/3rdparty/chromium/build/config/allocator.gni \
-			-e "s;\(use_allocator_shim\) = .*;\1 = false;"
-		# Define to set 2 MiB stack size for qthread
-		export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152"
-		;;
-	esac
-
 	# Cross build patches
 	if [ "$CROSS_BUILD" ]; then
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
@@ -279,28 +180,6 @@ do_configure() {
 		for d in $(ls ${wrksrc}/qtbase/include); do
 			ln -sfv ${version}/${d}/private qtbase/include/${d}/private
 		done
-		if [ "$build_option_webengine" ]; then
-			_bootstrap_gn
-		fi
-
-		case "$XBPS_TARGET_MACHINE" in
-		mips*)	# sgidefs.h is in /usr/include/asm
-			for f in \
-				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
-				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
-				sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
-			done
-			# Assume that RGBA order is correct for big endian CPUs
-			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
-				-e '/#error Read the comment at this location/d'
-			;;
-		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -348,29 +227,10 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
-	# Rely on auto detection (fails if forced for cross builds)
-	if [ "$build_option_webengine" ]; then
-		# opts+=" -webengine-alsa"
-		opts+=" -no-webengine-embedded-build"
-		opts+=" -webengine-icu"
-		opts+=" -webengine-ffmpeg"
-		opts+=" -webengine-opus"
-		opts+=" -webengine-webp"
-		opts+=" -webengine-pepper-plugins"
-		opts+=" -webengine-printing-and-pdf"
-		opts+=" -webengine-proprietary-codecs"
-		opts+=" -webengine-pulseaudio"
-		opts+=" -webengine-spellchecker"
-		opts+=" -webengine-webrtc"
-		opts+=" -webengine-geolocation"
-		opts+=" -webengine-v8-snapshot"
-	fi
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	opts+=" -silent"
 	# opts+=" -v"
-	# make sure to disable webengine on platforms that we don't build it for
-	if [ -z "$build_option_webengine" ]; then
-		opts+=" -skip qtwebengine"
-	fi
+	opts+=" -skip qtwebengine"
 	LDFLAGS+=" -Wl,--no-keep-memory"  # needs more than 8GB RAM else
 	if [ "$CROSS_BUILD" ]; then
 		spec=void-${XBPS_CROSS_TRIPLET}-g++
@@ -380,33 +240,13 @@ do_configure() {
 		opts+=" -sysroot ${XBPS_CROSS_BASE}"
 		opts+=" -hostprefix host"
 		opts+=" -extprefix /usr"
-		case "$XBPS_TARGET_MACHINE" in
-		arm*|mips*)
-			if [ "$build_option_webengine" ]; then
-				# V8 snapshot can't be built with a 64 bit host compiler
-				opts+=" -no-webengine-v8-snapshot"
-			fi
-			;;
-		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
 		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
 		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
 		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		cp -v ${FILESDIR}/uitools.pro qttools/src/designer/src/uitools/uitools.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -419,10 +259,10 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes
+	# or some other files
 	make ${makejobs} || make ${makejobs}
 }
 
@@ -494,12 +334,15 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"
 		dirs+=" qtbase/src/tools/uic"
 		dirs+=" qtbase/src/tools/qdbuscpp2xml"
 		dirs+=" qtbase/src/tools/qdbusxml2cpp"
+		dirs+=" qtbase/src/tools/qvkgen"
+		dirs+=" qtbase/src/tools/tracegen"
 		dirs+=" qtbase/src/tools/qlalr"
 		dirs+=" qt3d/tools/qgltf"
 		dirs+=" qtremoteobjects/tools/repc"
@@ -571,6 +414,102 @@ do_install() {
 	rm -rf ${DESTDIR}/builddir
 }
 
+qt5-gui_package() {
+	short_desc+=" - Gui"
+	pkg_install() {
+		vmove "usr/lib/libQt5Gui.so*"
+		vmove "usr/lib/libQt5XcbQpa.so*"
+		vmove "usr/lib/libQt5EglFSDeviceIntegration.so*"
+		vmove "usr/lib/libQt5EglFsKmsSupport.so*"
+		vmove usr/lib/qt5/plugins/generic
+		vmove usr/lib/qt5/plugins/platforms
+		vmove usr/lib/qt5/plugins/xcbglintegrations
+		vmove usr/lib/qt5/plugins/imageformats
+		vmove usr/lib/qt5/plugins/egldeviceintegrations
+		vmove usr/lib/qt5/plugins/platforminputcontexts
+		vmove usr/lib/qt5/plugins/platformthemes
+	}
+}
+
+qt5-dbus_package() {
+	short_desc+=" - DBus"
+	pkg_install() {
+		vmove "usr/lib/libQt5DBus.so*"
+	}
+}
+
+qt5-core_package() {
+	short_desc+=" - Core"
+	pkg_install() {
+		vmove "usr/lib/libQt5Core.so*"
+	}
+}
+
+qt5-opengl_package() {
+	short_desc+=" - OpenGL"
+	pkg_install() {
+		vmove "usr/lib/libQt5OpenGL.so*"
+	}
+}
+
+qt5-printsupport_package() {
+	short_desc+=" - Print Support"
+	pkg_install() {
+		vmove "usr/lib/libQt5PrintSupport.so*"
+		vmove usr/lib/qt5/plugins/printsupport
+	}
+}
+
+qt5-concurrent_package() {
+	short_desc+=" - Concurrency"
+	pkg_install() {
+		vmove "usr/lib/libQt5Concurrent.so*"
+	}
+}
+
+qt5-widgets_package() {
+	short_desc+=" - Widgets"
+	pkg_install() {
+		vmove "usr/lib/libQt5Widgets.so*"
+	}
+}
+
+qt5-network_package() {
+	short_desc+=" - Network"
+	pkg_install() {
+		vmove "usr/lib/libQt5Network.so*"
+		vmove usr/lib/qt5/plugins/bearer
+	}
+}
+
+qt5-sql_package() {
+	short_desc+=" - Sql"
+	pkg_install() {
+		vmove "usr/lib/libQt5Sql.so*"
+	}
+}
+
+qt5-test_package() {
+	short_desc+=" - Test"
+	pkg_install() {
+		vmove "usr/lib/libQt5Test.so*"
+	}
+}
+
+qt5-xml_package() {
+	short_desc+=" - Xml"
+	pkg_install() {
+		vmove "usr/lib/libQt5Xml.so*"
+	}
+}
+
+qt5-base-docs_package() {
+	short_desc+=" - Documentation"
+	pkg_install() {
+		vmove usr/share/doc/qt5
+	}
+}
+
 qt5-3d-devel_package() {
 	short_desc+=" - C++ and QML APIs for 3D graphics (development)"
 	depends="qt5-3d-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -644,7 +583,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 
@@ -791,6 +730,13 @@ qt5-quickcontrols2_package() {
 	}
 }
 
+qt5-quicktimeline_package() {
+	short_desc+=" - Keyframe-based animations"
+	pkg_install() {
+		_install_subpkg qtquicktimeline
+	}
+}
+
 qt5-remoteobjects-devel_package() {
 	short_desc+=" - Remote Objects (development)"
 	depends="qt5-remoteobjects-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -959,21 +905,6 @@ qt5-webchannel_package() {
 	}
 }
 
-qt5-webengine-devel_package() {
-	short_desc+=" - WebEngine component (development)"
-	depends="qt5-webengine-${version}_${revision} qt5-devel-${version}_${revision}"
-	pkg_install() {
-		_install_devel qtwebengine
-	}
-}
-
-qt5-webengine_package() {
-	short_desc+=" - WebEngine component"
-	pkg_install() {
-		_install_subpkg qtwebengine
-	}
-}
-
 qt5-webglplugin-devel_package() {
 	short_desc+=" - WebGL plugin (development)"
 	depends="qt5-webglplugin-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -1044,6 +975,7 @@ qt5-xmlpatterns-devel_package() {
 
 qt5-xmlpatterns_package() {
 	short_desc+=" - XML components"
+	depends="qtchooser"
 	pkg_install() {
 		_install_subpkg qtxmlpatterns
 	}
@@ -1058,12 +990,13 @@ qt5-translations_package() {
 
 qt5-host-tools_package() {
 	short_desc+=" - Tools required when cross compiling"
+	depends="qtchooser"
 	pkg_install() {
 		local dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-tools-${version}
 		vmkdir usr/lib/qt5/bin
 		vmkdir usr/bin
-		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp \
-			lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
+		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp qvkgen fixqt4headers.pl tracegen \
+			syncqt.pl lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
 			if [ -r ${dest}/usr/lib/qt5/bin/${f} ]; then
 				mv -v ${dest}/usr/lib/qt5/bin/${f} ${PKGDESTDIR}/usr/lib/qt5/bin/
 			fi
@@ -1092,7 +1025,7 @@ qt5-tools-devel_package() {
 
 qt5-tools_package() {
 	short_desc+=" - Development tools"
-	depends="qt5-translations desktop-file-utils hicolor-icon-theme"
+	depends="qtchooser qt5-translations desktop-file-utils hicolor-icon-theme"
 	pkg_install() {
 		local f dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-host-tools-${version}
 		_install_subpkg qttools
@@ -1133,8 +1066,19 @@ qt5-tools_package() {
 qt5-devel_package() {
 	depends="zlib-devel libressl-devel>=2.1.4 libXext-devel libXrender-devel
 		fontconfig-devel libglib-devel MesaLib-devel mtdev-devel
-		dbus-devel icu-devel cups-devel qt5-${version}_${revision}
+		dbus-devel icu-devel cups-devel
+		qt5-gui-${version}_${revision}
+		qt5-dbus-${version}_${revision}
+		qt5-core-${version}_${revision}
+		qt5-widgets-${version}_${revision}
 		qt5-qmake-${version}_${revision}
+		qt5-opengl-${version}_${revision}
+		qt5-printsupport-${version}_${revision}
+		qt5-concurrent-${version}_${revision}
+		qt5-sql-${version}_${revision}
+		qt5-test-${version}_${revision}
+		qt5-network-${version}_${revision}
+		qt5-xml-${version}_${revision}
 		qt5-host-tools-${version}_${revision}"
 	short_desc+=" - Development files"
 	# qt5-enginio-devel is gone
@@ -1185,6 +1129,7 @@ qt5-plugin-tds_package() {
 
 qt5-qmake_package() {
 	short_desc+=" - Qmake Makefile generator tool"
+	depends="qtchooser"
 	pkg_install() {
 		vmove usr/lib/qt5/bin/qmake
 		vmove usr/lib/qt5/mkspecs
@@ -1212,3 +1157,13 @@ qt5-qmake_package() {
 		fi
 	}
 }
+
+qt5-xcb-private-headers_package() {
+	short_desc+=" - Private headers for Qt5 Xcb"
+	depends="qt5-devel"
+	pkg_install() {
+		for f in ${wrksrc}/qtbase/src/plugins/platforms/xcb/*.h; do
+			vinstall $f 644 usr/include/qt5xcb-private
+		done
+	}
+}

From 9a27c6e2dd02fe632dd3955d5f5005d45ab56173 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 02/10] New package: qt5-webengine-5.14.1

---
 srcpkgs/qt5-webengine-devel                   |   2 +-
 srcpkgs/qt5-webengine/files/resolv_compat.h   |  29 ++++
 ...te-instead-of-_libc_fpstate-on-linux.patch |  42 +++++
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |  26 +++
 .../patches/0003-musl-dispatch-to-musl.patch  | 103 ++++++++++++
 .../patches/0004-musl-no-mallinfo.patch       |  40 +++++
 .../patches/0005-musl-off_t.patch             |  10 ++
 .../patches/0006-musl-pread-pwrite.patch      |  18 ++
 .../patches/0007-musl-replace-pvalloc.patch   |  14 ++
 .../patches/0008-musl-resolve.patch           |  26 +++
 .../patches/0009-musl-siginfo_t.patch         |  18 ++
 .../patches/0010-musl-stackstart.patch        |  20 +++
 .../patches/0011-musl-sandbox.patch           |  71 ++++++++
 ...0012-musl-chromium-default-stacksize.patch |  15 ++
 .../0014-musl-cross-no-asm_ptrace_h.patch     |  30 ++++
 .../qt5-webengine/patches/0015-yasm-nls.patch |  13 ++
 .../patches/0016-qt-musl-execinfo.patch       |  94 +++++++++++
 .../0017-qt-musl-thread-stacksize.patch       |  26 +++
 .../patches/0018-sandbox-membarrier.patch     |  60 +++++++
 .../patches/0019-gn-cross-sysroot.patch       |  24 +++
 .../patches/0020-msgvec-push_back.patch       |  14 ++
 .../patches/0021-sandbox-sched_getparam.patch |  24 +++
 .../0022-canonicalize-file-name-musl.patch    |  11 ++
 srcpkgs/qt5-webengine/template                | 155 ++++++++++++++++++
 24 files changed, 884 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webengine/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/files/resolv_compat.h b/srcpkgs/qt5-webengine/files/resolv_compat.h
new file mode 100644
index 00000000000..4f0e852a19d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/files/resolv_compat.h
@@ -0,0 +1,29 @@
+#if !defined(__GLIBC__)
+/***************************************************************************
+ * resolv_compat.h
+ *
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
+ * Note: res_init() is actually deprecated according to
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
+ **************************************************************************/
+#include <string.h>
+
+static inline int res_ninit(res_state statp)
+{
+	int rc = res_init();
+	if (statp != &_res) {
+		memcpy(statp, &_res, sizeof(*statp));
+	}
+	return rc;
+}
+
+static inline int res_nclose(res_state statp)
+{
+	if (!statp)
+		return -1;
+	if (statp != &_res) {
+		memset(statp, 0, sizeof(*statp));
+	}
+	return 0;
+}
+#endif
diff --git a/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
new file mode 100644
index 00000000000..75481a2889f
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
@@ -0,0 +1,14 @@
+--- qtwebengine-everywhere-src-5.14.0-beta2/src/3rdparty/chromium/net/socket/udp_socket_posix.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:41:46.699068889 +0100
+@@ -1191,7 +1191,11 @@
+     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+   msgvec->reserve(buffers.size());
+   for (size_t j = 0; j < buffers.size(); j++)
++#if defined(__GLIBC__)
+     msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++#else
++    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
++#endif
+   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+   SendResult send_result(0, 0, std::move(buffers));
+   if (result < 0) {
diff --git a/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
new file mode 100644
index 00000000000..a91e85eca3c
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
@@ -0,0 +1,24 @@
+Allow SYS_sched_getparam and SYS_sched_getscheduler
+musl uses them for pthread_getschedparam()
+
+source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
+
+--- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:33:51.865153684 +0100
+@@ -88,10 +88,16 @@
+     case __NR_sysinfo:
+     case __NR_times:
+     case __NR_uname:
++#if !defined(__GLIBC__)
++    case __NR_sched_getparam:
++    case __NR_sched_getscheduler:
++#endif
+       return Allow();
+     case __NR_sched_getaffinity:
++#if defined(__GLIBC__)
+     case __NR_sched_getparam:
+     case __NR_sched_getscheduler:
++#endif
+     case __NR_sched_setscheduler:
+       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+     case __NR_prlimit64:
diff --git a/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..09a64582eb7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,155 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.1
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version}"
+archs="x86_64* i686* armv[67]* ppc64* aarch64*"
+build_style=qmake
+configure_args="--
+ -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if snapshot '' '-no')-webengine-v8-snapshot -webengine-kerberos"
+# Rely on auto detection (fails if forced for cross builds) -webengine-alsa
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel MesaLib-devel mit-krb5-devel"
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebengine-everywhere-src-${version}.tar.xz"
+checksum=4ec77040a876a83aa2a833ebfe7b3e88dcc167ceb317095eb226a0b8d455e887
+patch_args="-Np1"
+
+build_options="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel qt5-location-devel
+	 qt5-declarative-devel"
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	makedepends+=" musl-legacy-compat"
+fi
+
+if [ "$XBPS_WORDSIZE" -eq 32 ]; then
+	nodebug=yes  # prevent OOM
+fi
+
+if [ ! "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
+	#TODO: look into working around this with -32bit packages
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	mips*|ppc*) makedepends+=" libatomic-devel" ;;
+	*) ;;
+esac
+
+# TODO: likely related to not matching wordsize
+case "$XBPS_TARGET_MACHINE" in
+	arm*|mips*);;
+	*) build_options_default="snapshot";;
+esac
+
+_bootstrap_gn() {
+	# Bootstrap gn (generate ninja)
+	echo "Bootstrapping 'gn'"
+	cd ${wrksrc}/src/3rdparty/gn
+	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
+	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
+		python2 build/gen.py --no-last-commit-position --out-path \
+			${wrksrc}/src/3rdparty/gn/out/Release --cc "$CC_host" \
+                        --cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
+	ninja -C out/Release gn
+	cd ${wrksrc}
+}
+
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+	export PATH=${PATH/\/builddir\/.xbps-qt5-webengine\/wrappers:/}
+	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns
+	
+	case "$XBPS_TARGET_MACHINE" in
+		armv5*|armv6*)  # Disable "yield" assembler instruction
+			sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
+				qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
+				-e 's;"yield";"nop";'
+			;;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl) export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152";;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		mips*)  # sgidefs.h is in /usr/include/asm
+			for f in \
+				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
+				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
+					sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
+			done
+			# Assume that RGBA order is correct for big endian CPUs
+			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
+				-e '/#error Read the comment at this location/d'
+			;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		_bootstrap_gn
+	fi
+}
+
+pre_build() {
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		#TODO: FIX!!!
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove usr/lib/qt5/plugins/designer
+		fi
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 08618d492940f2f1a908385b0e6395b181f6a4e6 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 03/10] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 98 ++++++++++++++++++++++++++++++++-----
 1 file changed, 87 insertions(+), 11 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..33762e2324d 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -16,10 +16,76 @@ do_configure() {
 		msg_error "${pkgver}: Could not find qmake - missing in hostdepends?\n"
 	fi
 	if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
+		case $XBPS_TARGET_MACHINE in
+			i686*) _qt_arch=i386;;
+			x86_64*) _qt_arch=x86_64;;
+			aarch64*) _qt_arch=arm64;;
+			arm*) _qt_arch=arm;;
+			mips*) _qt_arch=mips;;
+		esac
+		mkdir -p "${wrksrc}/.target-spec/linux-g++"
+		cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC}
+QMAKE_CXX               = ${CXX}
+QMAKE_LINK              = ${CXX}
+QMAKE_LINK_C            = ${CC}
+QMAKE_LINK_SHLIB        = ${CXX}
+
+QMAKE_AR                = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY}
+QMAKE_NM                = ${NM} -P
+QMAKE_STRIP             = ${STRIP}
+
+QMAKE_CFLAGS            = ${CFLAGS}
+QMAKE_CXXFLAGS          = ${CXXFLAGS}
+QMAKE_LFLAGS            = ${LDFLAGS}
+load(qt_config)
+_EOF
+		echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
+
+		mkdir -p "${wrksrc}/.host-spec/linux-g++"
+		cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC_host}
+QMAKE_CXX               = ${CXX_host}
+QMAKE_LINK              = ${CXX_host}
+QMAKE_LINK_C            = ${CC_host}
+QMAKE_LINK_SHLIB        = ${CXX_host}
+
+QMAKE_AR                = gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY_host}
+QMAKE_NM                = ${NM_host} -P
+QMAKE_STRIP             = ${STRIP_host}
+
+QMAKE_CFLAGS            = ${CFLAGS_host}
+QMAKE_CXXFLAGS          = ${CXXFLAGS_host}
+QMAKE_LFLAGS            = ${LDFLAGS_host}
+load(qt_config)
+_EOF
+echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
 		cat > "${wrksrc}/qt.conf" <<_EOF
 [Paths]
 Sysroot=${XBPS_CROSS_BASE}
-Prefix=${XBPS_CROSS_BASE}/usr
+Prefix=/usr
 ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
 Data=${XBPS_CROSS_BASE}/usr/share/qt5
 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
@@ -38,18 +104,28 @@ HostPrefix=/usr
 HostData=/usr/lib/qt5
 HostBinaries=/usr/lib/qt5/bin
 HostLibraries=/usr/lib
-Spec=linux-g++
-TargetSpec=linux-g++
+Spec=${wrksrc}/.host-spec/linux-g++
+TargetSpec=${wrksrc}/.target-spec/linux-g++
 _EOF
-		qmake_args="-qtconf ${wrksrc}/qt.conf"
+		qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/pkg-config"
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			${configure_args}
+	else
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QMAKE_CC=$CC QMAKE_CXX=$CXX \
+			QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
+			QMAKE_CFLAGS="${CFLAGS}" \
+			QMAKE_CXXFLAGS="${CXXFLAGS}" \
+			QMAKE_LFLAGS="${LDFLAGS}" \
+			${configure_args}
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
-		PREFIX=/usr \
-		LIB=/usr/lib \
-		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
-		QMAKE_CFLAGS="${CFLAGS}" \
-		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From 75e193039aaf772237995f5d53f4f30ab5a686d1 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 04/10] telegram-desktop: rebuild for qt5.14.0

[ci skip]
---
 srcpkgs/telegram-desktop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index 37ab5801d84..5dacb026d4a 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=1.9.8
-revision=1
+revision=2
 wrksrc="tdesktop-${version}-full"
 build_style=cmake
 build_helper="qemu"
@@ -17,7 +17,7 @@ makedepends="alsa-lib-devel ffmpeg-devel libdbusmenu-glib-devel libopenal-devel
  minizip-devel opus-devel xxHash-devel pulseaudio-devel qt5-devel range-v3
  libva-devel enchant2-devel rapidjson liblz4-devel liblzma-devel rlottie-devel
  MesaLib-devel"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5-core>=5.14.1<5.14.2"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"
@@ -49,7 +49,7 @@ fi
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 27f63ae299120b1cb811ac88e45c1a7611cd1c5d Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:05:28 +0100
Subject: [PATCH 05/10] qt5-styleplugins: rebuild against qt5.14

---
 srcpkgs/qt5-styleplugins/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5-styleplugins/template b/srcpkgs/qt5-styleplugins/template
index f6c511cad4c..10fc6e4fa26 100644
--- a/srcpkgs/qt5-styleplugins/template
+++ b/srcpkgs/qt5-styleplugins/template
@@ -1,13 +1,13 @@
 # Template file for 'qt5-styleplugins'
 pkgname=qt5-styleplugins
 version=5.0.0
-revision=11
+revision=12
 _gitrev=335dbece103e2cbf6c7cf819ab6672c2956b17b3
 wrksrc="qtstyleplugins-${_gitrev}"
 build_style=qmake
 hostmakedepends="pkg-config qt5-host-tools qt5-devel"
 makedepends="libxcb-devel libxkbcommon-devel libinput-devel tslib-devel gtk+-devel qt5-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5>=5.14.1<5.14.2"
 short_desc="Additional style plugins for Qt5"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="LGPL-2.1-only, LGPL-3.0-only"

From da1144e26179436ab59899c41aced4e717162797 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:27:31 +0100
Subject: [PATCH 06/10] qt5dxcb-plugin: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5dxcb-plugin/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5dxcb-plugin/template b/srcpkgs/qt5dxcb-plugin/template
index b5408ed89fb..f193ca5b9ea 100644
--- a/srcpkgs/qt5dxcb-plugin/template
+++ b/srcpkgs/qt5dxcb-plugin/template
@@ -1,14 +1,14 @@
 # Template file for 'qt5dxcb-plugin'
 pkgname=qt5dxcb-plugin
 version=5.0.1
-revision=3
+revision=4
 build_style=qmake
 make_build_args="VERSION=${version}"
 hostmakedepends="pkg-config qt5-qmake"
 makedepends="cairo-devel libSM-devel libXi-devel libxkbcommon-devel
  qt5-x11extras-devel xcb-util-image-devel xcb-util-keysyms-devel
- xcb-util-renderutil-devel xcb-util-wm-devel"
-depends="qt5>=5.13.2<5.13.3"
+ xcb-util-renderutil-devel xcb-util-wm-devel qt5-xcb-private-headers"
+depends="qt5-core>=5.14.1<5.14.2"
 short_desc="Qt platform plugins for DDE"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later"
@@ -16,12 +16,11 @@ homepage="https://github.com/linuxdeepin/qt5dxcb-plugin/"
 changelog="https://github.com/linuxdeepin/qt5dxcb-plugin/blob/master/CHANGELOG.md"
 distfiles="https://github.com/linuxdeepin/qt5dxcb-plugin/archive/${version}.tar.gz"
 checksum=b19253f9f577b2a9d86774ba95d252318f3d692ab92d2e62fbf0578d56db453d
-patch_args="-Np1"
 
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo
@@ -29,11 +28,7 @@ pre_configure() {
 		msg_red "${_qt5_version%_*} does not match ${_qt5_dep_ver}\\n"
 		exit 1
 	fi
-
-	# no headers for 5.13.1 yet; 5.13.0 headers are the same for this
-	# remove on next version upgrade (after upstream has added them)
-	ln -s ${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.0 \
-		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.2
+	sed -i 's|error(Not support Qt Version: .*)|INCLUDEPATH += /usr/include/qt5xcb-private|' platformplugin/linux.pri
 }
 
 if [ "$CROSS_BUILD" ]; then

From 09b5f30bf88a8fd2f8278760b6f4f904be416392 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Thu, 5 Dec 2019 08:42:41 +0100
Subject: [PATCH 07/10] kwin: rebuild against qt5.14.0

[ci skip]
---
 srcpkgs/kwin/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kwin/template b/srcpkgs/kwin/template
index 8f8b04b4317..42ffe893193 100644
--- a/srcpkgs/kwin/template
+++ b/srcpkgs/kwin/template
@@ -1,7 +1,7 @@
 # Template file for 'kwin'
 pkgname=kwin
 version=5.17.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext breeze pkg-config"
@@ -9,7 +9,7 @@ makedepends="plasma-framework-devel kcmutils-devel knewstuff-devel
  kscreenlocker-devel kinit-devel xcb-util-cursor-devel qt5-multimedia-devel
  kdecoration-devel libxkbcommon-devel libinput-devel libSM-devel
  libICE-devel xcb-util-wm-devel qt5-sensors-devel libcap-devel"
-depends="breeze hicolor-icon-theme kinit qt5>=5.13.2<5.13.3"
+depends="breeze hicolor-icon-theme kinit qt5-core>=5.14.1<5.14.2"
 short_desc="KDE Window manager"
 maintainer="John <johnz@posteo.net>"
 license="GPL-2.0-or-later"
@@ -29,7 +29,7 @@ esac
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 43e0f27ec0fa3fe63f4c9e83fc41211977286d98 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 13:31:14 +0100
Subject: [PATCH 08/10] plasma-framework: add patch for qt5.14

---
 srcpkgs/plasma-framework/patches/qt5.14.patch | 18 ++++++++++++++++++
 srcpkgs/plasma-framework/template             |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/plasma-framework/patches/qt5.14.patch

diff --git a/srcpkgs/plasma-framework/patches/qt5.14.patch b/srcpkgs/plasma-framework/patches/qt5.14.patch
new file mode 100644
index 00000000000..c8b08ba04ba
--- /dev/null
+++ b/srcpkgs/plasma-framework/patches/qt5.14.patch
@@ -0,0 +1,18 @@
+Source: @Johnnynator
+Upstream: no (Need to verify if this isn't a qt5 bug)
+Reason: QLocale().uiLanguages() in Qt5.14 can return an empty list,
+	in previous Qt versions it had a minimum size of one with
+	locale"C" as content.
+
+--- src/declarativeimports/calendar/calendar.cpp	2019-11-02 14:02:23.000000000 +0100
++++ -	2019-12-13 19:22:09.178234731 +0100
+@@ -199,7 +199,8 @@
+     // locale and take the month name from that.
+     //
+     // See https://bugs.kde.org/show_bug.cgi?id=353715
+-    const QString lang = QLocale().uiLanguages().at(0);
++    const QStringList languages = QLocale().uiLanguages();
++    const QString lang = languages.size() > 0 ? languages.at(0) : QString();
+     // If lang is empty, it will create just a system locale
+     QLocale langLocale(lang);
+     return langLocale.standaloneMonthName(m_displayedDate.month());
diff --git a/srcpkgs/plasma-framework/template b/srcpkgs/plasma-framework/template
index 0f8270505c7..5ef29e8f184 100644
--- a/srcpkgs/plasma-framework/template
+++ b/srcpkgs/plasma-framework/template
@@ -1,7 +1,7 @@
 # Template file for 'plasma-framework'
 pkgname=plasma-framework
 version=5.66.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF
  -DDESKTOPTOJSON_EXECUTABLE=/usr/bin/desktoptojson"

From 82ae0443ac3b871b9af549fc64313b8169ca83b8 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 15:13:35 +0100
Subject: [PATCH 09/10] qt5-webkit: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5-webkit/patches/qt5.14.patch      | 93 ++++++++++++++++++++
 srcpkgs/qt5-webkit/patches/qt5.14.patch.args |  1 +
 srcpkgs/qt5-webkit/template                  |  2 +-
 3 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch.args

diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch b/srcpkgs/qt5-webkit/patches/qt5.14.patch
new file mode 100644
index 00000000000..799d53f1f55
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch
@@ -0,0 +1,93 @@
+From c344187a099f8fd749dc84ffcc125c0925103819 Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Tue, 10 Sep 2019 03:51:42 +0300
+Subject: Fix compilation of HTTP2 settings with Qt >= 5.14
+
+Public API QHttp2Configuration was added, so we use it now instead of
+ugly hack required for previous versions. Workaround for QTBUG-77308 is
+no loger needed in 5.14, so we only enable server push.
+
+Change-Id: I3e6817d8fa274c3a849f09b23ca58f93318be6c4
+---
+ .../network/qt/QNetworkReplyHandler.cpp       |  6 +++---
+ .../platform/network/qt/ResourceRequestQt.cpp | 20 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+index 0da45fbc79a5..7924595582ac 100644
+--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
++++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+@@ -41,7 +41,7 @@
+ 
+ #include <QCoreApplication>
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ #include <private/http2protocol_p.h>
+ #include <cstdlib>
+@@ -62,7 +62,7 @@ ProtocolParameters::ProtocolParameters()
+ 
+ QT_END_NAMESPACE
+ 
+-#endif // USE(HTTP2)
++#endif // USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ static const int gMaxRedirections = 10;
+ 
+@@ -797,7 +797,7 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
+     if (!manager)
+         return 0;
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+     static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
+     if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
+         Http2::ProtocolParameters params;
+diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+index 2cf2e7750dde..310738449b75 100644
+--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
++++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+@@ -29,7 +29,10 @@
+ 
+ #if USE(HTTP2)
+ #include <QSslSocket>
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++#include <QHttp2Configuration>
+ #endif
++#endif // USE(HTTP2)
+ 
+ namespace WebCore {
+ 
+@@ -65,6 +68,16 @@ bool ResourceRequest::alpnIsSupported()
+     return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
+         QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
+ }
++
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++static QHttp2Configuration createHttp2Configuration()
++{
++    QHttp2Configuration params;
++    params.setServerPushEnabled(true);
++    return params;
++}
++#endif
++
+ #endif
+ 
+ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
+@@ -76,8 +89,13 @@ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) co
+ 
+ #if USE(HTTP2)
+     static const bool NegotiateHttp2ForHttps = alpnIsSupported();
+-    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps)
++    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps) {
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++        static const auto params = createHttp2Configuration();
++        request.setHttp2Configuration(params);
++#endif
+         request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
++    }
+ #endif // USE(HTTP2)
+ 
+     const HTTPHeaderMap &headers = httpHeaderFields();
diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch.args b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
new file mode 100644
index 00000000000..2eba1cb3c5c
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
@@ -0,0 +1 @@
+-Np1
diff --git a/srcpkgs/qt5-webkit/template b/srcpkgs/qt5-webkit/template
index c7c09c1376e..4c8b3f6414f 100644
--- a/srcpkgs/qt5-webkit/template
+++ b/srcpkgs/qt5-webkit/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webkit'
 pkgname=qt5-webkit
 version=5.212.0
-revision=6
+revision=7
 _snap=1565895469
 _v=${version%.*}
 wrksrc="qtwebkit-everywhere-src-${_v}"

From 9fcab96dad459e39d6f9c7c827b8edde4537af04 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 28 Jan 2020 09:40:25 +0100
Subject: [PATCH 10/10] plasma-integration: rebuild for qt5-5.14.1

---
 srcpkgs/plasma-integration/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/plasma-integration/template b/srcpkgs/plasma-integration/template
index 5a1059fbf75..559a9abf5ff 100644
--- a/srcpkgs/plasma-integration/template
+++ b/srcpkgs/plasma-integration/template
@@ -1,7 +1,7 @@
 # Template file for 'plasma-integration'
 pkgname=plasma-integration
 version=5.17.5
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules pkg-config qt5-qmake qt5-host-tools

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (6 preceding siblings ...)
  2020-02-02 16:03 ` voidlinux-github
@ 2020-03-18 18:37 ` streaksu
  2020-03-18 18:45 ` Johnnynator
                   ` (25 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: streaksu @ 2020-03-18 18:37 UTC (permalink / raw)
  To: ml

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

New comment by streaksu on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-600795886

Comment:
Any news about this? Void could make good use of the granularity this patch proposes and the new qt version.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (7 preceding siblings ...)
  2020-03-18 18:37 ` streaksu
@ 2020-03-18 18:45 ` Johnnynator
  2020-03-18 21:27 ` travankor
                   ` (24 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-18 18:45 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-600799488

Comment:
> Any news about this? Void could make good use of the granularity this patch proposes and the new qt version.

I currently don't have much time to get all the (broken) cross compilation stuff fixed. QMake breaks like every release in that regard for us.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (8 preceding siblings ...)
  2020-03-18 18:45 ` Johnnynator
@ 2020-03-18 21:27 ` travankor
  2020-03-18 22:31 ` Johnnynator
                   ` (23 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-18 21:27 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-600867747

Comment:
FWIW Alpine is on qt5.14.1 and their build files look relatively more simple so I wonder how they are cross-compiling 🤔

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (9 preceding siblings ...)
  2020-03-18 21:27 ` travankor
@ 2020-03-18 22:31 ` Johnnynator
  2020-03-19 22:48 ` mintsuki
                   ` (22 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-18 22:31 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-600892000

Comment:
> FWIW Alpine is on qt5.14.1 and their build files look relatively more simple so I wonder how they are cross-compiling thinking

They aren't cross compiling usually.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (10 preceding siblings ...)
  2020-03-18 22:31 ` Johnnynator
@ 2020-03-19 22:48 ` mintsuki
  2020-03-19 23:52 ` q66
                   ` (21 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: mintsuki @ 2020-03-19 22:48 UTC (permalink / raw)
  To: ml

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

New comment by mintsuki on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601452063

Comment:
Is there an ETA for this version bump considering it's been now more than 5 months since this PR was opened?

Qt is quite an important package and, at least its `qt5-webengine` component, should see fairly constant maintainance as quite a few browsers (such as `qutebrowser`, `falkon`, and `otter`) depend on it for, amongst other things, CVE patches.

I have been waiting a long time for this PR to be completed but at this point I am starting to lose hope and perhaps I should give it a shot myself, even though I am not superfamiliar with `xbps`.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (11 preceding siblings ...)
  2020-03-19 22:48 ` mintsuki
@ 2020-03-19 23:52 ` q66
  2020-03-19 23:54 ` Johnnynator
                   ` (20 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: q66 @ 2020-03-19 23:52 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601468277

Comment:
I don't think we're exactly in a hurry, 5.13 is not yet EOL, still officially supported until June, so if some major CVE arises, there should be a patch release. But yes, would be nice to finally get it updated.

You're obviously free to help, if you want to speed it up.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (12 preceding siblings ...)
  2020-03-19 23:52 ` q66
@ 2020-03-19 23:54 ` Johnnynator
  2020-03-20  6:25 ` travankor
                   ` (19 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-19 23:54 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601468826

Comment:
> I have been waiting a long time for this PR to be completed but at this point I am starting to lose hope and perhaps I should give it a shot myself, even though I am not superfamiliar with `xbps`.

You don't need to know much about xbps, just a lot about qmake and how it likes to break for our cross use cases. I really hope that Qt6 changing to CMake will make this less problematic.

> Is there an ETA for this version bump considering it's been now more than 5 months since this PR was opened?

Sry, can't give any ETA.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (13 preceding siblings ...)
  2020-03-19 23:54 ` Johnnynator
@ 2020-03-20  6:25 ` travankor
  2020-03-20 13:00 ` pullmoll
                   ` (18 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-20  6:25 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601553942

Comment:
>You don't need to know much about xbps, just a lot about qmake and how it likes to break for our cross use cases. I really hope that Qt6 changing to CMake will make this less problematic.

+1 (and I hope they get rid of the MOC)

>Sry, can't give any ETA.

QT 5.15 will be the last one in the 5.X series, so that might be the one to focus on, instead of QT 5.14.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (14 preceding siblings ...)
  2020-03-20  6:25 ` travankor
@ 2020-03-20 13:00 ` pullmoll
  2020-03-20 13:17 ` xtraeme
                   ` (17 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: pullmoll @ 2020-03-20 13:00 UTC (permalink / raw)
  To: ml

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

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601687987

Comment:
Just FYI I also have a branch where I've been trying to get 5.14.1 built:
https://github.com/pullmoll/void-packages/tree/qt5-5.14
This branch builds qt5 for native architectures. Cross building is where there's a lot of work left to do and for which I don't currently find sufficient time.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (15 preceding siblings ...)
  2020-03-20 13:00 ` pullmoll
@ 2020-03-20 13:17 ` xtraeme
  2020-03-20 13:19 ` xtraeme
                   ` (16 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: xtraeme @ 2020-03-20 13:17 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601695555

Comment:
well, I'm starting to think that we should move on and continue if something is not cross buildable.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (16 preceding siblings ...)
  2020-03-20 13:17 ` xtraeme
@ 2020-03-20 13:19 ` xtraeme
  2020-03-20 13:29 ` Johnnynator
                   ` (15 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: xtraeme @ 2020-03-20 13:19 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601696228

Comment:
because, cross compilation is really an intensive hard task. So we should push changes and when we've got cross buildable push it.

Otherwise we will suffer with the same issues that plagued pkgsrc...

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (17 preceding siblings ...)
  2020-03-20 13:19 ` xtraeme
@ 2020-03-20 13:29 ` Johnnynator
  2020-03-20 13:31 ` Johnnynator
                   ` (14 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-20 13:29 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601701048

Comment:
> Just FYI I also have a branch where I've been trying to get 5.14.1 built:
> https://github.com/pullmoll/void-packages/tree/qt5-5.14
> This branch builds qt5 for native architectures. Cross building is where there's a lot of work left to do and for which I don't currently find sufficient time.

Non cross also works here :)



> well, I'm starting to think that we should move on and continue if something is not cross buildable.

I agree on that one for less used software, but Qt is quite popular and I'd argue that people with e.g. a Pinebook would like to have Qt applications in the repo. We should just get a native aarch64 builder...

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (18 preceding siblings ...)
  2020-03-20 13:29 ` Johnnynator
@ 2020-03-20 13:31 ` Johnnynator
  2020-03-20 15:03 ` pullmoll
                   ` (13 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-20 13:31 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601701048

Comment:
> Just FYI I also have a branch where I've been trying to get 5.14.1 built:
> https://github.com/pullmoll/void-packages/tree/qt5-5.14
> This branch builds qt5 for native architectures. Cross building is where there's a lot of work left to do and for which I don't currently find sufficient time.

Non cross also works here :), cross compiling itself also works. Just qmake build styles are broken.


> well, I'm starting to think that we should move on and continue if something is not cross buildable.

I agree on that one for less used software, but Qt is quite popular and I'd argue that people with e.g. a Pinebook would like to have Qt applications in the repo. We should just get a native aarch64 builder...

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (19 preceding siblings ...)
  2020-03-20 13:31 ` Johnnynator
@ 2020-03-20 15:03 ` pullmoll
  2020-03-20 15:53 ` q66
                   ` (12 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: pullmoll @ 2020-03-20 15:03 UTC (permalink / raw)
  To: ml

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

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601746547

Comment:
I think it would be worth a try to go modular with qt5. That would mean build qt5-base native and later cross build qt5-base using the qmake build style and host tools. I'm not sure if we can have different build styles for native and cross builds in one package, though. It should be possible AFAICT.

If it works this would avoid having to build the host tools on the fly when cross compiling and the big amount of patching required to also get the target arch tools built in the same go.

In other words: us trying to keep the monolithic build approach is also causing much of our trouble.

Once we'd have the native qt5-base (and qt5-qmake, qt5-host-tools etc.) all of the qt5 modules should then be built using the qmake build style and its generated `qt.conf` for the target, native or cross. The *only* thing required for this to work is the qmake build style producing good results for all cases.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (20 preceding siblings ...)
  2020-03-20 15:03 ` pullmoll
@ 2020-03-20 15:53 ` q66
  2020-03-20 17:48 ` Chocimier
                   ` (11 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: q66 @ 2020-03-20 15:53 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601772354

Comment:
this PR kind of started modularizing some of these things, I think it's too much work to get it done within the constraints though, we need to get the update out and then we can worry about changing things further :)

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (21 preceding siblings ...)
  2020-03-20 15:53 ` q66
@ 2020-03-20 17:48 ` Chocimier
  2020-03-22 23:43 ` mintsuki
                   ` (10 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Chocimier @ 2020-03-20 17:48 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-601832361

Comment:
@pullmoll: build_style is regular variable that can be set under `if $cross_build`, no problem here. It is utilized in cmake template.

@xtraeme: Please note that when package do not cross compile, anything depending can't be updated or rebuild for cross-build archs too.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (22 preceding siblings ...)
  2020-03-20 17:48 ` Chocimier
@ 2020-03-22 23:43 ` mintsuki
  2020-03-23  0:11 ` travankor
                   ` (9 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: mintsuki @ 2020-03-22 23:43 UTC (permalink / raw)
  To: ml

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

New comment by mintsuki on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602299165

Comment:
I attempted this update myself and sent a PR here: https://github.com/void-linux/void-packages/pull/20296

I compiled it and tested it for x86_64 glibc only. I'll test x86_64-musl shortly and report back.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (23 preceding siblings ...)
  2020-03-22 23:43 ` mintsuki
@ 2020-03-23  0:11 ` travankor
  2020-03-23  0:57 ` q66
                   ` (8 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-23  0:11 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602303334

Comment:
>I compiled it and tested it for x86_64 glibc only. I'll test x86_64-musl shortly and report back.

The main issue is that ARM/PPC builds of QT5 are not build-able with Void's infrastructure (hence, why the problem is cross-compiling with qmake). Alpine Linux gets around this by having native build machines for each architecture.

>Please note that when package do not cross compile, anything depending can't be updated or rebuild for cross-build archs too.

I feel like the buildbot replacement should handle this automatically.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (24 preceding siblings ...)
  2020-03-23  0:11 ` travankor
@ 2020-03-23  0:57 ` q66
  2020-03-23  7:55 ` travankor
                   ` (7 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: q66 @ 2020-03-23  0:57 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602310536

Comment:
@travankor only ARM, void doesn't do official ppc packages and my ppc repos are completely native. Nevertheless, having qt be cross-compilable is crucial, to any supported target.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (25 preceding siblings ...)
  2020-03-23  0:57 ` q66
@ 2020-03-23  7:55 ` travankor
  2020-03-23  7:55 ` travankor
                   ` (6 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-23  7:55 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602439289

Comment:
>only ARM, void doesn't do official ppc packages and my ppc repos are completely native.

I thought this was only a temporary arrangement? Well, it's a shame if void won't accept PPC as on official arch.

>Nevertheless, having qt be cross-compilable is crucial, to any supported target.

Well, seems like this will be fixed for QT6
https://wiki.qt.io/CMake_Port

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (26 preceding siblings ...)
  2020-03-23  7:55 ` travankor
@ 2020-03-23  7:55 ` travankor
  2020-03-23  7:58 ` travankor
                   ` (5 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-23  7:55 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602439289

Comment:
>only ARM, void doesn't do official ppc packages and my ppc repos are completely native.

I thought this was only a temporary arrangement? Well, it's a shame if void won't accept PPC as an official arch.

>Nevertheless, having qt be cross-compilable is crucial, to any supported target.

Well, seems like this will be fixed for QT6
https://wiki.qt.io/CMake_Port

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (27 preceding siblings ...)
  2020-03-23  7:55 ` travankor
@ 2020-03-23  7:58 ` travankor
  2020-03-23  8:57 ` Johnnynator
                   ` (4 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: travankor @ 2020-03-23  7:58 UTC (permalink / raw)
  To: ml

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

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602439289

Comment:
>only ARM, void doesn't do official ppc packages and my ppc repos are completely native.

I thought this was only a temporary arrangement? Well, it's a shame if void won't accept PPC as an official arch.

>Nevertheless, having qt be cross-compilable is crucial, to any supported target.

Seems like this will be fixed for QT6.
https://wiki.qt.io/CMake_Port

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (28 preceding siblings ...)
  2020-03-23  7:58 ` travankor
@ 2020-03-23  8:57 ` Johnnynator
  2020-03-23  8:57 ` Johnnynator
                   ` (3 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-23  8:57 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602465220

Comment:
Don't hold your breath that CMake will make it easier. It is only better documented and usually easier to configure but has even worse cross compile capabilities than qmake.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (29 preceding siblings ...)
  2020-03-23  8:57 ` Johnnynator
@ 2020-03-23  8:57 ` Johnnynator
  2020-03-23 13:35 ` q66
                   ` (2 subsequent siblings)
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-03-23  8:57 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602465220

Comment:
Don't hold your breath that CMake will make it easier. It is only better documented and usually easier to configure but has even worse cross compile capabilities than qmake. And there are so many ways in CMake to make it also a pain to work with.

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

* Re: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (30 preceding siblings ...)
  2020-03-23  8:57 ` Johnnynator
@ 2020-03-23 13:35 ` q66
  2020-04-03 15:00 ` [PR PATCH] [Updated] " Johnnynator
  2020-04-03 16:19 ` [PR PATCH] [Merged]: " Johnnynator
  33 siblings, 0 replies; 35+ messages in thread
From: q66 @ 2020-03-23 13:35 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15310#issuecomment-602592221

Comment:
@travankor if it becomes an official architecture, it will be native as well.

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

* Re: [PR PATCH] [Updated] [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (31 preceding siblings ...)
  2020-03-23 13:35 ` q66
@ 2020-04-03 15:00 ` Johnnynator
  2020-04-03 16:19 ` [PR PATCH] [Merged]: " Johnnynator
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-04-03 15:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Johnnynator/void-packages qt5.14
https://github.com/void-linux/void-packages/pull/15310

[WIP] qt5 update to 5.14.0
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled and runtime)
- [ ] i686 ()
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [ ] armv6l (compiled without webengine)
- [ ] aarch64-musl (compiled)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross (for some qmake packages)
- rebase webengine ppc patches @q66 
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- fix webengine loading resources from `/share` instead of `/usr/share`

# Bugs

- webengine currently tries to fetch resources from `/share` instead of `/usr/share
- Plasmashell wayland on musl crashes regulary 

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qt5.14-15310.patch --]
[-- Type: text/x-diff, Size: 620000 bytes --]

From 0214723a0262dc3b400aaa854f1e407cf561d759 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 00:59:18 +0200
Subject: [PATCH 01/17] qt5: update to 5.14.2

---
 common/shlibs                                 |  159 +-
 srcpkgs/{qt5-webengine => qt5-base-docs}      |    0
 srcpkgs/qt5-concurrent                        |    1 +
 srcpkgs/qt5-core                              |    1 +
 srcpkgs/qt5-dbus                              |    1 +
 srcpkgs/qt5-gui                               |    1 +
 srcpkgs/qt5-network                           |    1 +
 srcpkgs/qt5-opengl                            |    1 +
 srcpkgs/qt5-printsupport                      |    1 +
 srcpkgs/qt5-quicktimeline                     |    1 +
 srcpkgs/qt5-sql                               |    1 +
 srcpkgs/qt5-test                              |    1 +
 srcpkgs/qt5-widgets                           |    1 +
 srcpkgs/qt5-xcb-private-headers               |    1 +
 srcpkgs/qt5-xml                               |    1 +
 .../0090-hard-disable-qmlchachegen.patch      |   10 -
 srcpkgs/qt5/files/qmlcachegen.pro             |   38 +
 srcpkgs/qt5/files/qmlimportscanner.pro        |    2 +
 srcpkgs/qt5/files/qmllint.pro                 |   17 +-
 srcpkgs/qt5/files/qttools_src.pro             |   18 +-
 srcpkgs/qt5/files/resolv_compat.h             |   29 -
 srcpkgs/qt5/files/uic.pro                     |    1 +
 srcpkgs/qt5/files/uitools.pro                 |   15 +
 srcpkgs/qt5/patches/0001-addlr.patch          |   23 +
 ...te-instead-of-_libc_fpstate-on-linux.patch |   42 -
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |   26 -
 .../patches/0004-musl-dispatch-to-musl.patch  |  103 -
 .../qt5/patches/0008-musl-no-mallinfo.patch   |   40 -
 srcpkgs/qt5/patches/0009-musl-off_t.patch     |   10 -
 .../qt5/patches/0010-musl-pread-pwrite.patch  |   18 -
 .../patches/0011-musl-replace-pvalloc.patch   |   14 -
 srcpkgs/qt5/patches/0012-musl-resolve.patch   |   26 -
 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch |   18 -
 .../qt5/patches/0017-musl-stackstart.patch    |   20 -
 srcpkgs/qt5/patches/0020-musl-sandbox.patch   |   71 -
 .../qt5/patches/0023-enable_tools-cross.patch |   46 -
 ...0025-musl-chromium-default-stacksize.patch |   15 -
 srcpkgs/qt5/patches/0026-data_pack-be.patch   |   15 -
 .../qt5/patches/0027-remove-glibc-check.patch |   13 -
 .../0032-musl-cross-no-asm_ptrace_h.patch     |   30 -
 srcpkgs/qt5/patches/0040-yasm-nls.patch       |   13 -
 .../0042-arm-void-is-not-android.patch        |   21 -
 .../qt5/patches/0044-qt-musl-execinfo.patch   |  107 -
 .../0045-qt-musl-thread-stacksize.patch       |   26 -
 .../qt5/patches/0046-sandbox-membarrier.patch |   60 -
 .../qt5/patches/0047-gn-cross-sysroot.patch   |   24 -
 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch  |   30 +
 .../qt5/patches/0089-webengine-ppc64.patch    |   20 -
 .../qt5/patches/0090-chromium-ppc64le.patch   | 4267 -----------------
 .../patches/0091-chromium-ppc64-musl.patch    |  141 -
 .../qt5/patches/0092-chromium-ppc64-be.patch  | 2970 ------------
 .../qt5/patches/0093-chromium-v8-elfv2.patch  |   43 -
 .../0094-big-endian-skia-portable.patch       |   17 -
 .../patches/0100-sandbox-sched_getparam.patch |   24 -
 srcpkgs/qt5/template                          |  370 +-
 55 files changed, 385 insertions(+), 8580 deletions(-)
 rename srcpkgs/{qt5-webengine => qt5-base-docs} (100%)
 create mode 120000 srcpkgs/qt5-concurrent
 create mode 120000 srcpkgs/qt5-core
 create mode 120000 srcpkgs/qt5-dbus
 create mode 120000 srcpkgs/qt5-gui
 create mode 120000 srcpkgs/qt5-network
 create mode 120000 srcpkgs/qt5-opengl
 create mode 120000 srcpkgs/qt5-printsupport
 create mode 120000 srcpkgs/qt5-quicktimeline
 create mode 120000 srcpkgs/qt5-sql
 create mode 120000 srcpkgs/qt5-test
 create mode 120000 srcpkgs/qt5-widgets
 create mode 120000 srcpkgs/qt5-xcb-private-headers
 create mode 120000 srcpkgs/qt5-xml
 delete mode 100644 srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
 create mode 100644 srcpkgs/qt5/files/qmlcachegen.pro
 delete mode 100644 srcpkgs/qt5/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5/files/uitools.pro
 create mode 100644 srcpkgs/qt5/patches/0001-addlr.patch
 delete mode 100644 srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 delete mode 100644 srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 delete mode 100644 srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0009-musl-off_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
 delete mode 100644 srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
 delete mode 100644 srcpkgs/qt5/patches/0012-musl-resolve.patch
 delete mode 100644 srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
 delete mode 100644 srcpkgs/qt5/patches/0017-musl-stackstart.patch
 delete mode 100644 srcpkgs/qt5/patches/0020-musl-sandbox.patch
 delete mode 100644 srcpkgs/qt5/patches/0023-enable_tools-cross.patch
 delete mode 100644 srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0026-data_pack-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0027-remove-glibc-check.patch
 delete mode 100644 srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
 delete mode 100644 srcpkgs/qt5/patches/0040-yasm-nls.patch
 delete mode 100644 srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
 delete mode 100644 srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
 delete mode 100644 srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
 delete mode 100644 srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
 delete mode 100644 srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
 delete mode 100644 srcpkgs/qt5/patches/0089-webengine-ppc64.patch
 delete mode 100644 srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
 delete mode 100644 srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
 delete mode 100644 srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
 delete mode 100644 srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
 delete mode 100644 srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
 delete mode 100644 srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch

diff --git a/common/shlibs b/common/shlibs
index 4b00da9a72e..14e6c812fe2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1876,86 +1876,89 @@ libgltf-0.1.so.1 libgltf-0.1.0_1
 libabw-0.1.so.1 libabw-0.1.0_1
 libcmis-0.5.so.5 libcmis-0.5.0_1
 libcmis-c-0.5.so.5 libcmis-0.5.0_1
-libQt5Bluetooth.so.5 qt5-connectivity-5.6.0_1
-libQt53DAnimation.so.5 qt5-3d-5.10.1_1
-libQt53DCore.so.5 qt5-3d-5.6.0_1
-libQt53DInput.so.5 qt5-3d-5.6.0_1
-libQt53DLogic.so.5 qt5-3d-5.6.0_1
-libQt53DRender.so.5 qt5-3d-5.6.0_1
-libQt53DQuick.so.5 qt5-3d-5.6.0_1
-libQt53DQuickInput.so.5 qt5-3d-5.6.0_1
-libQt53DQuickRender.so.5 qt5-3d-5.6.0_1
-libQt53DQuickScene2D.so.5 qt5-3d-5.10.1_1
-libQt53DExtras.so.5 qt5-3d-5.6.0_1
-libQt53DQuickExtras.so.5 qt5-3d-5.6.0_1
-libQt53DQuickAnimation.so.5 qt5-3d-5.10.1_1
-libQt5Charts.so.5 qt5-charts-5.7.1_1
-libQt5DataVisualization.so.5 qt5-datavis3d-5.7.1_1
-libQt5Gamepad.so.5 qt5-gamepad-5.7.1_1
-libQt5Nfc.so.5 qt5-connectivity-5.6.0_1
-libQt5WebView.so.5 qt5-webview-5.6.0_1
-libQt5Qml.so.5 qt5-declarative-5.6.0_1
-libQt5QmlDevTools.so.5 qt5-declarative-5.13.0_1
-libQt5Quick.so.5 qt5-declarative-5.6.0_1
-libQt5QuickTest.so.5 qt5-declarative-5.6.0_1
-libQt5QuickWidgets.so.5 qt5-declarative-5.6.0_1
-libQt5QuickParticles.so.5 qt5-declarative-5.6.0_1
-libQt5QuickShapes.so.5 qt5-declarative-5.12.1_1
-libQt5QuickControls2.so.5 qt5-quickcontrols2-5.7.1_1
-libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.7.1_1
-libQt5Positioning.so.5 qt5-location-5.6.0_1
-libQt5Location.so.5 qt5-location-5.6.0_1
-libQt5PositioningQuick.so.5 qt5-location-5.12.1_1
-libQt5VirtualKeyboard.so.5 qt5-virtualkeyboard-5.12.1_1
-libQt5Multimedia.so.5 qt5-multimedia-5.6.0_1
-libQt5MultimediaGstTools.so.5 qt5-multimedia-5.10.1_1
-libQt5MultimediaQuick.so.5 qt5-multimedia-5.10.1_1
-libQt5MultimediaQuick_p.so.5 qt5-multimedia-5.6.0_1
-libQt5MultimediaWidgets.so.5 qt5-multimedia-5.6.0_1
-libQt5NetworkAuth.so.5 qt5-networkauth-5.10.1_1
-libQt5Purchasing.so.5 qt5-purchasing-5.10.1_1
-libQt5RemoteObjects.so.5 qt5-remoteobjects-5.10.1_1
-libqgsttools_p.so.1 qt5-multimedia-5.6.0_1
-libQt5LabsTemplates.so.5 qt5-quickcontrols2-5.6.0_1
-libQt5Scxml.so.5 qt5-scxml-5.7.1_1
-libQt5Script.so.5 qt5-script-5.6.0_1
-libQt5ScriptTools.so.5 qt5-script-5.6.0_1
-libQt5Sensors.so.5 qt5-sensors-5.6.0_1
-libQt5SerialBus.so.5 qt5-serialbus-5.6.0_1
-libQt5SerialPort.so.5 qt5-serialport-5.6.0_1
-libQt5Svg.so.5 qt5-svg-5.6.0_1
-libQt5CLucene.so.5 qt5-tools-5.6.0_1
-libQt5Help.so.5 qt5-tools-5.6.0_1
-libQt5Designer.so.5 qt5-tools-5.6.0_1
-libQt5DesignerComponents.so.5 qt5-tools-5.6.0_1
-libQt5WaylandClient.so.5 qt5-wayland-5.6.0_1
-libQt5WaylandCompositor.so.5 qt5-wayland-5.6.0_1
-libQt5WebChannel.so.5 qt5-webchannel-5.6.0_1
-libQt5WebEngineCore.so.5 qt5-webengine-5.6.0_1
-libQt5WebEngine.so.5 qt5-webengine-5.6.0_1
-libQt5WebEngineWidgets.so.5 qt5-webengine-5.6.0_1
-libQt5WebSockets.so.5 qt5-websockets-5.6.0_1
-libQt5X11Extras.so.5 qt5-x11extras-5.6.0_1
-libQt5XmlPatterns.so.5 qt5-xmlpatterns-5.6.0_1
-libQt5Core.so.5 qt5-5.6.0_1
-libQt5EglFSDeviceIntegration.so.5 qt5-5.8.0_1
-libQt5Network.so.5 qt5-5.6.0_1
-libQt5Sql.so.5 qt5-5.6.0_1
-libQt5Xml.so.5 qt5-5.6.0_1
-libQt5Gui.so.5 qt5-5.6.0_1
-libQt5Widgets.so.5 qt5-5.6.0_1
-libQt5Test.so.5 qt5-5.6.0_1
-libQt5DBus.so.5 qt5-5.6.0_1
-libQt5Concurrent.so.5 qt5-5.6.0_1
-libQt5OpenGL.so.5 qt5-5.6.0_1
-libQt5PrintSupport.so.5 qt5-5.6.0_1
-libQt5XcbQpa.so.5 qt5-5.6.0_1
-libQt5EglDeviceIntegration.so.5 qt5-5.6.0_1
-libQt5EglFsKmsSupport.so.5 qt5-5.7.1_1
+libQt5Bluetooth.so.5 qt5-connectivity-5.14.1_1
+libQt53DAnimation.so.5 qt5-3d-5.14.1_1
+libQt53DCore.so.5 qt5-3d-5.14.1_1
+libQt53DInput.so.5 qt5-3d-5.14.1_1
+libQt53DLogic.so.5 qt5-3d-5.14.1_1
+libQt53DRender.so.5 qt5-3d-5.14.1_1
+libQt53DQuick.so.5 qt5-3d-5.14.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.14.1_1
+libQt53DQuickRender.so.5 qt5-3d-5.14.1_1
+libQt53DQuickScene2D.so.5 qt5-3d-5.14.1_1
+libQt53DExtras.so.5 qt5-3d-5.14.1_1
+libQt53DQuickExtras.so.5 qt5-3d-5.14.1_1
+libQt53DQuickAnimation.so.5 qt5-3d-5.14.1_1
+libQt53DQuickInput.so.5 qt5-3d-5.14.1_1
+libQt5Charts.so.5 qt5-charts-5.14.1_1
+libQt5DataVisualization.so.5 qt5-datavis3d-5.14.1_1
+libQt5Gamepad.so.5 qt5-gamepad-5.14.1_1
+libQt5Nfc.so.5 qt5-connectivity-5.14.1_1
+libQt5WebView.so.5 qt5-webview-5.14.1_1
+libQt5Qml.so.5 qt5-declarative-5.14.1_1
+libQt5QmlDevTools.so.5 qt5-declarative-5.14.1_1
+libQt5Quick.so.5 qt5-declarative-5.14.1_1
+libQt5QuickTest.so.5 qt5-declarative-5.14.1_1
+libQt5QuickWidgets.so.5 qt5-declarative-5.14.1_1
+libQt5QuickParticles.so.5 qt5-declarative-5.14.1_1
+libQt5QuickShapes.so.5 qt5-declarative-5.14.1_1
+libQt5QmlModels.so.5 qt5-declarative-5.14.1_1
+libQt5QmlWorkerScript.so.5 qt5-declarative-5.14.1_1
+libQt5QuickControls2.so.5 qt5-quickcontrols2-5.14.1_1
+libQt5QuickTemplates2.so.5 qt5-quickcontrols2-5.14.1_1
+libQt5Positioning.so.5 qt5-location-5.14.1_1
+libQt5Location.so.5 qt5-location-5.14.1_1
+libQt5PositioningQuick.so.5 qt5-location-5.14.1_1
+libQt5VirtualKeyboard.so.5 qt5-virtualkeyboard-5.14.1_1
+libQt5Multimedia.so.5 qt5-multimedia-5.14.1_1
+libQt5MultimediaGstTools.so.5 qt5-multimedia-5.14.1_1
+libQt5MultimediaQuick.so.5 qt5-multimedia-5.14.1_1
+libQt5MultimediaQuick_p.so.5 qt5-multimedia-5.14.1_1
+libQt5MultimediaWidgets.so.5 qt5-multimedia-5.14.1_1
+libQt5NetworkAuth.so.5 qt5-networkauth-5.14.1_1
+libQt5Purchasing.so.5 qt5-purchasing-5.14.1_1
+libQt5RemoteObjects.so.5 qt5-remoteobjects-5.14.1_1
+libqgsttools_p.so.1 qt5-multimedia-5.14.1_1
+libQt5LabsTemplates.so.5 qt5-quickcontrols2-5.14.1_1
+libQt5Scxml.so.5 qt5-scxml-5.14.1_1
+libQt5Script.so.5 qt5-script-5.14.1_1
+libQt5ScriptTools.so.5 qt5-script-5.14.1_1
+libQt5Sensors.so.5 qt5-sensors-5.14.1_1
+libQt5SerialBus.so.5 qt5-serialbus-5.14.1_1
+libQt5SerialPort.so.5 qt5-serialport-5.14.1_1
+libQt5Svg.so.5 qt5-svg-5.14.1_1
+libQt5CLucene.so.5 qt5-tools-5.14.1_1
+libQt5Help.so.5 qt5-tools-5.14.1_1
+libQt5Designer.so.5 qt5-tools-5.14.1_1
+libQt5DesignerComponents.so.5 qt5-tools-5.14.1_1
+libQt5WaylandClient.so.5 qt5-wayland-5.14.1_1
+libQt5WaylandCompositor.so.5 qt5-wayland-5.14.1_1
+libQt5WebChannel.so.5 qt5-webchannel-5.14.1_1
+libQt5WebEngineCore.so.5 qt5-webengine-5.14.1_1
+libQt5WebEngine.so.5 qt5-webengine-5.14.1_1
+libQt5WebEngineWidgets.so.5 qt5-webengine-5.14.1_1
+libQt5WebSockets.so.5 qt5-websockets-5.14.1_1
+libQt5X11Extras.so.5 qt5-x11extras-5.14.1_1
+libQt5XmlPatterns.so.5 qt5-xmlpatterns-5.14.1_1
+libQt5Core.so.5 qt5-core-5.14.1_1
+libQt5EglFSDeviceIntegration.so.5 qt5-gui-5.14.1_1
+libQt5Network.so.5 qt5-network-5.14.1_1
+libQt5Sql.so.5 qt5-sql-5.14.1_1
+libQt5Xml.so.5 qt5-xml-5.14.1_1
+libQt5Gui.so.5 qt5-gui-5.14.1_1
+libQt5Widgets.so.5 qt5-widgets-5.14.1_1
+libQt5Test.so.5 qt5-test-5.14.1_1
+libQt5DBus.so.5 qt5-dbus-5.14.1_1
+libQt5Concurrent.so.5 qt5-concurrent-5.14.1_1
+libQt5OpenGL.so.5 qt5-opengl-5.14.1_1
+libQt5PrintSupport.so.5 qt5-printsupport-5.14.1_1
+libQt5XcbQpa.so.5 qt5-gui-5.14.1_1
+libQt5EglDeviceIntegration.so.5 qt5-gui-5.14.1_1
+libQt5EglFsKmsSupport.so.5 qt5-gui-5.14.1_1
+libQt5TextToSpeech.so.5 qt5-speech-5.14.1_1
+libQt5Bodymovin.so.5 qt5-lottie-5.14.1_1
 libQt5WebKit.so.5 qt5-webkit-5.6.0_1
 libQt5WebKitWidgets.so.5 qt5-webkit-5.6.0_1
-libQt5TextToSpeech.so.5 qt5-speech-5.8.0_1
-libQt5Bodymovin.so.5 qt5-lottie-5.13.0_1
 libx265.so.188 x265-3.3_1
 libQt5Xdg.so.3 libqtxdg-3.1.0_1
 libQt5XdgIconLoader.so.3 libqtxdg-3.1.0_1
diff --git a/srcpkgs/qt5-webengine b/srcpkgs/qt5-base-docs
similarity index 100%
rename from srcpkgs/qt5-webengine
rename to srcpkgs/qt5-base-docs
diff --git a/srcpkgs/qt5-concurrent b/srcpkgs/qt5-concurrent
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-concurrent
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-core b/srcpkgs/qt5-core
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-core
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-dbus b/srcpkgs/qt5-dbus
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-dbus
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-gui b/srcpkgs/qt5-gui
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-gui
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-network b/srcpkgs/qt5-network
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-network
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-opengl b/srcpkgs/qt5-opengl
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-opengl
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-printsupport b/srcpkgs/qt5-printsupport
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-printsupport
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-quicktimeline b/srcpkgs/qt5-quicktimeline
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-quicktimeline
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-sql b/srcpkgs/qt5-sql
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-sql
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-test b/srcpkgs/qt5-test
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-test
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-widgets b/srcpkgs/qt5-widgets
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-widgets
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xcb-private-headers b/srcpkgs/qt5-xcb-private-headers
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xcb-private-headers
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-xml b/srcpkgs/qt5-xml
new file mode 120000
index 00000000000..75793eb6664
--- /dev/null
+++ b/srcpkgs/qt5-xml
@@ -0,0 +1 @@
+qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch b/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
deleted file mode 100644
index 5ecdfb30f5b..00000000000
--- a/srcpkgs/qt5/files/0090-hard-disable-qmlchachegen.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtdeclarative/tools/tools.pro	2019-04-09 01:01:07.000000000 +0200
-+++ -	2019-04-21 00:24:16.192966345 +0200
-@@ -7,7 +7,6 @@
-         qmlmin \
-         qmlimportscanner
- 
--    qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
- }
- 
- qtConfig(thread):!android|android_app:!wasm {
diff --git a/srcpkgs/qt5/files/qmlcachegen.pro b/srcpkgs/qt5/files/qmlcachegen.pro
new file mode 100644
index 00000000000..b5963becd6c
--- /dev/null
+++ b/srcpkgs/qt5/files/qmlcachegen.pro
@@ -0,0 +1,38 @@
+QT = core qml qmldevtools-private
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+SOURCES = qmlcachegen.cpp \
+    resourcefilter.cpp \
+    generateloader.cpp
+TARGET = qmlcachegen
+
+include(../shared/shared.pri)
+
+build_integration.files = qmlcache.prf qtquickcompiler.prf
+build_integration.path = $$[QT_HOST_DATA]/mkspecs/features
+prefix_build: INSTALLS += build_integration
+else: COPIES += build_integration
+
+load(cmake_functions)
+
+CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+}
+
+load(qt_build_paths)
+
+equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
+cmake_config_file.input = $$PWD/Qt5QuickCompilerConfig.cmake.in
+cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cmake/Qt5QuickCompiler/Qt5QuickCompilerConfig.cmake
+QMAKE_SUBSTITUTES += cmake_config_file
+
+cmake_build_integration.files = $$cmake_config_file.output
+cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+prefix_build: INSTALLS += cmake_build_integration
+else: COPIES += cmake_build_integration
+
+QMAKE_TARGET_DESCRIPTION = QML Cache Generator
+
+load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmlimportscanner.pro b/srcpkgs/qt5/files/qmlimportscanner.pro
index 57c228b8540..ab1e851293a 100644
--- a/srcpkgs/qt5/files/qmlimportscanner.pro
+++ b/srcpkgs/qt5/files/qmlimportscanner.pro
@@ -3,6 +3,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
 
 SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
 
+include(../shared/shared.pri)
+
 QMAKE_TARGET_DESCRIPTION = QML Import Scanner
 
 load(qt_tool)
diff --git a/srcpkgs/qt5/files/qmllint.pro b/srcpkgs/qt5/files/qmllint.pro
index 409a378bfcb..8ca600c20ec 100644
--- a/srcpkgs/qt5/files/qmllint.pro
+++ b/srcpkgs/qt5/files/qmllint.pro
@@ -1,7 +1,22 @@
 QT = core qml qmldevtools-private
 
-SOURCES += main.cpp ../../src/qml/qqmljsgrammar.cpp
+SOURCES += main.cpp \
+    componentversion.cpp \
+    fakemetaobject.cpp \
+    findunqualified.cpp \
+    qmljstypedescriptionreader.cpp \
+    qcoloroutput.cpp \
+    scopetree.cpp \
+    ../../src/qml/qqmljsgrammar.cpp
 
 QMAKE_TARGET_DESCRIPTION = QML Syntax Verifier
 
 load(qt_tool)
+
+HEADERS += \
+    componentversion.h \
+    fakemetaobject.h \
+    findunqualified.h \
+    qmljstypedescriptionreader.h \
+    qcoloroutput_p.h \
+    scopetree.h
diff --git a/srcpkgs/qt5/files/qttools_src.pro b/srcpkgs/qt5/files/qttools_src.pro
index c7344404c05..a387a990167 100644
--- a/srcpkgs/qt5/files/qttools_src.pro
+++ b/srcpkgs/qt5/files/qttools_src.pro
@@ -1,5 +1,6 @@
 TEMPLATE = subdirs
 
+QT_FOR_CONFIG += widgets
 SUBDIRS = assistant \
 	pixeltool \
 	designer \
@@ -8,34 +9,31 @@ SUBDIRS = assistant \
 	qtattributionsscanner
 
 linguist.depends = designer
+qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
+
 
 qtConfig(library) {
     !android|android_app: SUBDIRS += qtplugininfo
 }
 
-if(!android|android_app):!uikit: SUBDIRS += qtpaths
+!android|android_app: SUBDIRS += qtpaths
 
-mac {
+macos {
     SUBDIRS += macdeployqt
 }
 
-android {
-    SUBDIRS += androiddeployqt
-}
-
 win32|winrt:SUBDIRS += windeployqt
 winrt:SUBDIRS += winrtrunner
-qtHaveModule(gui):!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
+qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
 
 qtNomakeTools( \
-    macdeployqt \
+    distancefieldgenerator \
+    pixeltool \
 )
 
 # This is necessary to avoid a race condition between toolchain.prf
 # invocations in a module-by-module cross-build.
 cross_compile:isEmpty(QMAKE_HOST_CXX.INCDIRS) {
-    androiddeployqt.depends += qtattributionsscanner
-    qdoc.depends += qtattributionsscanner
     windeployqt.depends += qtattributionsscanner
     winrtrunner.depends += qtattributionsscanner
     linguist.depends += qtattributionsscanner
diff --git a/srcpkgs/qt5/files/resolv_compat.h b/srcpkgs/qt5/files/resolv_compat.h
deleted file mode 100644
index 4f0e852a19d..00000000000
--- a/srcpkgs/qt5/files/resolv_compat.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#if !defined(__GLIBC__)
-/***************************************************************************
- * resolv_compat.h
- *
- * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
- * Note: res_init() is actually deprecated according to
- * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
- **************************************************************************/
-#include <string.h>
-
-static inline int res_ninit(res_state statp)
-{
-	int rc = res_init();
-	if (statp != &_res) {
-		memcpy(statp, &_res, sizeof(*statp));
-	}
-	return rc;
-}
-
-static inline int res_nclose(res_state statp)
-{
-	if (!statp)
-		return -1;
-	if (statp != &_res) {
-		memset(statp, 0, sizeof(*statp));
-	}
-	return 0;
-}
-#endif
diff --git a/srcpkgs/qt5/files/uic.pro b/srcpkgs/qt5/files/uic.pro
index 74d7dbd878f..dc08efcff19 100644
--- a/srcpkgs/qt5/files/uic.pro
+++ b/srcpkgs/qt5/files/uic.pro
@@ -4,6 +4,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
 include(uic.pri)
 include(shared/shared.pri)
 include(cpp/cpp.pri)
+include(python/python.pri)
 
 HEADERS += uic.h
 
diff --git a/srcpkgs/qt5/files/uitools.pro b/srcpkgs/qt5/files/uitools.pro
new file mode 100644
index 00000000000..51e22b14506
--- /dev/null
+++ b/srcpkgs/qt5/files/uitools.pro
@@ -0,0 +1,15 @@
+TARGET = QtUiTools
+CONFIG += static
+
+include(../lib/uilib/uilib.pri)
+
+QMAKE_DOCS = $$PWD/doc/qtuitools.qdocconf
+
+HEADERS += quiloader.h
+SOURCES += quiloader.cpp
+
+DEFINES += \
+    QFORMINTERNAL_NAMESPACE \
+    QT_DESIGNER_STATIC
+
+load(qt_module)
diff --git a/srcpkgs/qt5/patches/0001-addlr.patch b/srcpkgs/qt5/patches/0001-addlr.patch
new file mode 100644
index 00000000000..e415332dd89
--- /dev/null
+++ b/srcpkgs/qt5/patches/0001-addlr.patch
@@ -0,0 +1,23 @@
+Source: @Johnnynator
+Upsteam: No
+Subject: Musl always returns /lib/libQt5Core.so.5 for Dl_info.dli_fname. 
+On GLIBC this seems to only happen with programs that load qt5-webengine(?)
+
+---
+diff --git qtbasesrc/corelib/global/qlibraryinfo.cpp qtbasesrc/corelib/global/qlibraryinfo.cpp
+index 8bcf67e73d..28d7355310 100644
+--- qtbase/src/corelib/global/qlibraryinfo.cpp
++++ qtbase/src/corelib/global/qlibraryinfo.cpp
+@@ -558,6 +558,12 @@ static QString getRelocatablePrefix()
+     int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info);
+     if (result > 0 && info.dli_fname)
+         prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLatin1(info.dli_fname));
++#if 1
++    QDir preDir(prefixPath);
++    if (preDir.isRoot()) {
++        prefixPath = QStringLiteral("/usr");
++    }
++#endif
+ #elif defined(Q_OS_WIN)
+     HMODULE hModule = getWindowsModuleHandle();
+     const int kBufferSize = 4096;
diff --git a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
deleted file mode 100644
index 3e787d1374e..00000000000
--- a/srcpkgs/qt5/patches/0002-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
-@@ -50,7 +50,7 @@
-   //   info: the collection of register structures.
- #if defined(__i386__) || defined(__x86_64)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                             const struct _libc_fpstate* fp);
-+                             const struct _fpstate* fp);
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
-@@ -49,7 +49,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fp) {
-+                                    const struct _fpstate* fp) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@
- }
- 
- void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
--                                    const struct _libc_fpstate* fpregs) {
-+                                    const struct _fpstate* fpregs) {
-   const greg_t* regs = uc->uc_mcontext.gregs;
- 
-   out->context_flags = MD_CONTEXT_AMD64_FULL;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
-@@ -48,7 +48,7 @@
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
--typedef struct _libc_fpstate fpstate_t;
-+typedef struct _fpstate fpstate_t;
- #endif
- 
- // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
deleted file mode 100644
index da4160b21bd..00000000000
--- a/srcpkgs/qt5/patches/0003-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
-From: Felix Janda <felix.janda@posteo.de>
-Date: Sun, 1 Feb 2015 14:26:52 +0100
-Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
-
----
- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
-index d03c7a8..02eb391 100644
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
-@@ -36,6 +36,9 @@
- #include <elf.h>
- #include <link.h>
- #include <stddef.h>
-+#ifndef __GLIBC__
-+#include <sys/reg.h>
-+#endif
- 
- #include "common/memory_range.h"
- 
--- 
-2.0.5
-
diff --git a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch b/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
deleted file mode 100644
index de32a3dab95..00000000000
--- a/srcpkgs/qt5/patches/0004-musl-dispatch-to-musl.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
---- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
-@@ -6,6 +6,7 @@
- 
- #include <malloc.h>
- 
-+#if defined(__GLIBC__)
- // This translation unit defines a default dispatch for the allocator shim which
- // routes allocations to libc functions.
- // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
-@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-     nullptr,               /* free_definite_size_function */
-     nullptr,               /* next */
- };
-+
-+#else // defined(__GLIBC__)
-+
-+#include <dlfcn.h>
-+
-+extern "C" {
-+// Declare function pointers to the memory functions
-+typedef void* (*t_libc_malloc)(size_t size);
-+typedef void* (*t_libc_calloc)(size_t n, size_t size);
-+typedef void* (*t_libc_realloc)(void* address, size_t size);
-+typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
-+typedef void (*t_libc_free)(void* ptr);
-+typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
-+
-+// Static instances of pointers to libc.so dl symbols
-+static t_libc_malloc libc_malloc = NULL;
-+static t_libc_calloc libc_calloc = NULL;
-+static t_libc_realloc libc_realloc = NULL;
-+static t_libc_memalign libc_memalign = NULL;
-+static t_libc_free libc_free = NULL;
-+static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
-+
-+// resolve the symbols in libc.so
-+void musl_libc_memory_init(void)
-+{
-+  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
-+  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
-+  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
-+  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
-+  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
-+  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
-+}
-+}  // extern "C"
-+
-+namespace {
-+
-+using base::allocator::AllocatorDispatch;
-+
-+void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
-+  if (!libc_malloc)
-+    musl_libc_memory_init();
-+  return (*libc_malloc)(size);
-+}
-+
-+void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
-+  if (!libc_calloc)
-+    musl_libc_memory_init();
-+  return (*libc_calloc)(n, size);
-+}
-+
-+void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
-+  if (!libc_realloc)
-+    musl_libc_memory_init();
-+  return (*libc_realloc)(address, size);
-+}
-+
-+void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
-+  if (!libc_memalign)
-+    musl_libc_memory_init();
-+  return (*libc_memalign)(alignment, size);
-+}
-+
-+void MuslFree(const AllocatorDispatch*, void* address, void* context) {
-+  if (!libc_free)
-+    musl_libc_memory_init();
-+  (*libc_free)(address);
-+}
-+
-+size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
-+  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
-+  //     presence of interposing shims that divert allocations.
-+  if (!libc_malloc_usable_size)
-+    musl_libc_memory_init();
-+  return (*libc_malloc_usable_size)(address);
-+}
-+
-+}  // namespace
-+
-+const AllocatorDispatch AllocatorDispatch::default_dispatch = {
-+    &MuslMalloc,           /* alloc_function */
-+    &MuslCalloc,           /* alloc_zero_initialized_function */
-+    &MuslMemalign,         /* alloc_aligned_function */
-+    &MuslRealloc,          /* realloc_function */
-+    &MuslFree,             /* free_function */
-+    &MuslGetSizeEstimate,  /* get_size_estimate_function */
-+    nullptr,               /* next */
-+};
-+
-+#endif
diff --git a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch b/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
deleted file mode 100644
index c332b92b69d..00000000000
--- a/srcpkgs/qt5/patches/0008-musl-no-mallinfo.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
-@@ -243,7 +243,7 @@
-   allocated_objects_count = main_heap_info.block_count;
- #elif defined(OS_FUCHSIA)
- // TODO(fuchsia): Port, see https://crbug.com/706592.
--#else
-+#elif defined(__GLIBC__)
-   struct mallinfo info = mallinfo();
-   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- 
-@@ -255,6 +255,8 @@
- 
-   // Total allocated space is given by |uordblks|.
-   allocated_objects_size = info.uordblks;
-+#else
-+// musl libc does not support mallinfo()
- #endif
- 
-   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
---- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
-@@ -100,14 +100,14 @@
-   malloc_statistics_t stats = {0};
-   malloc_zone_statistics(nullptr, &stats);
-   return stats.size_in_use;
--#elif defined(OS_LINUX) || defined(OS_ANDROID)
-+#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
-   struct mallinfo minfo = mallinfo();
- #if defined(USE_TCMALLOC)
-   return minfo.uordblks;
- #else
-   return minfo.hblkhd + minfo.arena;
- #endif
--#elif defined(OS_FUCHSIA)
-+#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
-   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
-   return 0;
- #endif
-
diff --git a/srcpkgs/qt5/patches/0009-musl-off_t.patch b/srcpkgs/qt5/patches/0009-musl-off_t.patch
deleted file mode 100644
index 52db3b9ebf4..00000000000
--- a/srcpkgs/qt5/patches/0009-musl-off_t.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
-@@ -21,6 +21,7 @@
- #define htons(x) _byteswap_ushort (x)
- #else
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #include <stdint.h>
- #endif
- 
diff --git a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch b/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
deleted file mode 100644
index 00017bba017..00000000000
--- a/srcpkgs/qt5/patches/0010-musl-pread-pwrite.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
-@@ -1794,6 +1794,15 @@
- /* End of s390/s390x definitions                                             */
- #endif
- 
-+#ifndef __GLIBC__
-+  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
-+#ifndef __NR_pread
-+#define __NR_pread              __NR_pread64
-+#endif
-+#ifndef __NR_pwrite
-+#define __NR_pwrite             __NR_pwrite64
-+#endif
-+#endif /* ifndef __GLIBC__ */
- 
- /* After forking, we must make sure to only call system calls.               */
- #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch b/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
deleted file mode 100644
index d5caf3836d7..00000000000
--- a/srcpkgs/qt5/patches/0011-musl-replace-pvalloc.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
-+++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
-@@ -111,7 +111,11 @@
- }
- 
- SHIM_HIDDEN void* ShimPvalloc(size_t size) {
-+#if defined(__GLIBC__)
-     return pvalloc(size);
-+#else
-+    return valloc((size+4095)&~4095);
-+#endif
- }
- 
- SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5/patches/0012-musl-resolve.patch b/srcpkgs/qt5/patches/0012-musl-resolve.patch
deleted file mode 100644
index edfceb79f30..00000000000
--- a/srcpkgs/qt5/patches/0012-musl-resolve.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
-@@ -9,6 +9,10 @@
- 
- #include <resolv.h>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/lazy_instance.h"
- #include "base/logging.h"
- #include "base/macros.h"
---- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
-@@ -6,6 +6,10 @@
- 
- #include <string>
- 
-+#if !defined(__GLIBC__)
-+#include "resolv_compat.h"
-+#endif
-+
- #include "base/bind.h"
- #include "base/files/file.h"
- #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch b/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
deleted file mode 100644
index fe760be1666..00000000000
--- a/srcpkgs/qt5/patches/0015-musl-siginfo_t.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-There's a subtle difference in the internal name of siginfo_t fields
-between glibc and musl. The structure itself is equivalent, so it
-should suffice to add a macro to rename the field.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
-@@ -22,6 +22,11 @@
- #include "sandbox/linux/services/android_ucontext.h"
- #endif
-
-+// musl libc defines siginfo_t __si_fields instead of _sifields
-+#if !defined(__GLIBC__)
-+#define _sifields __si_fields
-+#endif
-+
- namespace {
-
- const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5/patches/0017-musl-stackstart.patch b/srcpkgs/qt5/patches/0017-musl-stackstart.patch
deleted file mode 100644
index 57136bc2bcd..00000000000
--- a/srcpkgs/qt5/patches/0017-musl-stackstart.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
-@@ -28,7 +28,7 @@
- // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
- // correctly for the main thread.
- 
--#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
-+#if 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 webkit_unit_tests).
-@@ -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;
diff --git a/srcpkgs/qt5/patches/0020-musl-sandbox.patch b/srcpkgs/qt5/patches/0020-musl-sandbox.patch
deleted file mode 100644
index d3de1e41183..00000000000
--- a/srcpkgs/qt5/patches/0020-musl-sandbox.patch
+++ /dev/null
@@ -1,71 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
-@@ -129,7 +129,7 @@
- // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
- ResultExpr RestrictCloneToThreadsAndEPERMFork() {
-   const Arg<unsigned long> flags(0);
--
-+#if defined(__GLIBC__)
-   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
-   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
-                                      CLONE_SIGHAND | CLONE_THREAD |
-@@ -148,6 +148,17 @@
-   return If(IsAndroid() ? android_test : glibc_test, Allow())
-       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-       .Else(CrashSIGSYSClone());
-+#else
-+  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
-+                       CLONE_THREAD | CLONE_SYSVSEM;
-+  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
-+                   CLONE_DETACHED;
-+  const BoolExpr thread_clone_ok = (flags&~safe)==required;
-+
-+  return If(thread_clone_ok, Allow())
-+      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
-+      .Else(CrashSIGSYSClone());
-+#endif
- }
- 
- ResultExpr RestrictPrctl() {
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
-@@ -375,6 +375,9 @@
- #if defined(__i386__)
-     case __NR_waitpid:
- #endif
-+#if !defined(__GLIBC__)
-+    case __NR_set_tid_address:
-+#endif
-       return true;
-     case __NR_clone:  // Should be parameter-restricted.
-     case __NR_setns:  // Privileged.
-@@ -387,7 +390,9 @@
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-     case __NR_set_thread_area:
- #endif
-+#if defined(__GLIBC__)
-     case __NR_set_tid_address:
-+#endif
-     case __NR_unshare:
- #if !defined(__mips__) && !defined(__aarch64__)
-     case __NR_vfork:
-@@ -496,6 +501,9 @@
-     case __NR_mlock:
-     case __NR_munlock:
-     case __NR_munmap:
-+#if !defined(__GLIBC__)
-+    case __NR_mremap:
-+#endif
-       return true;
-     case __NR_madvise:
-     case __NR_mincore:
-@@ -511,7 +519,9 @@
-     case __NR_modify_ldt:
- #endif
-     case __NR_mprotect:
-+#if defined(__GLIBC__)
-     case __NR_mremap:
-+#endif
-     case __NR_msync:
-     case __NR_munlockall:
-     case __NR_readahead:
diff --git a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch b/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
deleted file mode 100644
index 9eac4e70efa..00000000000
--- a/srcpkgs/qt5/patches/0023-enable_tools-cross.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- qttools/src/src.pro	2018-06-09 13:10:38.000000000 +0200
-+++ qttools/src/src.pro	2018-08-19 09:34:29.803670205 +0200
-@@ -1,20 +1,14 @@
- TEMPLATE = subdirs
- 
--qtHaveModule(widgets) {
--    no-png {
--        message("Some graphics-related tools are unavailable without PNG support")
--    } else {
--        QT_FOR_CONFIG += widgets
--        qtConfig(pushbutton):qtConfig(toolbutton) {
--            SUBDIRS = assistant \
--                      designer \
--                      pixeltool
--
--            linguist.depends = designer
--        }
--        qtHaveModule(quick):qtConfig(thread):qtConfig(toolbutton): SUBDIRS += distancefieldgenerator
--    }
--}
-+QT_FOR_CONFIG += widgets
-+
-+SUBDIRS = assistant \
-+          designer \
-+          pixeltool
-+
-+linguist.depends = designer
-+
-+SUBDIRS += distancefieldgenerator
- 
- SUBDIRS += linguist \
-     qtattributionsscanner
-@@ -31,11 +25,11 @@ macos {
-     SUBDIRS += macdeployqt
- }
- 
--qtHaveModule(dbus): SUBDIRS += qdbus
-+SUBDIRS += qdbus
- 
- win32|winrt:SUBDIRS += windeployqt
- winrt:SUBDIRS += winrtrunner
--qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag
-+SUBDIRS += qtdiag
- 
- qtNomakeTools( \
-     distancefieldgenerator \
diff --git a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch b/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
deleted file mode 100644
index 7bf5a22fba7..00000000000
--- a/srcpkgs/qt5/patches/0025-musl-chromium-default-stacksize.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
-+++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
-@@ -173,7 +173,12 @@
- 
- size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
- #if !defined(THREAD_SANITIZER)
-+#if defined(__GLIBC__)
-   return 0;
-+#else // defined(__GLIBC__)
-+  // For Musl libc try with a default stack size of 2 MiB
-+  return 2 * 1024 * 1024;
-+#endif // !defined(__GLIBC__)
- #else
-   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
-   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5/patches/0026-data_pack-be.patch b/srcpkgs/qt5/patches/0026-data_pack-be.patch
deleted file mode 100644
index c113ddb6566..00000000000
--- a/srcpkgs/qt5/patches/0026-data_pack-be.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig	2018-09-11 14:16:53.104897379 +0200
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc	2018-09-11 14:17:12.009896253 +0200
-@@ -383,12 +383,6 @@
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
diff --git a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch b/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
deleted file mode 100644
index fd0ab849c01..00000000000
--- a/srcpkgs/qt5/patches/0027-remove-glibc-check.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtwebengine/config.tests/glibc/glibc.cpp
-+++ qtwebengine/config.tests/glibc/glibc.cpp
-@@ -28,10 +28,6 @@
- 
- #include <features.h>
- 
--#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17
--#error glibc versions below 2.17 are not supported
--#endif
--
- int main(int , char **) {
-   return 0;
- }
diff --git a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
deleted file mode 100644
index 140742f72c2..00000000000
--- a/srcpkgs/qt5/patches/0032-musl-cross-no-asm_ptrace_h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
-@@ -38,7 +38,12 @@
- 
- #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <errno.h>
- #include <fcntl.h>
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
-@@ -32,7 +32,12 @@
- 
- #include "client/linux/minidump_writer/linux_core_dumper.h"
- 
-+#if defined(__GLIBC__)
- #include <asm/ptrace.h>
-+#else
-+/* For arm*-musl this definition is missing */
-+#define ARM_sp uregs[13]
-+#endif
- #include <assert.h>
- #include <elf.h>
- #include <stdio.h>
diff --git a/srcpkgs/qt5/patches/0040-yasm-nls.patch b/srcpkgs/qt5/patches/0040-yasm-nls.patch
deleted file mode 100644
index 22ac0420764..00000000000
--- a/srcpkgs/qt5/patches/0040-yasm-nls.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
-index 9e36539..f588083 100644
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
---- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
-@@ -5,7 +5,7 @@
- #define CPP_PROG "gcc -E"
- 
- /* */
--#define ENABLE_NLS 1
-+/* #undef ENABLE_NLS 1 */
- 
- /* Define to 1 if you have the `abort' function. */
- #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch b/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
deleted file mode 100644
index b13290d3ccd..00000000000
--- a/srcpkgs/qt5/patches/0042-arm-void-is-not-android.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//third_party/openmax_dl/dl/BUILD.gn	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:08:09.537346546 +0200
-@@ -206,18 +206,6 @@
-       "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
-       "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
-     ]
--    if (arm_optionally_use_neon) {
--      # Run-time NEON detection.
--      deps = [
--        "//third_party/android_tools:cpu_features",
--      ]
--
--      # To get the __android_log_print routine
--      libs = [ "log" ]
--
--      # Detection routine
--      sources += [ "sp/src/arm/detect.c" ]
--    }
-   }
- 
-   # NEON implementation of FFT. This library is NOT
diff --git a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch b/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
deleted file mode 100644
index 98f3a38745a..00000000000
--- a/srcpkgs/qt5/patches/0044-qt-musl-execinfo.patch
+++ /dev/null
@@ -1,107 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
-+++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
-@@ -27,7 +27,7 @@
- #if !defined(USE_SYMBOLIZE)
- #include <cxxabi.h>
- #endif
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- #include <execinfo.h>
- #endif
- 
-@@ -86,7 +86,7 @@
-   // Note: code in this function is NOT async-signal safe (std::string uses
-   // malloc internally).
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   std::string::size_type search_from = 0;
-   while (search_from < text->size()) {
-     // Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
-       search_from = mangled_start + 2;
-     }
-   }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- }
- #endif  // !defined(USE_SYMBOLIZE)
- 
-@@ -133,7 +133,7 @@
-   virtual ~BacktraceOutputHandler() = default;
- };
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
-   // This should be more than enough to store a 64-bit number in hex:
-   // 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
-   }
- #endif  // defined(USE_SYMBOLIZE)
- }
--#endif  // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif  // !defined(__GLIBC__) && !defined(_AIX)
- 
- void PrintToStderr(const char* output) {
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
-   // NOTE: This code MUST be async-signal safe (it's used by in-process
-   // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   // Though the backtrace API man page does not list any possible negative
-   // return values, we take no chance.
-   return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
- // NOTE: This code MUST be async-signal safe (it's used by in-process
- // stack dumping signal handler). NO malloc or stdio is allowed here.
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   PrintBacktraceOutputHandler handler;
-   ProcessBacktrace(trace_, count_, prefix_string, &handler);
- #endif
- }
- 
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
- void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
-                                           const char* prefix_string) const {
-   StreamBacktraceOutputHandler handler(os);
---- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:18:14.923566992 +0200
-@@ -233,7 +233,7 @@
- }
- std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
-   std::stringstream stream;
--#if !defined(__UCLIBC__) && !defined(_AIX)
-+#if defined(__GLIBC__) && !defined(_AIX)
-   OutputToStreamWithPrefix(&stream, prefix_string);
- #endif
-   return stream.str();
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
---- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
-@@ -546,7 +546,7 @@
- 
- LogMessage::~LogMessage() {
-   size_t stack_start = stream_.tellp();
--#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
-+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
-     !defined(OS_AIX)
-   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
-     // Include a stack trace on a fatal, unless a debugger is attached.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/assertions.cc	2019-04-09 09:31:16.000000000 +0200
-+++ -	2019-05-06 23:12:07.040977258 +0200
-@@ -51,8 +51,10 @@
- #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
-+#if defined(__GLIBC__)
- #include <execinfo.h>
- #endif
-+#endif
- 
- #if defined(OS_ANDROID)
- #include <android/log.h>
diff --git a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch b/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
deleted file mode 100644
index 496753bef30..00000000000
--- a/srcpkgs/qt5/patches/0045-qt-musl-thread-stacksize.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-index 02bf49b..05ee182 100644
---- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-+++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
-@@ -13,7 +13,7 @@ namespace pp {
- namespace {
- 
- // Use 2MB default stack size for Native Client, otherwise use system default.
--#if defined(__native_client__)
-+#if defined(__native_client__) || !defined(__GLIBC__)
- const size_t kDefaultStackSize = 2 * 1024 * 1024;
- #else
- const size_t kDefaultStackSize = 0;
-diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-index cf7f3ec..e06a5ce 100644
---- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-+++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
-@@ -761,7 +761,7 @@ void Thread::Start() {
- #if V8_OS_MACOSX
-     // Default on Mac OS X is 512kB -- bump up to 1MB
-     stack_size = 1 * 1024 * 1024;
--#elif V8_OS_AIX
-+#elif V8_OS_AIX || !defined(__GLIBC__)
-     // Default on AIX is 96kB -- bump up to 2MB
-     stack_size = 2 * 1024 * 1024;
- #endif
diff --git a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch b/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
deleted file mode 100644
index b73971f2432..00000000000
--- a/srcpkgs/qt5/patches/0046-sandbox-membarrier.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
-@@ -1063,4 +1063,8 @@
- #define __NR_memfd_create 279
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 283
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
-@@ -1385,6 +1385,10 @@
- #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
-+#endif
-+
- // ARM private syscalls.
- #if !defined(__ARM_NR_BASE)
- #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
-@@ -1290,5 +1290,9 @@
- #define __NR_memfd_create 319
- #endif
- 
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 324
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -370,6 +370,7 @@
-   switch (sysno) {
-     case __NR_exit:
-     case __NR_exit_group:
-+    case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
- #if defined(__i386__)
diff --git a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch b/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
deleted file mode 100644
index ee6689a4183..00000000000
--- a/srcpkgs/qt5/patches/0047-gn-cross-sysroot.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-There is no reason to run this script and running it fails on architectures
-chromium does not officially support (such as ppc64).
-
---- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
-@@ -102,12 +102,12 @@ config("runtime_library") {
-       # when turning the sysroot on or off. (defines are passed via the command
-       # line, and build system rebuilds things when their commandline
-       # changes). Nothing should ever read this define.
--      sysroot_hash =
--          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
--                      [ "--print-hash=$current_cpu" ],
--                      "trim string",
--                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
--      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-+      #sysroot_hash =
-+      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
-+      #                [ "--print-hash=$current_cpu" ],
-+      #                "trim string",
-+      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
-+      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
-     }
-     asmflags += sysroot_flags
- 
diff --git a/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
new file mode 100644
index 00000000000..86ebb555013
--- /dev/null
+++ b/srcpkgs/qt5/patches/0050-qmake-mkspecs.patch
@@ -0,0 +1,30 @@
+diff --git qtbase/mkspecs/features/qt_build_config.prf qtbase/mkspecs/features/qt_build_config.prf
+index 8273ba3fe1..b674f42109 100644
+--- qtbase/mkspecs/features/qt_build_config.prf
++++ qtbase/mkspecs/features/qt_build_config.prf
+@@ -11,6 +11,10 @@
+ 
+ !contains(QMAKE_INTERNAL_INCLUDED_FILES, .*qmodule\\.pri) {
+     QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
++    defined(QMAKE_TARGET_MODULE,var):exists($$QMAKE_TARGET_MODULE) {
++        QMAKE_QT_MODULE = $$QMAKE_TARGET_MODULE
++        message("Trying .qmodule.pri from ($$QMAKE_QT_CONFIG)")
++    }
+     !exists($$QMAKE_QT_MODULE)|!include($$QMAKE_QT_MODULE, "", true) {
+         debug(1, "Cannot load qmodule.pri!")
+     } else {
+diff --git qtbase/mkspecs/features/qt_config.prf qtbase/mkspecs/features/qt_config.prf
+index 93c54e3010..aaff26b52a 100644
+--- qtbase/mkspecs/features/qt_config.prf
++++ qtbase/mkspecs/features/qt_config.prf
+@@ -1,6 +1,10 @@
+ # This file is loaded as one of the last things by all qmakespecs.
+ 
+ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
++defined(QMAKE_TARGET_CONFIG,var):exists($$QMAKE_TARGET_CONFIG) {
++   QMAKE_QT_CONFIG = $$QMAKE_TARGET_CONFIG
++   message("Trying .qconfig.pri from ($$QMAKE_QT_CONFIG)")
++}
+ !exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
+    debug(1, "Cannot load qconfig.pri!")
+ } else {
diff --git a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch b/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
deleted file mode 100644
index 402d7e2d622..00000000000
--- a/srcpkgs/qt5/patches/0089-webengine-ppc64.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- qtwebengine/mkspecs/features/functions.prf
-+++ qtwebengine/mkspecs/features/functions.prf
-@@ -95,6 +95,7 @@
-     contains(qtArch, "arm64"): return(arm64)
-     contains(qtArch, "mips"): return(mipsel)
-     contains(qtArch, "mips64"): return(mips64el)
-+    contains(qtArch, "power64"): return(ppc64)
-     return(unknown)
- }
- 
---- qtwebengine/mkspecs/features/platform.prf
-+++ qtwebengine/mkspecs/features/platform.prf
-@@ -82,6 +82,7 @@
-     contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
-     contains(QT_ARCH, "mips"): return(true)
- #     contains(QT_ARCH, "mips64"): return(true)
-+    contains(QT_ARCH, "power64"): return(true)
- 
-     skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
-     return(false)
diff --git a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
deleted file mode 100644
index 04d8d3efaac..00000000000
--- a/srcpkgs/qt5/patches/0090-chromium-ppc64le.patch
+++ /dev/null
@@ -1,4267 +0,0 @@
-This is a base patch that adds support for ppc64le glibc. Big endian and musl
-support is added in extra patches afterwards.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
-Upstream: Currently being submitted
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -10,7 +10,7 @@
- #include "build/build_config.h"
- 
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -26,6 +26,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -35,6 +35,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64 KiB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256 KiB
- #else
- static const size_t kPartitionPageShift = 14;  // 16 KiB
- #endif
---- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-+++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
-@@ -11,6 +11,10 @@ import sys
- 
- 
- def Main(args):
-+  # If `disable_nacl=1` is in GYP_DEFINES, exit
-+  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
-+    return 0
-+
-   script_dir = os.path.dirname(os.path.abspath(__file__))
-   src_dir = os.path.dirname(script_dir)
-   nacl_dir = os.path.join(src_dir, 'native_client')
---- qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/build/toolchain/linux/BUILD.gn
-@@ -5,6 +5,14 @@
- import("//build/config/sysroot.gni")
- import("//build/toolchain/gcc_toolchain.gni")
- 
-+clang_toolchain("clang_ppc64") {
-+  enable_linker_map = true
-+  toolchain_args = {
-+    current_cpu = "ppc64"
-+    current_os = "linux"
-+  }
-+}
-+
- clang_toolchain("clang_arm") {
-   toolprefix = "arm-linux-gnueabihf-"
-   toolchain_args = {
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.cc
-@@ -55,6 +55,8 @@ const char kArch[] =
-     "mips64el";
- #elif defined(__mips__)
-     "mipsel";
-+#elif defined(__powerpc64__)
-+    "ppc64";
- #else
- #error "unknown arch"
- #endif
-@@ -127,6 +129,8 @@ const char* UpdateQueryParams::GetNaclArch() {
-   return "mips32";
- #elif defined(ARCH_CPU_MIPS64EL)
-   return "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  return "ppc64";
- #else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
---- qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-+++ qtwebengine/src/3rdparty/chromium/components/update_client/update_query_params.h
-@@ -45,7 +45,7 @@ class UpdateQueryParams {
-   // Returns the value we use for the "nacl_arch" parameter. Note that this may
-   // be different from the "arch" parameter above (e.g. one may be 32-bit and
-   // the other 64-bit). Possible return values include: "x86-32", "x86-64",
--  // "arm", and "mips32".
-+  // "arm", "mips32", and "ppc64".
-   static const char* GetNaclArch();
- 
-   // Returns the current version of Chrome/Chromium.
---- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-+++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
-@@ -12,6 +12,6 @@ use_seccomp_bpf =
-     (is_linux || is_android) &&
-     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
-      current_cpu == "arm64" || current_cpu == "mipsel" ||
--     current_cpu == "mips64el")
-+     current_cpu == "mips64el" || current_cpu == "ppc64")
- 
- use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
-@@ -416,6 +416,8 @@ component("sandbox_services") {
- 
- source_set("sandbox_services_headers") {
-   sources = [
-+    "system_headers/ppc64_linux_syscalls.h",
-+    "system_headers/ppc64_linux_ucontext.h",
-     "system_headers/arm64_linux_syscalls.h",
-     "system_headers/arm_linux_syscalls.h",
-     "system_headers/arm_linux_ucontext.h",
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
-@@ -55,6 +55,13 @@
- #define MAX_PUBLIC_SYSCALL 279u
- #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
- 
-+#elif defined(__powerpc64__)
-+
-+#include <asm/unistd.h>
-+#define MIN_SYSCALL 0u
-+#define MAX_PUBLIC_SYSCALL 386u
-+#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-+
- #else
- #error "Unsupported architecture"
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -16,6 +16,9 @@
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
-+#elif defined(__powerpc64__)
-+// Manually define greg_t on ppc64
-+typedef unsigned long long greg_t;
- #endif
- #endif
- 
-@@ -346,6 +349,51 @@ struct regs_struct {
- #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
- #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
- #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-+
-+#elif defined(__powerpc64__)
-+#include <asm/ptrace.h>
-+
-+typedef struct pt_regs regs_struct;
-+
-+#ifdef ARCH_CPU_LITTLE_ENDIAN
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
-+#else
-+#define SECCOMP_ARCH AUDIT_ARCH_PPC64
-+#endif
-+
-+#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+
-+#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
-+#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
-+#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
-+#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
-+#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
-+#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
-+#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
-+
-+#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-+#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+
-+#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
-+#define SECCOMP_PT_IP(_regs) (_regs).nip
-+#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
-+#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
-+#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
-+#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
-+#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
-+#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
-+
- #else
- #error Unsupported target platform
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
-@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
-          SyscallSets::IsPrctl(sysno) ||
-          SyscallSets::IsProcessGroupOrSession(sysno) ||
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-          SyscallSets::IsSocketCall(sysno) ||
- #endif
- #if defined(__arm__)
-@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_mmap)
-     return RestrictMmapFlags();
- #endif
-@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-     return RestrictPrctl();
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   if (sysno == __NR_socketpair) {
-     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
-     static_assert(AF_UNIX == PF_UNIX,
-@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
-   }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   if (SyscallSets::IsSocketCall(sysno))
-     return RestrictSocketcallCommand();
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
-@@ -257,7 +257,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo);
- TEST_BASELINE_SIGSYS(__NR_syslog);
- TEST_BASELINE_SIGSYS(__NR_timer_create);
- 
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
- TEST_BASELINE_SIGSYS(__NR_eventfd);
- TEST_BASELINE_SIGSYS(__NR_inotify_init);
- TEST_BASELINE_SIGSYS(__NR_vserver);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -35,7 +35,8 @@
- #include <sys/ioctl.h>
- #include <sys/ptrace.h>
- #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
--    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
-+    !defined(__aarch64__) && !defined(__powerpc64__) && \
-+    !defined(PTRACE_GET_THREAD_AREA)
- // 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
-@@ -44,6 +44,11 @@
- #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 !defined(F_DUPFD_CLOEXEC)
-@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
- #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
-@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
-   // operator.
-   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
-   uint64_t kOLargeFileFlag = O_LARGEFILE;
--  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
-+  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
-+      || IsArchitecturePPC64())
-     kOLargeFileFlag = 0100000;
- 
-   const Arg<int> cmd(1);
-@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
-       .Default(CrashSIGSYS());
- }
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- ResultExpr RestrictSocketcallCommand() {
-   // Unfortunately, we are unable to restrict the first parameter to
-   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
-@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
- ResultExpr RestrictPtrace() {
-   const Arg<int> request(0);
-   return Switch(request).CASES((
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-         PTRACE_GETREGS,
-         PTRACE_GETFPREGS,
-         PTRACE_GET_THREAD_AREA,
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
-@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
- // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
- 
--#if defined(__i386__) || defined(__mips__)
-+#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
- // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
- // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
- SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
-   switch (sysno) {
-     case __NR_gettimeofday:
- #if defined(__i386__) || defined(__x86_64__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_time:
- #endif
-       return true;
-@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
- #endif
-     case __NR_settimeofday:  // Privileged.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stime:
- #endif
-     default:
-@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_faccessat:  // EPERM not a valid errno.
-     case __NR_fchmodat:
-     case __NR_fchownat:  // Should be called chownat ?
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
- #elif defined(__i386__) || defined(__arm__) || \
-     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_memfd_create:
-     case __NR_mkdirat:
-     case __NR_mknodat:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_oldlstat:
-     case __NR_oldstat:
- #endif
-@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
-     case __NR_truncate64:
- #endif
-     case __NR_unlinkat:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_utime:
- #endif
-     case __NR_utimensat:  // New.
-@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
- #endif
-       return true;
- // TODO(jln): these should be denied gracefully as well (moved below).
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_fadvise64:  // EPERM not a valid errno.
- #endif
- #if defined(__i386__)
-@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_flock:      // EPERM not a valid errno.
-     case __NR_fstatfs:    // Give information about the whole filesystem.
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_fstatfs64:
- #endif
-     case __NR_fsync:  // EPERM not a valid errno.
-@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
-     case __NR_sync_file_range:  // EPERM not a valid errno.
- #elif defined(__arm__)
-     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
-+#elif defined(__powerpc64__)
-+    case __NR_sync_file_range2: // EPERM not a valid errno.
- #endif
-     default:
-       return false;
-@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
- #endif
-     case __NR_getdents64:  // EPERM not a valid errno.
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_readdir:
- #endif
-       return true;
-@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
- bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
-   switch (sysno) {
-     case __NR_capset:
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_ioperm:  // Intel privilege.
-     case __NR_iopl:    // Intel privilege.
- #endif
-@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
-     case __NR_rt_sigprocmask:
-     case __NR_rt_sigreturn:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigaction:
-     case __NR_sigprocmask:
-     case __NR_sigreturn:
-@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
- #endif
-     case __NR_signalfd4:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_sigpending:
-     case __NR_sigsuspend:
- #endif
-@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
- #endif
-     case __NR_dup3:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_shutdown:
- #endif
-       return true;
-@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_membarrier:
-     case __NR_wait4:
-     case __NR_waitid:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_waitpid:
- #endif
- #if !defined(__GLIBC__)
-@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
-     case __NR_set_tid_address:
- #endif
-     case __NR_unshare:
--#if !defined(__mips__) && !defined(__aarch64__)
-+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_vfork:
- #endif
-     default:
-@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
-       return true;
-     default:
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_socketpair:  // We will want to inspect its argument.
- #endif
-       return false;
-@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
- bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
-   switch (sysno) {
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_accept:
-     case __NR_accept4:
-     case __NR_bind:
-@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
- }
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big multiplexing system call for sockets.
- bool SyscallSets::IsSocketCall(int sysno) {
-   switch (sysno) {
-@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
- }
- #endif
- 
--#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
-+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-+    defined(__powerpc64__)
- bool SyscallSets::IsNetworkSocketInformation(int sysno) {
-   switch (sysno) {
-     case __NR_getpeername:
-@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
-     case __NR_mincore:
-     case __NR_mlockall:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_mmap:
- #endif
- #if defined(__i386__) || defined(__arm__) || \
-@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-   switch (sysno) {
-     case __NR_lseek:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR__llseek:
- #endif
- #if !defined(__aarch64__)
-@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
-     case __NR_readv:
-     case __NR_pread64:
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_recv:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_recvfrom:  // Could specify source.
-     case __NR_recvmsg:   // Could specify source.
- #endif
--#if defined(__i386__) || defined(__x86_64__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_select:
- #endif
--#if defined(__i386__) || defined(__arm__) || defined(__mips__)
-+#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
-     case __NR__newselect:
- #endif
- #if defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_send:
- #endif
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_sendmsg:  // Could specify destination.
-     case __NR_sendto:   // Could specify destination.
- #endif
-@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
-       return true;
-     case __NR_getpriority:
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_nice:
- #endif
-     case __NR_setpriority:
-@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
- bool SyscallSets::IsAdminOperation(int sysno) {
-   switch (sysno) {
- #if defined(__i386__) || defined(__arm__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_bdflush:
- #endif
-     case __NR_kexec_load:
-@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
- 
- bool SyscallSets::IsKernelModule(int sysno) {
-   switch (sysno) {
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_create_module:
-     case __NR_get_kernel_syms:  // Should ENOSYS.
-     case __NR_query_module:
-@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
-     case __NR_swapoff:
-     case __NR_swapon:
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_umount:
- #endif
-     case __NR_umount2:
-@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
-     case __NR_getcpu:
-     case __NR_mbind:
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_migrate_pages:
- #endif
-     case __NR_move_pages:
-@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
-   switch (sysno) {
-     case __NR_acct:  // Privileged.
- #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_getrlimit:
- #endif
--#if defined(__i386__) || defined(__arm__)
-+#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
-     case __NR_ugetrlimit:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_ulimit:
- #endif
-     case __NR_getrusage:
-@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
- #endif
-     case __NR_sysinfo:
-     case __NR_uname:
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__powerpc64__)
-     case __NR_olduname:
-     case __NR_oldolduname:
- #endif
-@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
- // Big system V multiplexing system call.
- bool SyscallSets::IsSystemVIpc(int sysno) {
-   switch (sysno) {
-@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
-   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
-          IsSystemVSharedMemory(sysno);
- #elif defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   return IsSystemVIpc(sysno);
- #endif
- }
-@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
- bool SyscallSets::IsTimer(int sysno) {
-   switch (sysno) {
-     case __NR_getitimer:
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_alarm:
- #endif
-     case __NR_setitimer:
-@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_syncfs:
-     case __NR_vhangup:
- // The system calls below are not implemented.
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_afs_syscall:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_break:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_getpmsg:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_gtty:
-     case __NR_idle:
-     case __NR_lock:
-@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
-     case __NR_prof:
-     case __NR_profil:
- #endif
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-+    defined(__powerpc64__)
-     case __NR_putpmsg:
- #endif
- #if defined(__x86_64__)
-     case __NR_security:
- #endif
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-     case __NR_stty:
- #endif
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
-     case __NR_tuxcall:
- #endif
--#if !defined(__aarch64__)
-+#if !defined(__aarch64__) && !defined(__powerpc64__)
-     case __NR_vserver:
- #endif
-       return true;
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
-@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
-   static bool IsDeniedGetOrModifySocket(int sysno);
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big multiplexing system call for sockets.
-   static bool IsSocketCall(int sysno);
- #endif
- 
- #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
-   static bool IsNetworkSocketInformation(int sysno);
- #endif
- 
-@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
- #endif
- 
- #if defined(__i386__) || \
--    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
-+    defined(__powerpc64__)
-   // Big system V multiplexing system call.
-   static bool IsSystemVIpc(int sysno);
- #endif
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -16,7 +16,7 @@ namespace sandbox {
- namespace {
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
- // Number that's not currently used by any Linux kernel ABIs.
- const int kInvalidSyscallNumber = 0x351d3;
- #else
-@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
-     // Enter the kernel
-     "svc 0\n"
-     "2:ret\n"
-+    ".cfi_endproc\n"
-+    ".size SyscallAsm, .-SyscallAsm\n"
-+#elif defined(__powerpc64__)
-+    ".text\n"
-+    ".align 4\n"
-+    ".type SyscallAsm @function\n"
-+    "SyscallAsm:\n"
-+    ".cfi_startproc\n"
-+
-+    // Check if r3 is negative
-+    "cmpdi 3, 0\n"
-+    "bgt 2f\n"
-+
-+    // Load address of 3f into r3 and return
-+    "mflr 10\n"
-+    "bl 1f\n"
-+    "1: mflr 3\n"
-+    "mtlr 10\n"
-+    "addi 3, 3, 4*13\n"
-+    "blr\n"
-+
-+    // Load arguments from array into r3-8
-+    // save param 3 in r10
-+    "2:\n"
-+    "mr 0, 3\n"
-+    "ld 3, 0(4)\n"
-+    "ld 5, 16(4)\n"
-+    "ld 6, 24(4)\n"
-+    "ld 7, 32(4)\n"
-+    "ld 8, 40(4)\n"
-+    "ld 4, 8(4)\n"
-+    "li 9, 0\n"
-+
-+    // Enter kernel
-+    "sc\n"
-+
-+    // Magic return address
-+    "3:\n"
-+    // Like MIPS, ppc64 return values are always positive.
-+    // Check for error in cr0.SO and negate upon error
-+    "bc 4, 3, 4f\n"
-+    "neg 3, 3\n"
-+    "4: blr\n"
-+
-     ".cfi_endproc\n"
-     ".size SyscallAsm, .-SyscallAsm\n"
- #endif
-     );  // asm
- 
--#if defined(__x86_64__)
-+#if defined(__x86_64__) || defined(__powerpc64__)
- extern "C" {
- intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
- }
-@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
-     ret = inout;
-   }
- 
-+#elif defined(__powerpc64__)
-+  intptr_t ret = SyscallAsm(nr, args);
- #else
- #error "Unimplemented architecture"
- #endif
-@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-     // needs to be changed back.
-     ret_val = -ret_val;
-     SECCOMP_PARM4(ctx) = 1;
--  } else
-+  } else {
-     SECCOMP_PARM4(ctx) = 0;
-+  }
-+#endif
-+#if defined(__powerpc64__)
-+  // Same as MIPS, need to invert ret and set error register (cr0.SO)
-+  if (ret_val <= -1 && ret_val >= -4095) {
-+    ret_val = -ret_val;
-+    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+  } else {
-+    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+  }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
- }
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
-@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
-       SetIsInSigHandler();
-     }
- 
-+#if defined(__powerpc64__)
-+    // On ppc64+glibc, some syscalls seem to accidentally negate the first
-+    // parameter which causes checks against it to fail. For now, manually
-+    // negate them back.
-+    // TODO(shawn@anastas.io): investigate this issue further
-+    auto nr = SECCOMP_SYSCALL(ctx);
-+    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
-+        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
-+        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
-+            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
-+        }
-+    }
-+#endif
-+
-     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
-     // is what we are showing to TrapFnc callbacks that the system call
-     // evaluator registered with the sandbox.
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
-@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
-   pid_t pid = -1;
-   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
--    defined(ARCH_CPU_MIPS_FAMILY)
-+    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
-   // The stack grows downward.
-   void* stack = stack_buf + sizeof(stack_buf);
- #else
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
-@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
- #if defined(__NR_fstatat)
-     case __NR_fstatat:
- #endif
--#if defined(__x86_64__) || defined(__aarch64__)
-+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
-     case __NR_newfstatat:
- #endif
-       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
-@@ -29,6 +29,9 @@
- #ifndef EM_AARCH64
- #define EM_AARCH64 183
- #endif
-+#ifndef EM_PPC64
-+#define EM_PPC64 21
-+#endif
- 
- #ifndef __AUDIT_ARCH_64BIT
- #define __AUDIT_ARCH_64BIT 0x80000000
-@@ -54,6 +57,12 @@
- #ifndef AUDIT_ARCH_AARCH64
- #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
- #endif
-+#ifndef AUDIT_ARCH_PPC64
-+#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
-+#endif
-+#ifndef AUDIT_ARCH_PPC64LE
-+#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
-+#endif
- 
- // For prctl.h
- #ifndef PR_SET_SECCOMP
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
-@@ -13,7 +13,7 @@
- // (not undefined, but defined different values and in different memory
- // layouts). So, fill the gap here.
- #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
--    defined(__aarch64__)
-+    defined(__aarch64__) || defined(__powerpc64__)
- 
- #define LINUX_SIGHUP 1
- #define LINUX_SIGINT 2
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
-@@ -35,5 +35,9 @@
- #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
- #endif
- 
-+#if defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
-+#endif
-+
- #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
- 
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
-@@ -11,6 +11,8 @@
- #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
- #elif defined(__i386__)
- #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
-+#elif defined(__powerpc64__)
-+#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
- #else
- #error "No support for your architecture in PNaCl header"
- #endif
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-+
-+#include <asm/unistd.h>
-+
-+//TODO: is it necessary to redefine syscall numbers for PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
-@@ -0,0 +1,12 @@
-+// Copyright 2014 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
-+
-+#include <sys/ucontext.h>
-+
-+//TODO: is it necessary to redefine ucontext on PPC64?
-+
-+#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -15,6 +15,11 @@
- #include "sandbox/linux/system_headers/linux_syscalls.h"
- #include "services/service_manager/sandbox/linux/sandbox_linux.h"
- 
-+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
-+#ifdef __powerpc64__
-+#include <termios.h>
-+#endif
-+
- // TODO(vignatti): replace the local definitions below with #include
- // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
- #include <linux/types.h>
---- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
-@@ -9,6 +9,7 @@
- #ifndef LIBANGLE_CONSTANTS_H_
- #define LIBANGLE_CONSTANTS_H_
- 
-+#include <cstddef>
- #include "common/platform.h"
- 
- namespace gl
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/BUILD.gn
-@@ -46,6 +46,10 @@ if (current_cpu == "x86" || current_cpu == "x64") {
-       sources = [
-         "SaveRegisters_mips64.S",
-       ]
-+    } else if (current_cpu == "ppc64") {
-+      sources = [
-+        "SaveRegisters_ppc64.S",
-+      ]
-     }
- 
-     if (current_cpu == "arm") {
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/asm/SaveRegisters_ppc64.S
-@@ -0,0 +1,60 @@
-+/*
-+ * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*);
-+ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback)
-+ */
-+
-+.type PushAllRegisters, %function
-+.global PushAllRegisters
-+.hidden PushAllRegisters
-+PushAllRegisters:
-+        // Push all callee-saves registers to get them
-+        // on the stack for conservative stack scanning.
-+        // Reserve space for callee-saved registers and minimal stack frame.
-+        mflr 0         # r0 = LR
-+        std 0,16(1)    # store LR at addr sp+16
-+        stdu 1,-176(1) # grow stack by 176 bytes and store new stack top ptr to r1
-+            # 3218*8 = min stack  non-volatile registers
-+
-+        // Save the callee-saved registers
-+        std 31,168(1)  # store r31 to addr sp+168 
-+        std 30,160(1)  # etc...
-+        std 29,152(1)
-+        std 28,144(1)
-+        std 27,136(1)
-+        std 26,128(1)
-+        std 25,120(1)
-+        std 24,112(1)
-+        std 23,104(1)
-+        std 22,96(1)
-+        std 21,88(1)
-+        std 20,80(1)
-+        std 19,72(1)
-+        std 18,64(1)
-+        std 17,56(1)
-+        std 16,48(1)
-+        std 15,40(1)
-+        std 14,32(1)
-+        
-+        // Note: the callee-saved floating point registers do not need to be
-+        // copied to the stack, because fp registers never hold heap pointers
-+        // and so do not need to be kept visible to the garbage collector.
-+        
-+        // Pass the two first arguments untouched in r3 and r4 and the
-+        // stack pointer to the callback.
-+
-+        std 2, 24(1)   # save r2 to sp+24 addr
-+        mtctr 5        # copy 3rd function arg (callback fn pointer) to CTR
-+        mr 12, 5       # r12 must hold address of callback we are going to call 
-+                       #  for position-idependent functions inside the callback to work
-+        mr 5, 1        # set current sp (stack top) as 3rd argument for the callback
-+        bctrl          # set LR to PC+4 and call the callback
-+        ld 2, 24(1)    # restore r2 from sp+24 addr
-+
-+        // Adjust stack, restore return address and return.
-+        // Note: the copied registers do not need to be reloaded here,
-+        // because they were preserved by the called routine.
-+        addi 1,1,176   # restore original SP by doing sp += 176
-+        ld 0,16(1)     # restore original LR from addr sp+16
-+        mtlr 0         # ... copy it to the actual LR
-+        blr            # return to LR addr
-+
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/heap/heap_page.h
-@@ -67,11 +67,12 @@ constexpr size_t kBlinkPageBaseMask = ~kBlinkPageOffsetMask;
- constexpr size_t kBlinkPagesPerRegion = 10;
- 
- // TODO(nya): Replace this with something like #if ENABLE_NACL.
--#if 0
-+#if defined(ARCH_CPU_PPC64)
- // NaCl's system page size is 64 KiB. This causes a problem in Oilpan's heap
- // layout because Oilpan allocates two guard pages for each Blink page (whose
- // size is kBlinkPageSize = 2^17 = 128 KiB). So we don't use guard pages in
- // NaCl.
-+// The same issue holds for ppc64 systems, which use a 64k page size.
- constexpr size_t kBlinkGuardPageSize = 0;
- #else
- constexpr size_t kBlinkGuardPageSize = base::kSystemPageSize;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/dtoa/utils.h
-@@ -45,7 +45,7 @@
- // disabled.)
- // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
- #if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \
--    defined(__aarch64__) || defined(__MIPSEL__)
-+    defined(__aarch64__) || defined(__MIPSEL__) || defined(__powerpc64__)
- #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
- #elif defined(_M_IX86) || defined(__i386__)
- #if defined(_WIN32)
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
-@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
-       } else {
-         public_configs = [ ":no_asm_config" ]
-       }
-+    } else if (current_cpu == "ppc64") {
-+      if (is_linux) {
-+        # TODO: ppc64 (be) check
-+        sources += crypto_sources_linux_ppc64le
-+      } else {
-+        public_configs = [ ":no_asm_config" ]
-+      }
-     } else {
-       public_configs = [ ":no_asm_config" ]
-     }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
-@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
- typedef MDRawContextARM64_Old RawContextCPU;
- #elif defined(__mips__)
- typedef MDRawContextMIPS RawContextCPU;
-+#elif defined(__powerpc64__)
-+typedef MDRawContextPPC64 RawContextCPU;
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-   out->float_save.fir = mcontext.fpc_eir;
- #endif
- }
--#endif  // __mips__
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t ThreadInfo::GetInstructionPointer() const {
-+    return mcontext.gp_regs[PT_NIP];
-+}
-+
-+void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = mcontext.gp_regs[i];
-+
-+    out->lr = mcontext.gp_regs[PT_LNK];
-+    out->srr0 = mcontext.gp_regs[PT_NIP];
-+    out->srr1 = mcontext.gp_regs[PT_MSR];
-+    out->cr = mcontext.gp_regs[PT_CCR];
-+    out->xer = mcontext.gp_regs[PT_XER];
-+    out->ctr = mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] = \
-+            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
-+                          | vregs.vrregs[i][1], 
-+            (((uint64_t)vregs.vrregs[i][2]) << 32)
-+                         | vregs.vrregs[i][3]};
-+
-+    out->vrsave = vregs.vrsave;
-+    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+#endif  // __powerpc64__
- 
- void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-   assert(gp_regs || size);
-@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
-     *gp_regs = mcontext.gregs;
-   if (size)
-     *size = sizeof(mcontext.gregs);
-+#elif defined(__powerpc64__)
-+  if (gp_regs)
-+    *gp_regs = mcontext.gp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.gp_regs);
- #else
-   if (gp_regs)
-     *gp_regs = &regs;
-@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
-     *fp_regs = &mcontext.fpregs;
-   if (size)
-     *size = sizeof(mcontext.fpregs);
-+#elif defined(__powerpc64__)
-+  if (fp_regs)
-+    *fp_regs = &mcontext.fp_regs;
-+  if (size)
-+    *size = sizeof(mcontext.fp_regs);
- #else
-   if (fp_regs)
-     *fp_regs = &fpregs;
-@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- #endif
- }
- 
-+#if defined(__powerpc64__)
-+void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
-+    if (v_regs)
-+        *v_regs = &vregs;
-+    if (size)
-+        *size = sizeof(vregs);
-+}
-+#endif
-+
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
-@@ -68,6 +68,10 @@ struct ThreadInfo {
-   // Use the structures defined in <sys/user.h>
-   struct user_regs_struct regs;
-   struct user_fpsimd_struct fpregs;
-+#elif defined(__powerpc64__)
-+  // Use the structures defined in <sys/ucontext.h>.
-+  mcontext_t mcontext;
-+  vrregset_t vregs;
- #elif defined(__mips__)
-   // Use the structure defined in <sys/ucontext.h>.
-   mcontext_t mcontext;
-@@ -84,6 +88,11 @@ struct ThreadInfo {
- 
-   // Returns the pointer and size of float point register area.
-   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-+
-+#if defined(__powerpc64__)
-+  // Returns the pointer and size of the vector register area. (PPC64 only)
-+  void GetVectorRegisters(void** v_regs, size_t* size);
-+#endif
- };
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
- #endif
- }
-+
-+#elif defined(__powerpc64__)
-+
-+uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
-+}
-+
-+uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
-+    return uc->uc_mcontext.gp_regs[PT_NIP];
-+}
-+
-+void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-+                                    const vrregset_t* vregs) {
-+    out->context_flags = MD_CONTEXT_PPC64_FULL;
-+
-+    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
-+
-+    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
-+    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
-+    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
-+    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
-+    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
-+    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-+    
-+    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+
-+    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+
-+    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-+        out->vector_save.save_vr[i] =
-+            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
-+                         | vregs->vrregs[i][1], 
-+             (((uint64_t)vregs->vrregs[i][2]) << 32)
-+                         | vregs->vrregs[i][3]};
-+
-+    out->vrsave = vregs->vrsave;
-+    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
-+    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
-+}
-+
- #endif
- 
- }  // namespace google_breakpad
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -54,6 +54,9 @@ struct UContextReader {
- #elif defined(__aarch64__)
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-                              const struct fpsimd_context* fpregs);
-+#elif defined(__powerpc64__)
-+  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
-+                             const vrregset_t* vregs);
- #else
-   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
-     memcpy(&g_crash_context_.float_state, fp_ptr,
-            sizeof(g_crash_context_.float_state));
-   }
-+#elif defined(__powerpc64__)
-+  // On PPC64, we must copy VR state
-+  ucontext_t* uc_ptr = (ucontext_t*)uc;
-+  if (uc_ptr->uc_mcontext.v_regs) {
-+    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
-+           sizeof(g_crash_context_.vector_state));
-+  }
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
-   // FP state is not part of user ABI on ARM Linux.
--  // In case of MIPS Linux FP state is already part of ucontext_t
-+  // In case of MIPS, Linux FP state is already part of ucontext_t
-   // and 'float_state' is not a member of CrashContext.
-   ucontext_t* uc_ptr = (ucontext_t*)uc;
-   if (uc_ptr->uc_mcontext.fpregs) {
-@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
-   }
- #endif
- 
--#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
-+#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
-+    && !defined(__powerpc64__)
-   // FPU state is not part of ARM EABI ucontext_t.
-   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
-          sizeof(context.float_state));
- #endif
-+
-+#if defined(__powerpc64__)
-+  // Vector registers must be copied on PPC64
-+  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
-+         sizeof(context.vector_state));
-+#endif
-+
-   context.tid = sys_gettid();
- 
-   // Add an exception stream to the minidump for better reporting.
-@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
- #elif defined(__mips__)
-   context.siginfo.si_addr =
-       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-+#elif defined(__powerpc64__)
-+  context.siginfo.si_addr =
-+      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
- #else
- #error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
-@@ -192,7 +192,11 @@ class ExceptionHandler {
-     siginfo_t siginfo;
-     pid_t tid;  // the crashing thread.
-     ucontext_t context;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
-+    // state is not, so a struct is needed.
-+    vstate_t vector_state;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
-     // In case of MIPS Linux FP state is already part of ucontext_t so
-     // 'float_state' is not required.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
-@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
-   }
- 
-   // Wait a while until the child should have crashed.
--  usleep(1000000);
-+  usleep(2000000);
-   // Kill the child if it is still running.
-   kill(child, SIGKILL);
- 
-@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
- #if defined(__mips__)
-   // mfc2 zero,Impl - usually illegal in userspace.
-   0x48, 0x00, 0x00, 0x48
-+#elif defined(__powerpc64__)
-+  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
- #else
-   // This crashes with SIGILL on x86/x86-64/arm.
-   0xff, 0xff, 0xff, 0xff
-@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- 
-   // These are defined here so the parent can use them to check the
-   // data from the minidump afterwards.
--  // Use 4k here because the OS will hand out a single page even
-+  // Use the page size here because the OS will hand out a single page even
-   // if a smaller size is requested, and this test wants to
-   // test the upper bound of the memory range.
--  const uint32_t kMemorySize = 4096;  // bytes
-+  const uint32_t kMemorySize = getpagesize();  // bytes
-   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
- 
-   const pid_t child = fork();
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
-@@ -138,7 +138,9 @@ class MicrodumpWriter {
-                   const MicrodumpExtraInfo& microdump_extra_info,
-                   LinuxDumper* dumper)
-       : ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -337,6 +339,8 @@ class MicrodumpWriter {
- # else
- #  error "This mips ABI is currently not supported (n32)"
- #endif
-+#elif defined(__powerpc64__)
-+    const char kArch[] = "ppc64";
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -409,7 +413,9 @@ class MicrodumpWriter {
-   void DumpCPUState() {
-     RawContextCPU cpu;
-     my_memset(&cpu, 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
- #else
-     UContextReader::FillCPUContext(&cpu, ucontext_);
-@@ -605,7 +611,9 @@ class MicrodumpWriter {
-   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
- 
-   const ucontext_t* const ucontext_;
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
-   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-   ASSERT_TRUE(ContainsMicrodump(buf));
- 
-+  int page_size = getpagesize();
- #ifdef __LP64__
--  ASSERT_NE(std::string::npos,
--            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
--                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  // This test is only available for the following page sizes
-+  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
-+  if (page_size == 4096) { 
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  } else {
-+    ASSERT_NE(std::string::npos,
-+              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
-+                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-+  }
- #else
-   ASSERT_NE(std::string::npos,
-             buf.find("M 00001000 0000002A 00001000 "
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
-@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
-@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
-         memset(&info, 0, sizeof(ThreadInfo));
-         info.tgid = status->pr_pgrp;
-         info.ppid = status->pr_ppid;
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        for (int i = 0; i < 31; i++)
-+            info.mcontext.gp_regs[i] = status->pr_reg[i];
-+#elif defined(__mips__)
- #if defined(__ANDROID__)
-         for (int i = EF_R0; i <= EF_R31; i++)
-           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
-@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
-       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
- 
-   // The number of bytes of stack which we try to capture.
--  static const ptrdiff_t kStackToCapture = 32 * 1024;
-+  // This now depends on page_size to avoid missing data
-+  // on systems with larger page sizes.
-+  static const ptrdiff_t kStackToCapture = 8 * page_size;
- 
-   const MappingInfo* mapping = FindMapping(stack_pointer);
-   if (!mapping)
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
-@@ -60,7 +60,8 @@ namespace google_breakpad {
-  (defined(__mips__) && _MIPS_SIM == _ABIO32)
- typedef Elf32_auxv_t elf_aux_entry;
- #elif defined(__x86_64) || defined(__aarch64__) || \
--     (defined(__mips__) && _MIPS_SIM != _ABIO32)
-+     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
-+     defined(__powerpc64__)
- typedef Elf64_auxv_t elf_aux_entry;
- #endif
- 
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@@ -51,6 +51,8 @@
- #define TID_PTR_REGISTER "rcx"
- #elif defined(__mips__)
- #define TID_PTR_REGISTER "$1"
-+#elif defined(__powerpc64__)
-+#define TID_PTR_REGISTER "r8"
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
-@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
-   return true;
- }
- 
--bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
--{
-+bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
- #ifdef PTRACE_GETREGSET
-   struct iovec io;
-   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
-     return false;
-   }
- 
-   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
--  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
-     return false;
-   }
-+
-+#if defined(__powerpc64__)
-+  // Grab the vector registers on PPC64 too
-+  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
-+  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
-+    return false;
-+  }
-+#endif // defined(__powerpc64__)
-+
-   return true;
- #else
-   return false;
-@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- #elif defined(__mips__)
-   stack_pointer =
-       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-+#elif defined(__powerpc64__)
-+  stack_pointer =
-+      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
- #else
- #error "This code hasn't been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- #elif defined(__mips__)
-     pid_t* process_tid_location =
-         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-+#elif defined(__powerpc64__)
-+    pid_t* process_tid_location =
-+        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
- #else
- #error This test has not been ported to this platform.
- #endif
-@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
-   uintptr_t heap_addr = thread_info.regs.rcx;
- #elif defined(__mips__)
-   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
-+#elif defined(__powerpc64__)
-+  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
- #else
- #error This test has not been ported to this platform.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
-@@ -136,7 +136,9 @@ class MinidumpWriter {
-       : fd_(minidump_fd),
-         path_(minidump_path),
-         ucontext_(context ? &context->context : NULL),
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        vector_state_(context ? &context->vector_state : NULL),
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         float_state_(context ? &context->float_state : NULL),
- #endif
-         dumper_(dumper),
-@@ -468,7 +470,9 @@ class MinidumpWriter {
-         if (!cpu.Allocate())
-           return false;
-         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
- #else
-         UContextReader::FillCPUContext(cpu.get(), ucontext_);
-@@ -891,7 +895,7 @@ class MinidumpWriter {
-     dirent->location.rva = 0;
-   }
- 
--#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
-+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
-   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
-     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
-     static const char vendor_id_name[] = "vendor_id";
-@@ -911,7 +915,9 @@ class MinidumpWriter {
- 
-     // processor_architecture should always be set, do this first
-     sys_info->processor_architecture =
--#if defined(__mips__)
-+#if defined(__powerpc64__)
-+        MD_CPU_ARCHITECTURE_PPC64;
-+#elif defined(__mips__)
- # if _MIPS_SIM == _ABIO32
-         MD_CPU_ARCHITECTURE_MIPS;
- # elif _MIPS_SIM == _ABI64
-@@ -1327,7 +1333,9 @@ class MinidumpWriter {
-   const char* path_;  // Path to the file where the minidum should be written.
- 
-   const ucontext_t* const ucontext_;  // also from the signal handler
--#if !defined(__ARM_EABI__) && !defined(__mips__)
-+#if defined(__powerpc64__)
-+  const google_breakpad::vstate_t* const vector_state_;
-+#elif !defined(__ARM_EABI__) && !defined(__mips__)
-   const google_breakpad::fpstate_t* const float_state_;  // ditto
- #endif
-   LinuxDumper* dumper_;
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -47,6 +47,8 @@ class ExceptionHandler;
- 
- #if defined(__aarch64__)
- typedef struct fpsimd_context fpstate_t;
-+#elif defined(__powerpc64__)
-+typedef vrregset_t vstate_t;
- #elif !defined(__ARM_EABI__) && !defined(__mips__)
- typedef struct _fpstate fpstate_t;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
- #elif defined(__mips__)
-   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
-       invalid_stack_pointer;
-+#elif defined(__powerpc64__)
-+  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
-+      invalid_stack_pointer;
- #else
- # error "This code has not been ported to your platform yet."
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
-@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
-   }
- 
- #if defined(__x86_64__) || defined(__aarch64__) || \
--   (defined(__mips__) && _MIPS_SIM == _ABI64)
--
-+   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
-   struct kernel_stat st;
-   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
-@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- TEST_F(MemoryMappedFileTest, MapWithOffset) {
-   // Put more data in the test file this time. Offsets can only be
-   // done on page boundaries, so we need a two page file to test this.
--  const int page_size = 4096;
--  char data1[2 * page_size];
--  size_t data1_size = sizeof(data1);
-+  const int page_size = getpagesize();
-+  char *data1 = static_cast<char*>(malloc(2 * page_size));
-+  EXPECT_TRUE(data1 != NULL);
-+  size_t data1_size = (2 * page_size);
-   for (size_t i = 0; i < data1_size; ++i) {
-     data1[i] = i & 0x7f;
-   }
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
-@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
- 
-   EXPECT_EQ(0U, allocator.pages_allocated());
-   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
-+  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
-   ASSERT_FALSE(p == NULL);
--  EXPECT_EQ(3U, allocator.pages_allocated());
-+  EXPECT_EQ(expected_pages, allocator.pages_allocated());
-   for (unsigned i = 1; i < 10; ++i) {
-     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
-     ASSERT_FALSE(p == NULL);
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
-@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-   // Check architecture and set architecture variable to corresponding flag
-   // in objdump.
-   switch (context->GetContextCPU()) {
-+#if defined(__i386) || defined(__x86_64)
-     case MD_CONTEXT_X86:
-       architecture = "i386";
-       break;
-     case MD_CONTEXT_AMD64:
-       architecture = "i386:x86-64";
-       break;
-+#endif
-     default:
-       // Unsupported architecture. Note that ARM architectures are not
-       // supported because objdump does not support ARM.
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
-@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
- }
- 
- TEST(ExploitabilityTest, TestWindowsEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("ascii_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
-             ExploitabilityFor("read_av_clobber_write.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
-             ExploitabilityFor("read_av_conditional.dmp"));
-+#endif
- }
- 
- TEST(ExploitabilityTest, TestLinuxEngine) {
-+// The following tests are only executable on an x86-class linux machine.
-+#if defined(__i386) || defined(__x86_64)
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_null_read_av.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_executable_heap.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
--#ifndef _WIN32
-+#endif
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
-@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
-             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
-   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
-             ExploitabilityFor("linux_write_to_under_4k.dmp"));
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
- }
- 
--#ifndef _WIN32
-+#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
- TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
-   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
-   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
-@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
-                                                          context,
-                                                          &write_address));
- }
--#endif  // _WIN32
-+#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
-+
- 
- }  // namespace
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
-@@ -76,6 +76,8 @@
-   #define ELF_ARCH  EM_MIPS
- #elif defined(__aarch64__)
-   #define ELF_ARCH  EM_AARCH64
-+#elif defined(__powerpc64__)
-+  #define ELF_ARCH  EM_PPC64
- #endif
- 
- #if defined(__arm__)
-@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
- #elif defined (__mips__)
- // This file-local typedef simplifies the source code.
- typedef gregset_t user_regs_struct;
-+#elif defined(__powerpc64__)
-+typedef struct pt_regs user_regs_struct;
- #endif
- 
- using google_breakpad::MDTypeHelper;
-@@ -320,6 +324,9 @@ struct CrashedProcess {
- #endif
- #if defined(__aarch64__)
-     user_fpsimd_struct fpregs;
-+#endif
-+#if defined(__powerpc64__)
-+    mcontext_t mcontext;
- #endif
-     uintptr_t stack_addr;
-     const uint8_t* stack;
-@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
-   thread->mcontext.fpc_eir = rawregs->float_save.fir;
- #endif
- }
-+#elif defined(__powerpc64__)
-+static void
-+ParseThreadRegisters(CrashedProcess::Thread* thread,
-+                     const MinidumpMemoryRange& range) {
-+  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
-+
-+  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
-+    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
-+
-+  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
-+  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
-+  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
-+  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
-+  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
-+  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
-+  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
-+
-+  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
-+      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
-+
-+  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
-+
-+  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
-+      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
-+      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
-+      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
-+      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
-+  }
-+
-+  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
-+}
-+
- #else
- #error "This code has not been ported to your platform yet"
- #endif
-@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
- # else
- #  error "This mips ABI is currently not supported (n32)"
- # endif
-+#elif defined(__powerpc64__)
-+  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
-+    fprintf(stderr,
-+            "This version of minidump-2-core only supports PPC64.\n");
-+    exit(1);
-+  }
- #else
- #error "This code has not been ported to your platform yet"
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
-@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
- Robert Sesek <rsesek@chromium.org>
- Scott Graham <scottmg@chromium.org>
- Joshua Peraza <jperaza@chromium.org>
-+Shawn Anastasio <shawn@anastas.io>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
- 
-+#include <cstddef>
- #include_next <sys/user.h>
- 
- #include <features.h>
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
-@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
-+//! Based on minidump_cpu_ppc64.h from breakpad
-+enum MinidumpContextPPC64Flags : uint32_t {
-+  //! \brief Identifies the context as PPC64.
-+  kMinidumpContextPPC64 = 0x01000000,
-+
-+  //! \brief Indicates the validity of general purpose registers.
-+  //!
-+  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
-+  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
-+
-+  //! \brief Indicates the validity of floating point registers.
-+  //!
-+  //! Registers `fp0`-`fp31`, `fpscr` are valid.
-+  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
-+
-+  //! \brief Indicates the validity of Altivec/VMX registers.
-+  //!
-+  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
-+  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
-+
-+  //! \brief Indicates the validity of all registers
-+  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
-+                             kMinidumpContextPPC64Floating |
-+                             kMinidumpContextPPC64Vector
-+};
-+
-+//! \brief A PPC64 CPU context carried in a minidump file.
-+//! Based on minidump_cpu_ppc64.h from breakpad.
-+struct MinidumpContextPPC64 {
-+  uint64_t context_flags;
-+
-+  //! \brief General purpose registers.
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+
-+  //! \brief Floating point registers.
-+  double fpregs[32];
-+
-+  //! \brief FPU status register.
-+  double fpscr;
-+
-+  //! \brief Altivec/VMX vector registers.
-+  struct {
-+      //! \brief Vector registers are 128bits.
-+      uint128_struct save_vr[32];
-+      uint128_struct save_vscr;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad5[4];
-+
-+      //! \brief VRSAVE register.
-+      uint32_t save_vrsave;
-+
-+      //! \brief Padding included for breakpad compatibiltiy.
-+      uint32_t save_pad6[7];
-+  } vregs;
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
-@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
-       break;
-     }
- 
-+    case kCPUArchitecturePPC64: {
-+      context = std::make_unique<MinidumpContextPPC64Writer>();
-+      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
-+          ->InitalizeFromSnapshot(context_snapshot->ppc64);
-+      break;
-+    }
-+
-     default: {
-       LOG(ERROR) << "unknown context architecture "
-                  << context_snapshot->architecture;
-@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
-   return sizeof(context_);
- }
- 
-+MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
-+  : MinidumpContextWriter(), context_() {
-+    context_.context_flags = kMinidumpContextPPC64;
-+}
-+
-+MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
-+
-+void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
-+    const CPUContextPPC64* context_snapshot) {
-+  DCHECK_EQ(state(), kStateMutable);
-+  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
-+
-+  context_.context_flags = kMinidumpContextPPC64All;
-+
-+  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
-+  context_.nip = context_snapshot->nip;
-+  context_.msr = context_snapshot->msr;
-+  context_.ccr = context_snapshot->ccr;
-+  context_.xer = context_snapshot->xer;
-+  context_.lnk = context_snapshot->lnk;
-+  context_.ctr = context_snapshot->ctr;
-+
-+  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
-+  context_.fpscr = context_snapshot->fpscr;
-+
-+  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
-+         sizeof(context_.vregs.save_vr));
-+  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
-+         sizeof(context_.vregs.save_vscr));
-+  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
-+}
-+
-+bool MinidumpContextPPC64Writer::WriteObject(
-+    FileWriterInterface* file_writer) {
-+  DCHECK_EQ(state(), kStateWritable);
-+  return file_writer->Write(&context_, sizeof(context_));
-+}
-+
-+size_t MinidumpContextPPC64Writer::ContextSize() const {
-+  DCHECK_GE(state(), kStateFrozen);
-+  return sizeof(context_);
-+}
-+
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
-@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
-   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
- };
- 
-+class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
-+ public:
-+  MinidumpContextPPC64Writer();
-+  ~MinidumpContextPPC64Writer() override;
-+
-+  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
-+  //!
-+  //! \param[in] context_snapshot The context snapshot to use as source data.
-+  //!
-+  //! \note Valid in #kStateMutable. No mutation of context() may be done before
-+  //!     calling this method, and it is not normally necessary to alter
-+  //!     context() after calling this method.
-+  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
-+
-+  //! \brief Returns a pointer to the context structure that this object will
-+  //!     write.
-+  //!
-+  //! \attention This returns a non-`const` pointer to this object’s private
-+  //!     data so that a caller can populate the context structure directly.
-+  //!     This is done because providing setter interfaces to each field in the
-+  //!     context structure would be unwieldy and cumbersome. Care must be taken
-+  //!     to populate the context structure correctly. The context structure
-+  //!     must only be modified while this object is in the #kStateMutable
-+  //!     state.
-+  MinidumpContextPPC64* context() { return &context_; }
-+
-+ protected:
-+  // MinidumpWritable:
-+  bool WriteObject(FileWriterInterface* file_writer) override;
-+
-+  // MinidumpContextWriter:
-+  size_t ContextSize() const override;
-+
-+ private:
-+  MinidumpContextPPC64 context_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
-+};
-+
- }  // namespace crashpad
- 
- #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
-@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
-       context, ExpectMinidumpContextMIPS64, kSeed);
- }
- 
-+TEST(MinidumpContextWriter, PPC64_Zeros) {
-+  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+    ExpectMinidumpContextPPC64);
-+}
-+
-+TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
-+  constexpr uint32_t kSeed = 64;
-+  CPUContextPPC64 context_ppc64;
-+  CPUContext context;
-+  context.ppc64 = &context_ppc64;
-+  InitializeCPUContextPPC64(&context, kSeed);
-+  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
-+      context, ExpectMinidumpContextPPC64, kSeed);
-+}
-+
- }  // namespace
- }  // namespace test
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
-@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
-   static constexpr char kCPU[] = "mips";
- #elif defined(ARCH_CPU_MIPS64EL)
-   static constexpr char kCPU[] = "mips64";
-+#elif defined(ARCH_CPU_PPC64)
-+  static constexpr char kCPU[] = "ppc64";
- #else
- #error define kCPU for this CPU
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
-@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
-   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
-     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
-+  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
-+    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
-+  }
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
-@@ -43,7 +43,10 @@ enum CPUArchitecture {
-   kCPUArchitectureMIPSEL,
- 
-   //! \brief 64-bit MIPSEL.
--  kCPUArchitectureMIPS64EL
-+  kCPUArchitectureMIPS64EL,
-+
-+  //! \brief 64-bit PPC64.
-+  kCPUArchitecturePPC64
- };
- 
- }  // namespace crashpad
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
-@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
-       return arm->pc;
-     case kCPUArchitectureARM64:
-       return arm64->pc;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->nip;
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
-       return arm->sp;
-     case kCPUArchitectureARM64:
-       return arm64->sp;
-+    case kCPUArchitecturePPC64:
-+      return ppc64->regs[1];
-     default:
-       NOTREACHED();
-       return ~0ull;
-@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
-     case kCPUArchitectureX86_64:
-     case kCPUArchitectureARM64:
-     case kCPUArchitectureMIPS64EL:
-+    case kCPUArchitecturePPC64:
-       return true;
-     case kCPUArchitectureX86:
-     case kCPUArchitectureARM:
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
-@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
-   uint64_t fir;
- };
- 
-+//! \brief A context structure carrying PPC64 CPU state.
-+struct CPUContextPPC64 {
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t regs[32];
-+  uint64_t ccr;
-+  uint64_t xer;
-+  uint64_t lnk;
-+  uint64_t ctr;
-+  double fpregs[32];
-+  double fpscr;
-+  struct {
-+    uint128_struct save_vr[32];
-+    uint128_struct save_vscr;
-+    uint32_t save_vrsave;
-+  } vregs;
-+};
-+
- //! \brief A context structure capable of carrying the context of any supported
- //!     CPU architecture.
- struct CPUContext {
-@@ -382,6 +400,7 @@ struct CPUContext {
-     CPUContextARM64* arm64;
-     CPUContextMIPS* mipsel;
-     CPUContextMIPS64* mips64;
-+    CPUContextPPC64* ppc64;
-   };
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
-@@ -15,6 +15,7 @@
- #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
- 
-+#include <cstring>
- #include "build/build_config.h"
- #include "snapshot/cpu_context.h"
- #include "snapshot/linux/signal_context.h"
-@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
- 
- #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
-+
-+//! \brief Initalizes a CPUContextPPC64 structure from native context
-+//!     structures on Linux.
-+//!
-+//! \param[in] thread_context The native thread context.
-+//! \param[in] float_context The native float context.
-+//! \param[in] vector_context The native vector context.
-+//! \param[out] context The CPUContextPPC64 structure to initalize.
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const ThreadContext::t64_t& thread_context,
-+    const FloatContext::f64_t& float_context,
-+    const VectorContext::v64_t& vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+template <typename Traits>
-+void InitializeCPUContextPPC64(
-+    const SignalThreadContext64 &thread_context,
-+    const SignalFloatContext64 &float_context,
-+    const SignalVectorContext64 &vector_context,
-+    typename Traits::CPUContext* context) {
-+
-+  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
-+  context->nip = thread_context.nip;
-+  context->msr = thread_context.msr;
-+  context->ccr = thread_context.ccr;
-+  context->xer = thread_context.xer;
-+  context->lnk = thread_context.lnk;
-+  context->ctr = thread_context.ctr;
-+
-+  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
-+  context->fpscr = float_context.fpscr;
-+
-+  for (uint8_t i = 0; i < 32; i++) {
-+    context->vregs.save_vr[i] = {
-+      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
-+        vector_context.vrregs[i][1],
-+      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
-+        vector_context.vrregs[i][3]
-+    };
-+  }
-+  context->vregs.save_vrsave = vector_context.vrsave;
-+  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
-+}
-+
-+
-+#endif
-+
- }  // namespace internal
- }  // namespace crashpad
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
-@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
-           const bool is_vdso_mapping =
-               device == 0 && inode == 0 && mapping_name == "[vdso]";
-           static constexpr char kPrefix[] = "linux-vdso.so.";
-+          static constexpr char kPrefix64[] = "linux-vdso64.so.";
-           return is_vdso_mapping ==
-                  (module_name.empty() ||
--                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
-+                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
-+                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
-         },
-         module_mapping->name,
-         module_mapping->device,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
-@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-       reader, context_address, context_.mips64);
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+template <typename Traits>
-+static bool ReadContext(ProcessReaderLinux* reader,
-+                        LinuxVMAddress context_address,
-+                        typename Traits::CPUContext* dest_context) {
-+  const ProcessMemory* memory = reader->Memory();
-+
-+  LinuxVMAddress gp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, gp_regs);
-+
-+  typename Traits::SignalThreadContext thread_context;
-+  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
-+    LOG(ERROR) << "Couldn't read gp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress fp_regs_address = context_address +
-+                                   offsetof(UContext, mcontext) +
-+                                   offsetof(typename Traits::MContext, fp_regs);
-+
-+  typename Traits::SignalFloatContext fp_context;
-+  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
-+    LOG(ERROR) << "Couldn't read fp_regs!";
-+    return false;
-+  }
-+
-+  LinuxVMAddress v_regs_ptr_address = context_address +
-+                                  offsetof(UContext, mcontext) +
-+                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
-+
-+  typename Traits::SignalVectorContext v_context;
-+  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
-+    LOG(ERROR) << "Couldn't read v_regs!";
-+    return false;
-+  }
-+
-+  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
-+                            v_context, dest_context);
-+
-+  return true;
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+
-+  return internal::ReadContext<ContextTraits64>(
-+      reader, context_address, context_.ppc64);
-+}
-+
-+template<>
-+bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
-+    ProcessReaderLinux* reader,
-+    LinuxVMAddress context_address) {
-+  // PPC64 is 64-bit
-+  return false;
-+}
-+
- #endif  // ARCH_CPU_X86_FAMILY
- 
- bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
-@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #endif
-   } context_union_;
-   CPUContext context_;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
-@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-             0);
- #undef CPU_ARCH_NAME
- }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+using NativeCPUContext = ucontext_t;
-+
-+void InitializeContext(NativeCPUContext* context) {
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    context->uc_mcontext.gp_regs[reg] = reg;
-+  }
-+
-+  memset(&context->uc_mcontext.fp_regs, 44,
-+      sizeof(context->uc_mcontext.fp_regs));
-+}
- 
-+void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
-+  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
-+
-+  for (size_t reg = 0; reg < 32; ++reg) {
-+    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
-+  }
-+
-+  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
-+            sizeof(actual.ppc64->fpregs)), 0);
-+}
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
-@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
-                                     : thread_info.thread_context.t32.regs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  stack_pointer = thread_info.thread_context.t64.gpr[1];
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
-@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
-   module.ehdr.e_machine = EM_AARCH64;
- #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
-   module.ehdr.e_machine = EM_MIPS;
-+#elif defined(ARCH_CPU_PPC64)
-+  module.ehdr.e_machine = EM_PPC64;
- #endif
- 
-   module.ehdr.e_version = EV_CURRENT;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
-@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
-               "context offset mismatch");
- #endif
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+
-+struct SignalThreadContext64 {
-+  uint64_t regs[32];
-+  uint64_t nip;
-+  uint64_t msr;
-+  uint64_t orig_r3;
-+  uint64_t ctr;
-+  uint64_t lnk;
-+  uint64_t xer;
-+  uint64_t ccr;
-+  uint64_t softe;
-+  uint64_t trap;
-+  uint64_t dar;
-+  uint64_t dsisr;
-+  uint64_t result;
-+  uint64_t dscr;
-+  uint64_t fpr0[3];
-+};
-+
-+struct SignalFloatContext64 {
-+  double regs[32];
-+  double fpscr;
-+};
-+
-+struct SignalVectorContext64 {
-+  int32_t vrregs[32][4];
-+  struct {
-+    int32_t __pad[3];
-+    int32_t vscr_word;
-+  } vscr;
-+  int32_t vrsave;
-+  int32_t __pad[3];
-+} __attribute__((__aligned__(16)));
-+
-+
-+#pragma pack(pop)
-+struct MContext64 {
-+  uint64_t reserved[4];
-+  int32_t signal;
-+  int32_t __pad0;
-+  uint64_t handler;
-+  uint64_t oldmask;
-+  uint64_t pt_regs_ptr;
-+  SignalThreadContext64 gp_regs;
-+  SignalFloatContext64  fp_regs;
-+  SignalVectorContext64 *v_regs;
-+  int64_t vmx_reserve[69];
-+};
-+
-+struct ContextTraits64 : public Traits64 {
-+  using MContext = MContext64;
-+  using SignalThreadContext = SignalThreadContext64;
-+  using SignalFloatContext = SignalFloatContext64;
-+  using SignalVectorContext = SignalVectorContext64;
-+  using CPUContext = CPUContextPPC64;
-+};
-+
-+struct ContextTraits32 : public Traits32 {};
-+
-+struct UContext {
-+  uint64_t flags;
-+  uint64_t link;
-+  SignalStack<ContextTraits64> stack;
-+  Sigset<ContextTraits64> sigmask;
-+  MContext64 mcontext;
-+};
-+#pragma pack(push, 1)
-+
-+static_assert(sizeof(UContext) == sizeof(ucontext_t),
-+              "ucontext_t size mismatch");
-+static_assert(sizeof(MContext64) == sizeof(mcontext_t),
-+              "mcontext_t size mismatch");
-+static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
-+              "gregset_t size mismatch");
-+static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
-+              "fpregset_t size mismatch");
-+static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
-+              "vrstate size mismatch");
-+static_assert(offsetof(UContext, mcontext) ==
-+              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
-+static_assert(offsetof(MContext64, gp_regs) ==
-+              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
-@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
-                                     : kCPUArchitectureMIPSEL;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return kCPUArchitecturePPC64;
- #else
- #error port to your architecture
- #endif
-@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return 0;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return 0;
- #else
- #error port to your architecture
- #endif
-@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return std::string();
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return std::string();
- #else
- #error port to your architecture
- #endif
-@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   // Not implementable on MIPS
-   return false;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  // Not yet implemented on PPC64
-+  return false;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
-@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
-         thread.thread_info.float_context.f32,
-         context_.mipsel);
-   }
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  context_.architecture = kCPUArchitecturePPC64;
-+  context_.ppc64 = &context_union_.ppc64;
-+  InitializeCPUContextPPC64<ContextTraits64>(
-+      thread.thread_info.thread_context.t64,
-+      thread.thread_info.float_context.f64,
-+      thread.thread_info.vector_context.v64,
-+      context_.ppc64);
- #else
- #error Port.
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
-@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-     CPUContextMIPS mipsel;
-     CPUContextMIPS64 mips64;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    CPUContextPPC64 ppc64;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
-@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
-     if (type == AT_IGNORE) {
-       continue;
-     }
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    if (type == AT_IGNOREPPC) {
-+      continue;
-+    }
-+#endif
-     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
-       LOG(ERROR) << "duplicate auxv entry";
-       return false;
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
-@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
- }
- 
- bool PtraceBroker::AllocateAttachments() {
--  constexpr size_t page_size = 4096;
--  constexpr size_t alloc_size =
-+  static size_t page_size = getpagesize();
-+  size_t alloc_size =
-       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
-   void* alloc = sbrk(alloc_size);
-   if (reinterpret_cast<intptr_t>(alloc) == -1) {
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
-   return true;
- }
- 
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
-+// That means we can simply use PTRACE_GETREGESET.
-+
-+template <typename Destination>
-+bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
-+  iovec iov;
-+  iov.iov_base = reinterpret_cast<void*>(dest);
-+  iov.iov_len = sizeof(*dest);
-+  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
-+    PLOG_IF(ERROR, can_log) << "ptrace";
-+    return false;
-+  }
-+  if (iov.iov_len != sizeof(*dest)) {
-+    LOG_IF(ERROR, can_log) << "Unexpected registers size";
-+    return false;
-+  }
-+  return true;
-+}
-+
-+bool GetVectorRegisters64(pid_t tid,
-+                          VectorContext* context,
-+                          bool can_log) {
-+  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
-+}
-+
-+bool GetFloatingPointRegisters64(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) {
-+  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
-+}
-+
-+bool GetThreadArea64(pid_t tid,
-+                     const ThreadContext& context,
-+                     LinuxVMAddress* address,
-+                     bool can_log) {
-+  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
-+  // is stored in GPR 13.
-+  ThreadContext::t64_t tc;
-+  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
-+    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
-+    return false;
-+  }
-+
-+  *address = tc.gpr[13];
-+
-+  return true;
-+}
-+
-+// Stubs for 32-bit functions not applicable on PPC64
-+bool GetFloatingPointRegisters32(pid_t tid,
-+                                 FloatContext* context,
-+                                 bool can_log) { return false; }
-+bool GetThreadArea32(pid_t tid,
-+                     const ThreadContext &context,
-+                     LinuxVMAddress *address,
-+                     bool can_log) { return false; }
-+
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
-   if (is_64_bit_) {
-     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
-            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
-+#endif
-            GetThreadArea64(tid,
-                            info->thread_context,
-                            &info->thread_specific_data_address,
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -28,6 +28,10 @@
- #include <android/api-level.h>
- #endif
- 
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+#include <sys/ucontext.h>
-+#endif
-+
- namespace crashpad {
- 
- //! \brief The set of general purpose registers for an architecture family.
-@@ -79,6 +83,8 @@ union ThreadContext {
-     uint32_t cp0_status;
-     uint32_t cp0_cause;
-     uint32_t padding1_;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // PPC64 is 64-bit
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -132,6 +138,21 @@ union ThreadContext {
-     uint64_t cp0_badvaddr;
-     uint64_t cp0_status;
-     uint64_t cp0_cause;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects struct pt_regs in asm/ptrace.h.
-+    uint64_t gpr[32];
-+    uint64_t nip;
-+    uint64_t msr;
-+    uint64_t orig_gpr3;
-+    uint64_t ctr;
-+    uint64_t lnk;
-+    uint64_t xer;
-+    uint64_t ccr;
-+    uint64_t softe;
-+    uint64_t trap;
-+    uint64_t dar;
-+    uint64_t dsisr;
-+    uint64_t result;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -143,6 +164,8 @@ union ThreadContext {
-   using NativeThreadContext = user_regs;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate NativeThreadsContext type available for MIPS
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  using NativeThreadContext = struct pt_regs;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
-@@ -218,6 +241,9 @@ union FloatContext {
-     } fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Crashpad's PPC support is 64-bit only, so this
-+    // 32bit-only struct is declared as empty.
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -252,6 +278,10 @@ union FloatContext {
-     double fpregs[32];
-     uint32_t fpcsr;
-     uint32_t fpu_id;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects fpregset_t in sys/ucontext.h
-+    double fpregs[32];
-+    double fpscr;
- #else
- #error Port.
- #endif  // ARCH_CPU_X86_FAMILY
-@@ -280,6 +310,8 @@ union FloatContext {
-   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
- #elif defined(ARCH_CPU_MIPS_FAMILY)
- // No appropriate floating point context native type for available MIPS.
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
- #else
- #error Port.
- #endif  // ARCH_CPU_X86
-@@ -287,6 +319,26 @@ union FloatContext {
- static_assert(std::is_standard_layout<FloatContext>::value,
-               "Not standard layout");
- 
-+//! \brief The vector registers used for an architecture family
-+union VectorContext {
-+  struct v32_t {} v32;
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
-+#endif
-+  struct v64_t {
-+#if defined(ARCH_CPU_PPC64_FAMILY)
-+    // Reflects vrregset_t in sys/ucontext.h
-+    uint32_t vrregs[32][4];
-+    struct {
-+      uint32_t __pad[3];
-+      uint32_t vscr_word;
-+    } vscr;
-+    uint32_t vrsave;
-+    uint32_t __pad[3];
-+#endif
-+  } v64;
-+};
-+
- //! \brief A collection of `ptrace`-able information about a thread.
- struct ThreadInfo {
-   ThreadInfo();
-@@ -298,6 +350,9 @@ struct ThreadInfo {
-   //! \brief The floating point registers for the thread.
-   FloatContext float_context;
- 
-+  //! \brief (Optional) The vector registers used for the thread.
-+  VectorContext vector_context;
-+
-   //! \brief The thread-local storage address for the thread.
-   LinuxVMAddress thread_specific_data_address;
- };
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
-@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
- //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
- //!     Linux               | ARM/ARM64    | `r0`/`x0`
- //!     Linux               | MIPS/MIPS64  | `$a0`
-+//!     Linux               | PPC64        | `r3`
- //!
- //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
- //!     this function.
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
-@@ -28,7 +28,7 @@
-   .globl CAPTURECONTEXT_SYMBOL2
- #if defined(__i386__) || defined(__x86_64__)
-   .balign 16, 0x90
--#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
-+#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
-   .balign 4, 0x0
- #endif
- 
-@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
-   jr $ra
- 
-   .set at
-+#elif defined(__powerpc64__)
-+  // Store r0-r31
-+  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
-+  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
-+  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
-+  // note that r3's original value was lost
-+  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
-+  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
-+  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
-+  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
-+  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
-+  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
-+  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
-+  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
-+  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
-+  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
-+  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
-+  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
-+  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
-+  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
-+  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
-+  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
-+  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
-+  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
-+  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
-+  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
-+  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
-+  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
-+  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
-+  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
-+  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
-+  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
-+  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
-+  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
-+  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
-+
-+  // For NIP, we can use the value in the link register
-+  mflr 0
-+  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
-+
-+  // CTR
-+  mfctr 0
-+  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
-+
-+  // For LNK, we'll use the caller's LR save area (2 stack frames up).
-+  // r4 can be used as a scratch register since it has already been saved.
-+  ld 4, 0(1)
-+  ld 4, 16(4)
-+  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
-+
-+  // XER
-+  mfxer 0
-+  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
-+
-+  // CCR
-+  mfcr 0
-+  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
-+
-+  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
-+  // not used or not relevant,  zero them out.
-+  li 4, 0
-+  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
-+  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
-+  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
-+  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
-+  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
-+  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
-+  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
-+  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
-+
-+  // Update context->uc_mcontext.regs to point to gp_regs
-+  addi 0, 3, 0xe8
-+  std 0, 0xe0(3)
-+
-+  // Save floating point registers 0-31
-+  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
-+  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
-+  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
-+  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
-+  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
-+  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
-+  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
-+  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
-+  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
-+  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
-+  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
-+  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
-+  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
-+  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
-+  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
-+  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
-+  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
-+  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
-+  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
-+  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
-+  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
-+  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
-+  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
-+  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
-+  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
-+  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
-+  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
-+  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
-+  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
-+  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
-+  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
-+  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
-+
-+  // FPSCR
-+  mffs 0
-+  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
-+
-+  // Save VMX Vector registers
-+  // Update r4 to contain the base address of vmx_reserve
-+  addi 4, 3, 0x378
-+  // Ensure that it is quadword aligned
-+  andi. 5, 4, 0xF
-+  beq 1f // No alignment is necessary
-+  // Address is doubleword aligned and not quadword aligned, add 8
-+  addi 4, 4, 8
-+
-+1:
-+  // Store VMX registers 0-31
-+  // r4 will contain the base address
-+  // r5 will contain the index
-+  li 5, 0
-+  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
-+  addi 5, 5, 16
-+  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
-+  addi 5, 5, 16
-+  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
-+  addi 5, 5, 16
-+  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
-+  addi 5, 5, 16
-+  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
-+  addi 5, 5, 16
-+  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
-+  addi 5, 5, 16
-+  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
-+  addi 5, 5, 16
-+  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
-+  addi 5, 5, 16
-+  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
-+  addi 5, 5, 16
-+  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
-+  addi 5, 5, 16
-+  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
-+  addi 5, 5, 16
-+  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
-+  addi 5, 5, 16
-+  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
-+  addi 5, 5, 16
-+  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
-+  addi 5, 5, 16
-+  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
-+  addi 5, 5, 16
-+  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
-+  addi 5, 5, 16
-+  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
-+  addi 5, 5, 16
-+  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
-+  addi 5, 5, 16
-+  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
-+  addi 5, 5, 16
-+  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
-+  addi 5, 5, 16
-+  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
-+  addi 5, 5, 16
-+  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
-+  addi 5, 5, 16
-+  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
-+  addi 5, 5, 16
-+  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
-+  addi 5, 5, 16
-+  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
-+  addi 5, 5, 16
-+  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
-+  addi 5, 5, 16
-+  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
-+  addi 5, 5, 16
-+  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
-+  addi 5, 5, 16
-+  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
-+  addi 5, 5, 16
-+  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
-+  addi 5, 5, 16
-+  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
-+  addi 5, 5, 16
-+  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
-+  addi 5, 5, 16
-+
-+  // VSCR
-+  mfvscr 0
-+  stvx 0, 4, 5
-+  addi 5, 5, 16
-+
-+  // VRSAVE
-+  mfvrsave 0
-+  stwx 0, 4, 5
-+
-+  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
-+  std 4, 0x370(3)
-+
-+  // Zero out all unused fields
-+  li 4, 0
-+  std 4, 0xc8(3) // context->uc_mcontext.signal
-+  std 4, 0xd0(3) // context->uc_mcontext.handler
-+  std 4, 0xd8(3) // context->uc_mcontext.oldmask
-+
-+  blr
- #endif  // __i386__
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
-@@ -49,7 +49,8 @@ void TestCaptureContext() {
-   // reference program counter.
-   uintptr_t pc = ProgramCounterFromContext(context_1);
- 
--#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY)
-+#if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
-+    !defined(ARCH_CPU_PPC64_FAMILY)
-   // AddressSanitizer can cause enough code bloat that the “nearby” check would
-   // likely fail.
-   const uintptr_t kReferencePC =
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
-@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
-   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
- #endif
- }
- 
-@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.pc;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.pc;
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[PT_NIP];
- #endif
- }
- 
-@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
-   return context.uc_mcontext.sp;
- #elif defined(ARCH_CPU_MIPS_FAMILY)
-   return context.uc_mcontext.gregs[29];
-+#elif defined(ARCH_CPU_PPC64_FAMILY)
-+  return context.uc_mcontext.gp_regs[1];
- #endif
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
-@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
-   return sig == SIGABRT ||
-          sig == SIGALRM ||
-          sig == SIGBUS ||
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-          sig == SIGFPE ||
--#endif  // !defined(ARCH_CPU_ARM64)
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGILL ||
--#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
-+#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-          sig == SIGPIPE ||
-          sig == SIGSEGV ||
- #if defined(OS_MACOSX)
-@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
-       break;
-     }
- 
--#if !defined(ARCH_CPU_ARM64)
-+#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
-     // ARM64 has hardware integer division instructions that don’t generate a
-     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
-+    //
-+    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
-     case SIGFPE: {
-       // Optimization makes this tricky, so get zero from a system call likely
-       // to succeed, and try to do something with the result.
-@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
-       fstat(quotient, &stat_buf);
-       break;
-     }
--#endif  // ARCH_CPU_ARM64
-+#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
- 
- #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
-     case SIGILL: {
---- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
-@@ -93,6 +93,11 @@ source_set("libpng_sources") {
-       "mips/filter_msa_intrinsics.c",
-       "mips/mips_init.c",
-     ]
-+  } else if (current_cpu == "ppc64") {
-+    sources += [
-+      "powerpc/filter_vsx_intrinsics.c",
-+      "powerpc/powerpc_init.c",
-+    ]
-   }
- 
-   configs -= [ "//build/config/compiler:chromium_code" ]
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
-@@ -0,0 +1,767 @@
-+/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+#include <stdio.h>
-+#include <stdint.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+/* This code requires -maltivec and -mvsx on the command line: */
-+#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
-+
-+#include <altivec.h>
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+
-+#ifndef __VSX__
-+#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
-+#endif
-+
-+#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
-+#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
-+
-+
-+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
-+ * They're positioned like this:
-+ *    prev:  c b
-+ *    row:   a d
-+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
-+ * whichever of a, b, or c is closest to p=a+b-c.
-+ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
-+ */
-+
-+#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
-+   png_byte i;\
-+   png_bytep rp = row + offset;\
-+   png_const_bytep pp = prev_row;\
-+   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
-+   png_size_t istop;\
-+   if(unaligned_top == 16)\
-+      unaligned_top = 0;\
-+   istop = row_info->rowbytes;\
-+   if((unaligned_top < istop))\
-+      istop -= unaligned_top;\
-+   else{\
-+      unaligned_top = istop;\
-+      istop = 0;\
-+   }
-+
-+void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
-+                                png_const_bytep prev_row)
-+{
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vsx_declare_common_vars(row_info,row,prev_row,0)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      rp_vec = vec_add(rp_vec,pp_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      pp += 16;
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+   {
-+      /* If byte count of row is not divisible by 16
-+       * we will process remaining part as usual
-+       */
-+      for (i = 0; i < istop; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+}
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
-+
-+static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
-+static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
-+
-+static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
-+static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
-+
-+static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-+#ifdef __LITTLE_ENDIAN__
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
-+
-+#elif defined(__BIG_ENDIAN__)
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
-+
-+static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
-+
-+static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
-+static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
-+
-+#endif
-+
-+#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
-+#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
-+
-+#ifdef PNG_USE_ABS
-+#  define vsx_abs(number) abs(number)
-+#else
-+#  define vsx_abs(number) (number > 0) ? (number) : -(number)
-+#endif
-+
-+void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
-+         rp++;
-+      }
-+
-+}
-+
-+void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 3;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char part_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+
-+   PNG_UNUSED(pp)
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+      rp -= bpp;
-+
-+      rp_vec = vec_ld(0,rp);
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+      rp_vec = vec_add(rp_vec,part_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+      rp += 15;
-+      istop -= 16;
-+
-+      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+       * be proceeded manually
-+       */
-+      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+      rp++;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned char pp_part_vec;
-+   vector unsigned char rp_part_vec;
-+   vector unsigned char avg_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   for (i = 0; i < bpp; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         ((int)(*pp++) / 2 )) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Altivec operations require 16-byte aligned data
-+    * but input can be unaligned. So we calculate
-+    * unaligned part as usual.
-+    */
-+   for (i = 0; i < unaligned_top; i++)
-+   {
-+      *rp = (png_byte)(((int)(*rp) +
-+         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+      rp++;
-+   }
-+
-+   /* Using SIMD while we can */
-+   while( istop >= 16 )
-+   {
-+      for(i=0;i < bpp ; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+      rp -= bpp;
-+      pp -= bpp;
-+
-+      vec_ld_unaligned(pp_vec,pp);
-+      rp_vec = vec_ld(0,rp);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
-+      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
-+      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+      rp_vec = vec_add(rp_vec,avg_vec);
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop  > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         *rp = (png_byte)(((int)(*rp) +
-+            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+         rp++;
-+      }
-+}
-+
-+void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
-+                                  png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned char pp_part_vec;
-+  vector unsigned char rp_part_vec;
-+  vector unsigned char avg_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  for (i = 0; i < bpp; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        ((int)(*pp++) / 2 )) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Altivec operations require 16-byte aligned data
-+   * but input can be unaligned. So we calculate
-+   * unaligned part as usual.
-+   */
-+  for (i = 0; i < unaligned_top; i++)
-+  {
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+     rp++;
-+  }
-+
-+  /* Using SIMD while we can */
-+  while( istop >= 16 )
-+  {
-+     for(i=0;i < bpp ; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+     rp -= bpp;
-+     pp -= bpp;
-+
-+     vec_ld_unaligned(pp_vec,pp);
-+     rp_vec = vec_ld(0,rp);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
-+     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
-+     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
-+     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
-+     rp_vec = vec_add(rp_vec,avg_vec);
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     *rp = (png_byte)(((int)(*rp) +
-+        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+     rp++;
-+  }
-+
-+  if(istop  > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        *rp = (png_byte)(((int)(*rp) +
-+           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
-+
-+        rp++;
-+     }
-+}
-+
-+/* Bytewise c ? t : e. */
-+#define if_then_else(c,t,e) vec_sel(e,t,c)
-+
-+#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
-+      c = *(pp - bpp);\
-+      a = *(rp - bpp);\
-+      b = *pp++;\
-+      p = b - c;\
-+      pc = a - c;\
-+      pa = vsx_abs(p);\
-+      pb = vsx_abs(pc);\
-+      pc = vsx_abs(p + pc);\
-+      if (pb < pa) pa = pb, a = b;\
-+      if (pc < pa) a = c;\
-+      a += *rp;\
-+      *rp++ = (png_byte)a;\
-+      }
-+
-+void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+   const png_byte bpp = 4;
-+
-+   int a, b, c, pa, pb, pc, p;
-+   vector unsigned char rp_vec;
-+   vector unsigned char pp_vec;
-+   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+   vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+   rp -= bpp;
-+   if(istop >= bpp)
-+      istop -= bpp;
-+
-+   /* Process the first pixel in the row completely (this is the same as 'up'
-+    * because there is only one candidate predictor for the first row).
-+    */
-+   for(i = 0; i < bpp ; i++)
-+   {
-+      *rp = (png_byte)( *rp + *pp);
-+      rp++;
-+      pp++;
-+   }
-+
-+   for(i = 0; i < unaligned_top ; i++)
-+   {
-+      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+   }
-+
-+   while( istop >= 16)
-+   {
-+      for(i = 0; i < bpp ; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+
-+      rp -= bpp;
-+      pp -= bpp;
-+      rp_vec = vec_ld(0,rp);
-+      vec_ld_unaligned(pp_vec,pp);
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
-+
-+      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
-+      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
-+      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+      pc_vec = vec_add(pa_vec,pb_vec);
-+      pa_vec = vec_abs(pa_vec);
-+      pb_vec = vec_abs(pb_vec);
-+      pc_vec = vec_abs(pc_vec);
-+      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+      nearest_vec =  if_then_else(
-+            vec_cmpeq(pa_vec,smallest_vec),
-+            a_vec,
-+            if_then_else(
-+              vec_cmpeq(pb_vec,smallest_vec),
-+              b_vec,
-+              c_vec
-+              )
-+            );
-+      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
-+
-+      vec_st(rp_vec,0,rp);
-+
-+      rp += 16;
-+      pp += 16;
-+      istop -= 16;
-+   }
-+
-+   if(istop > 0)
-+      for (i = 0; i < istop % 16; i++)
-+      {
-+         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+      }
-+}
-+
-+void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
-+   png_const_bytep prev_row)
-+{
-+  const png_byte bpp = 3;
-+
-+  int a, b, c, pa, pb, pc, p;
-+  vector unsigned char rp_vec;
-+  vector unsigned char pp_vec;
-+  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
-+  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
-+
-+  vsx_declare_common_vars(row_info,row,prev_row,bpp)
-+  rp -= bpp;
-+  if(istop >= bpp)
-+     istop -= bpp;
-+
-+  /* Process the first pixel in the row completely (this is the same as 'up'
-+   * because there is only one candidate predictor for the first row).
-+   */
-+  for(i = 0; i < bpp ; i++)
-+  {
-+     *rp = (png_byte)( *rp + *pp);
-+     rp++;
-+     pp++;
-+  }
-+
-+  for(i = 0; i < unaligned_top ; i++)
-+  {
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  while( istop >= 16)
-+  {
-+     for(i = 0; i < bpp ; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+
-+     rp -= bpp;
-+     pp -= bpp;
-+     rp_vec = vec_ld(0,rp);
-+     vec_ld_unaligned(pp_vec,pp);
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
-+
-+     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
-+     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
-+     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
-+     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
-+     pc_vec = vec_add(pa_vec,pb_vec);
-+     pa_vec = vec_abs(pa_vec);
-+     pb_vec = vec_abs(pb_vec);
-+     pc_vec = vec_abs(pc_vec);
-+     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
-+     nearest_vec =  if_then_else(
-+           vec_cmpeq(pa_vec,smallest_vec),
-+           a_vec,
-+           if_then_else(
-+             vec_cmpeq(pb_vec,smallest_vec),
-+             b_vec,
-+             c_vec
-+             )
-+           );
-+     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
-+
-+     vec_st(rp_vec,0,rp);
-+
-+     rp += 15;
-+     pp += 15;
-+     istop -= 16;
-+
-+     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
-+      * be proceeded manually
-+      */
-+     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+  }
-+
-+  if(istop > 0)
-+     for (i = 0; i < istop % 16; i++)
-+     {
-+        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
-+     }
-+}
-+
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
-+#endif /* READ */
-new file mode 100644
---- /dev/null
-+++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
-@@ -0,0 +1,125 @@
-+
-+/* powerpc_init.c - POWERPC optimised filter functions
-+ *
-+ * Copyright (c) 2017 Glenn Randers-Pehrson
-+ * Written by Vadim Barkov, 2017.
-+ * Last changed in libpng 1.6.29 [March 16, 2017]
-+ *
-+ * This code is released under the libpng license.
-+ * For conditions of distribution and use, see the disclaimer
-+ * and license in png.h
-+ */
-+/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
-+ * called.
-+ */
-+#define _POSIX_SOURCE 1
-+
-+#include <stdio.h>
-+#include "../pngpriv.h"
-+
-+#ifdef PNG_READ_SUPPORTED
-+
-+#if PNG_POWERPC_VSX_OPT > 0
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
-+/* WARNING: it is strongly recommended that you do not build libpng with
-+ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
-+ * VSX instructions there is no processor-specific way of detecting the
-+ * presence of the required support, therefore run-time detection is extremely
-+ * OS specific.
-+ *
-+ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
-+ * a fragment of C source code which defines the png_have_vsx function.  There
-+ * are a number of implementations in contrib/powerpc-vsx, but the only one that
-+ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
-+ * implementation which reads /proc/cpufino.
-+ */
-+#ifndef PNG_POWERPC_VSX_FILE
-+#  ifdef __linux__
-+#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
-+#  endif
-+#endif
-+
-+#ifdef PNG_POWERPC_VSX_FILE
-+
-+#include <signal.h> /* for sig_atomic_t */
-+static int png_have_vsx(png_structp png_ptr);
-+#include PNG_POWERPC_VSX_FILE
-+
-+#else  /* PNG_POWERPC_VSX_FILE */
-+#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
-+#endif /* PNG_POWERPC_VSX_FILE */
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+void
-+png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
-+{
-+   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
-+    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
-+    * the check is only performed if the API has not set the PowerPC option on
-+    * or off explicitly. In this case the check controls what happens.
-+    */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
-+   {
-+      case PNG_OPTION_UNSET:
-+         /* Allow the run-time check to execute if it has been enabled -
-+          * thus both API and CHECK can be turned on.  If it isn't supported
-+          * this case will fall through to the 'default' below, which just
-+          * returns.
-+          */
-+#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
-+#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
-+         {
-+            static volatile sig_atomic_t no_vsx = -1; /* not checked */
-+
-+            if (no_vsx < 0)
-+               no_vsx = !png_have_vsx(pp);
-+
-+            if (no_vsx)
-+               return;
-+         }
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+         break;
-+#endif
-+#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
-+
-+#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-+      default: /* OFF or INVALID */
-+         return;
-+
-+      case PNG_OPTION_ON:
-+         /* Option turned on */
-+         break;
-+   }
-+#endif
-+
-+   /* IMPORTANT: any new internal functions used here must be declared using
-+    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
-+    * 'prefix' option to configure works:
-+    *
-+    *    ./configure --with-libpng-prefix=foobar_
-+    *
-+    * Verify you have got this right by running the above command, doing a build
-+    * and examining pngprefix.h; it must contain a #define for every external
-+    * function you add.  (Notice that this happens automatically for the
-+    * initialization function.)
-+    */
-+   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
-+
-+   if (bpp == 3)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
-+   }
-+
-+   else if (bpp == 4)
-+   {
-+      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
-+      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
-+   }
-+}
-+#endif /* PNG_POWERPC_VSX_OPT > 0 */
-+#endif /* READ */
---- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
-@@ -3914,7 +3914,7 @@ struct kernel_statfs {
-       LSS_REG(2, buf);
-       LSS_BODY(void*, mmap2, "0"(__r2));
-     }
--#else
-+#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
-     #define __NR__mmap2 __NR_mmap2
-     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
-                          size_t,                   l, int,               p,
-@@ -4045,7 +4045,7 @@ struct kernel_statfs {
-   #if defined(__i386__) ||                                                    \
-       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
-      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
--      defined(__PPC__) ||                                                     \
-+     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
-      (defined(__s390__) && !defined(__s390x__))
-     /* On these architectures, implement mmap() with mmap2(). */
-     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
---- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-+++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
-@@ -10,11 +10,12 @@ import sys
- 
- 
- def GetBinaryPath():
--  return os_path.join(os_path.dirname(__file__), *{
--    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
--    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
--    'Windows': ('win', 'node.exe'),
--  }[platform.system()])
-+  return "/usr/bin/node"
-+  #return os_path.join(os_path.dirname(__file__), *{
-+  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
-+  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
-+  #  'Windows': ('win', 'node.exe'),
-+  #}[platform.system()])
- 
- 
- def RunNode(cmd_parts, stdout=None):
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
-@@ -11,7 +11,7 @@
- 
- namespace pdfium {
- namespace base {
--#if defined(OS_WIN)
-+#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
- static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
- #elif defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
-@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
- 
- #if defined(_MIPS_ARCH_LOONGSON)
- static constexpr size_t kSystemPageSize = 16384;
-+#elif defined(ARCH_CPU_PPC64)
-+// TODO: modern ppc64 can do 4k and 64k page sizes
-+// for now, 64k is assumed
-+static constexpr size_t kSystemPageSize = 65536;
- #else
- static constexpr size_t kSystemPageSize = 4096;
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
-@@ -33,6 +33,8 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2;
- // up against the end of a system page.
- #if defined(_MIPS_ARCH_LOONGSON)
- static const size_t kPartitionPageShift = 16;  // 64KB
-+#elif defined(ARCH_CPU_PPC64)
-+static const size_t kPartitionPageShift = 18;  // 256KB
- #else
- static const size_t kPartitionPageShift = 14;  // 16KB
- #endif
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
-@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/src/src/sqliteInt.h
-@@ -833,7 +833,8 @@ typedef INT16_TYPE LogEst;
- # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
-      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
-      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
--     defined(__arm__)  || defined(_M_ARM64)
-+     defined(__arm__)  || defined(_M_ARM64)   || defined(__powerpc64__) && \
-+     (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #   define SQLITE_BYTEORDER    1234
- # elif defined(sparc)    || defined(__ppc__)
- #   define SQLITE_BYTEORDER    4321
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
-@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
--    // For ARM and MIPS processors, always use C version.
--    // TODO(hclam): Implement a NEON version.
--    diff_proc = &VectorDifference_C;
--#else
-+#if defined(WEBRTC_ARCH_X86_FAMILY)
-     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
-     // For x86 processors, check if SSE2 is supported.
-     if (have_sse2 && kBlockSize == 32) {
-@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-     } else {
-       diff_proc = &VectorDifference_C;
-     }
-+#else
-+    // For other processors, always use C version.
-+    // TODO(hclam): Implement a NEON version.
-+    diff_proc = &VectorDifference_C;
- #endif
-   }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
-@@ -47,6 +47,18 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__PPC__)
-+#define WEBRTC_ARCH_PPC_FAMILY
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #else
- #error Please add support for your architecture in typedefs.h
- #endif
---- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
-@@ -544,6 +544,12 @@ config("toolchain") {
-     }
-     if (host_byteorder == "little") {
-       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
-+        cflags += [
-+        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
-+        "-mcpu=power8",
-+        "-maltivec",
-+        "-mvsx",
-+      ]
-     } else if (host_byteorder == "big") {
-       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
-       if (current_os == "aix") {
---- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
-@@ -31,7 +31,7 @@ group("gn_all") {
-     deps += [
-       "cctest:cctest",
-       "cctest:generate-bytecode-expectations",
--      "unittests:unittests",
-+      #"unittests:unittests",
-     ]
-   }
- }
-@@ -80,9 +80,9 @@ group("v8_bot_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
-+    #"unittests:unittests",
-     "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-     "webkit:v8_webkit",
-   ]
- }
-@@ -100,9 +100,9 @@ group("v8_default") {
-     "mjsunit:v8_mjsunit",
-     "mkgrokdump:mkgrokdump",
-     "preparser:v8_preparser",
--    "unittests:unittests",
--    "wasm-js:v8_wasm_js",
--    "wasm-spec-tests:v8_wasm_spec_tests",
-+    #"unittests:unittests",
-+    #"wasm-js:v8_wasm_js",
-+    #"wasm-spec-tests:v8_wasm_spec_tests",
-   ]
- }
- 
diff --git a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch b/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
deleted file mode 100644
index df014d8b598..00000000000
--- a/srcpkgs/qt5/patches/0091-chromium-ppc64-musl.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-This includes additional build fixes for the musl libc.
-
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -11,12 +11,14 @@
- // All x86_64 builds use a new enough bionic to have sys/user.h.
- #if !defined(__BIONIC__) || defined(__x86_64__)
- #if !defined(__native_client_nonsfi__)
-+#if !defined(__powerpc64__) || defined(__GLIBC__)
- #include <sys/user.h>
- #endif
-+#endif
- #if defined(__mips__)
- // sys/user.h in eglibc misses size_t definition
- #include <stddef.h>
--#elif defined(__powerpc64__)
-+#elif defined(__powerpc64__) && defined(__GLIBC__)
- // Manually define greg_t on ppc64
- typedef unsigned long long greg_t;
- #endif
-@@ -361,11 +363,11 @@ typedef struct pt_regs regs_struct;
- #define SECCOMP_ARCH AUDIT_ARCH_PPC64
- #endif
- 
--#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
-+#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg])
- 
- #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
--#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
-+#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip
- #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
- #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
- #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
-@@ -497,9 +497,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
-   // Same as MIPS, need to invert ret and set error register (cr0.SO)
-   if (ret_val <= -1 && ret_val >= -4095) {
-     ret_val = -ret_val;
--    ctx->uc_mcontext.regs->ccr |= (1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28);
-   } else {
--    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
-+    ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28);
-   }
- #endif
-   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc
-@@ -20,7 +20,7 @@
- #include <intrin.h>
- #endif
- 
--#if defined(__powerpc__) || defined(__ppc__)
-+#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- #include <sys/platform/ppc.h>
- #endif
- 
-@@ -53,7 +53,7 @@ double UnscaledCycleClock::Frequency() {
-   return base_internal::NominalCPUFrequency();
- }
- 
--#elif defined(__powerpc__) || defined(__ppc__)
-+#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
- 
- int64_t UnscaledCycleClock::Now() {
-   return __ppc_get_timebase();
---- qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-@@ -46,7 +46,7 @@
- 
- // The following platforms have an implementation of a hardware counter.
- #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
--  defined(__powerpc__) || defined(__ppc__) || \
-+  ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
-   defined(_M_IX86) || defined(_M_X64)
- #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
- #else
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
-@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t ThreadInfo::GetInstructionPointer() const {
-     return mcontext.gp_regs[PT_NIP];
- }
-@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-     out->ctr = mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] = \
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- 
- #elif defined(__powerpc64__)
- 
-+#include <asm/elf.h>
-+#include <asm/ptrace.h>
-+
- uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
-     return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
- }
-@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
-     out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
-     
-     for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
--        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
-+        out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i];
- 
--    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
-+    out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1];
- 
-     for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
-         out->vector_save.save_vr[i] =
---- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -105,6 +105,11 @@
- #define PR_SET_PTRACER 0x59616d61
- #endif
- 
-+/* musl hack, can't include asm/ptrace.h as that causes conflicts */
-+#if defined(__powerpc64__) && !defined(PT_NIP)
-+#define PT_NIP 32
-+#endif
-+
- namespace google_breakpad {
- 
- namespace {
diff --git a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch b/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
deleted file mode 100644
index ce8311c9ba2..00000000000
--- a/srcpkgs/qt5/patches/0092-chromium-ppc64-be.patch
+++ /dev/null
@@ -1,2970 +0,0 @@
-This adds big endian support/fixes in addition to the base ppc64le patch.
-
-Ping q66 if you're updating qt5 and the patch does not apply anymore.
-
-Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium/BE
-
---- qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-+++ qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/partition_alloc.cc
-@@ -440,7 +440,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
- #endif
-       }
-       // Terminate the freelist chain.
--      *entry_ptr = nullptr;
-+      *entry_ptr = internal::PartitionFreelistEntry::Transform(nullptr);
-       // The freelist head is stored unmasked.
-       page->freelist_head =
-           internal::PartitionFreelistEntry::Transform(page->freelist_head);
---- qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-+++ qtwebengine/src/3rdparty/chromium/base/i18n/icu_util.cc
-@@ -75,7 +75,11 @@ wchar_t g_debug_icu_pf_filename[_MAX_PATH];
- // No need to change the filename in multiple places (gyp files, windows
- // build pkg configurations, etc). 'l' stands for Little Endian.
- // This variable is exported through the header file.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
- const char kIcuDataFileName[] = "icudtl.dat";
-+#else
-+const char kIcuDataFileName[] = "icudtb.dat";
-+#endif
- #if defined(OS_ANDROID)
- const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
- #endif
---- qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/memory/shared_memory_mapping_unittest.cc
-@@ -12,6 +12,7 @@
- #include "base/containers/span.h"
- #include "base/memory/read_only_shared_memory_region.h"
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- 
-@@ -69,8 +70,8 @@ TEST_F(SharedMemoryMappingTest, SpanWithAutoDeducedElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
- }
- 
- TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
-@@ -95,13 +96,13 @@ TEST_F(SharedMemoryMappingTest, SpanWithExplicitElementCount) {
- 
-   for (size_t i = 0; i < write_span.size(); ++i)
-     write_span[i] = i + 1;
--  EXPECT_EQ(0x04030201u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
--  EXPECT_EQ(0x04030201u, read_span_2[0]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span[0]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x01020304u), read_span_2[0]);
- 
-   std::fill(write_span_2.begin(), write_span_2.end(), 0);
-   EXPECT_EQ(0u, read_span[0]);
--  EXPECT_EQ(0x08070605u, read_span[1]);
-+  EXPECT_EQ(HostToNet32(0x05060708u), read_span[1]);
-   EXPECT_EQ(0u, read_span_2[0]);
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/metrics/bucket_ranges_unittest.cc
-@@ -7,6 +7,7 @@
- #include <stdint.h>
- 
- #include "testing/gtest/include/gtest/gtest.h"
-+#include "base/sys_byteorder.h"
- 
- namespace base {
- namespace {
-@@ -64,13 +65,21 @@ TEST(BucketRangesTest, Checksum) {
-   ranges.set_range(2, 2);
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(289217253u, ranges.checksum());
-+#else
-+  EXPECT_EQ(2767231596u, ranges.checksum());
-+#endif
- 
-   ranges.set_range(2, 3);
-   EXPECT_FALSE(ranges.HasValidChecksum());
- 
-   ranges.ResetChecksum();
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   EXPECT_EQ(2843835776u, ranges.checksum());
-+#else
-+  EXPECT_EQ(3556223738u, ranges.checksum());
-+#endif
-   EXPECT_TRUE(ranges.HasValidChecksum());
- }
- 
---- qtwebengine/src/3rdparty/chromium/base/pickle.cc
-+++ qtwebengine/src/3rdparty/chromium/base/pickle.cc
-@@ -82,7 +82,12 @@ inline const char* PickleIterator::GetReadPointerAndAdvance(
- }
- 
- bool PickleIterator::ReadBool(bool* result) {
--  return ReadBuiltinType(result);
-+  int int_result;
-+  if (ReadBuiltinType(&int_result)) {
-+    *result = static_cast<bool>(int_result);
-+    return true;
-+  } else
-+    return false;
- }
- 
- bool PickleIterator::ReadInt(int* result) {
---- qtwebengine/src/3rdparty/chromium/base/sha1.cc
-+++ qtwebengine/src/3rdparty/chromium/base/sha1.cc
-@@ -110,8 +110,10 @@ void SecureHashAlgorithm::Final() {
-   Pad();
-   Process();
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (auto& t : H)
-     t = ByteSwap(t);
-+#endif
- }
- 
- void SecureHashAlgorithm::Update(const void* data, size_t nbytes) {
-@@ -157,8 +159,10 @@ void SecureHashAlgorithm::Process() {
-   //
-   // W and M are in a union, so no need to memcpy.
-   // memcpy(W, M, sizeof(M));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   for (t = 0; t < 16; ++t)
-     W[t] = ByteSwap(W[t]);
-+#endif
- 
-   // b.
-   for (t = 16; t < 80; ++t)
---- qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/base/strings/string_number_conversions_unittest.cc
-@@ -829,12 +829,21 @@ TEST(StringNumberConversionsTest, DoubleToString) {
-   }
- 
-   // The following two values were seen in crashes in the wild.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes[8] = {0, 0, 0, 0, '\xee', '\x6d', '\x73', '\x42'};
-+#else
-+  const char input_bytes[8] = {'\x42', '\x73', '\x6d', '\xee', 0, 0, 0, 0};
-+#endif
-   double input = 0;
-   memcpy(&input, input_bytes, base::size(input_bytes));
-   EXPECT_EQ("1335179083776", NumberToString(input));
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   const char input_bytes2[8] =
-       {0, 0, 0, '\xa0', '\xda', '\x6c', '\x73', '\x42'};
-+#else
-+  const char input_bytes2[8] =
-+      {'\x42', '\x73', '\x6c', '\xda', '\xa0', 0, 0, 0};
-+#endif
-   input = 0;
-   memcpy(&input, input_bytes2, base::size(input_bytes2));
-   EXPECT_EQ("1334890332160", NumberToString(input));
---- qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-+++ qtwebengine/src/3rdparty/chromium/base/third_party/dmg_fp/dtoa.cc
-@@ -186,7 +186,11 @@
-  *	used for input more than STRTOD_DIGLIM digits long (default 40).
-  */
- 
-+#ifdef __BIG_ENDIAN__
-+#define IEEE_MC68k
-+#else
- #define IEEE_8087
-+#endif
- #define NO_HEX_FP
- 
- #ifndef Long
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/util_unittest.cc
-@@ -12,6 +12,12 @@
- #include "testing/gtest/include/gtest/gtest.h"
- #include "url/gurl.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- namespace safe_browsing {
- 
- TEST(SafeBrowsingDbUtilTest, UrlToFullHashes) {
-@@ -83,7 +89,7 @@ TEST(SafeBrowsingDbUtilTest, StringToSBFullHashAndSBFullHashToString) {
-   // 31 chars plus the last \0 as full_hash.
-   const std::string hash_in = "12345678902234567890323456789012";
-   SBFullHash hash_out = StringToSBFullHash(hash_in);
--  EXPECT_EQ(0x34333231U, hash_out.prefix);
-+  EXPECT_EQ(htonl(0x31323334U), hash_out.prefix);
-   EXPECT_EQ(0, memcmp(hash_in.data(), hash_out.full_hash, sizeof(SBFullHash)));
- 
-   std::string hash_final = SBFullHashToString(hash_out);
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice.cc
-@@ -8,6 +8,7 @@
- #include "base/logging.h"
- #include "base/numerics/safe_math.h"
- #include "base/strings/stringprintf.h"
-+#include "base/sys_byteorder.h"
- #include "build/build_config.h"
- #include "components/safe_browsing/db/v4_rice.h"
- 
-@@ -21,10 +22,6 @@ using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- using ::google::protobuf::int64;
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN) || (ARCH_CPU_LITTLE_ENDIAN != 1)
--#error The code below assumes little-endianness.
--#endif
--
- namespace safe_browsing {
- 
- namespace {
-@@ -117,7 +114,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
-   out->reserve((num_entries + 1));
- 
-   base::CheckedNumeric<uint32_t> last_value(first_value);
--  out->push_back(htonl(last_value.ValueOrDie()));
-+  out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
- 
-   if (num_entries > 0) {
-     V4RiceDecoder decoder(rice_parameter, num_entries, encoded_data);
-@@ -136,7 +133,7 @@ V4DecodeResult V4RiceDecoder::DecodePrefixes(const int64 first_value,
- 
-       // This flipping is done so that the decoded uint32 is interpreted
-       // correcly as a string of 4 bytes.
--      out->push_back(htonl(last_value.ValueOrDie()));
-+      out->push_back(base::ByteSwap(static_cast<uint32_t>(last_value.ValueOrDie())));
-     }
-   }
- 
---- qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/components/safe_browsing/db/v4_rice_unittest.cc
-@@ -6,6 +6,12 @@
- #include "base/logging.h"
- #include "testing/platform_test.h"
- 
-+#if defined(OS_WIN)
-+#include <winsock2.h>
-+#elif defined(OS_POSIX)
-+#include <arpa/inet.h>
-+#endif
-+
- using ::google::protobuf::RepeatedField;
- using ::google::protobuf::int32;
- 
-@@ -247,7 +253,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithOneValue) {
-   EXPECT_EQ(DECODE_SUCCESS,
-             V4RiceDecoder::DecodePrefixes(0x69F67F51u, 2, 0, "", &out));
-   EXPECT_EQ(1u, out.size());
--  EXPECT_EQ(0x69F67F51u, out[0]);
-+  EXPECT_EQ(htonl(0x517FF669u), out[0]);
- }
- 
- TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-@@ -256,7 +262,7 @@ TEST_F(V4RiceTest, TestDecoderPrefixesWithMultipleValues) {
-             V4RiceDecoder::DecodePrefixes(
-                 5, 28, 3, "\xbf\xa8\x3f\xfb\xf\xf\x5e\x27\xe6\xc3\x1d\xc6\x38",
-                 &out));
--  std::vector<uint32_t> expected = {5, 0xad934c0cu, 0x6ff67f56u, 0x81316fceu};
-+  std::vector<uint32_t> expected = {htonl(0x05000000), htonl(0x0c4c93adu), htonl(0x567ff66fu), htonl(0xce6f3181u)};
-   EXPECT_EQ(expected.size(), out.size());
-   for (unsigned i = 0; i < expected.size(); i++) {
-     EXPECT_EQ(expected[i], out[i]);
---- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc
-@@ -686,10 +686,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
-   }
- }
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
- VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
-   // The YUVJ alternatives are FFmpeg's (deprecated, but still in use) way to
-   // specify a pixel format and full range color combination.
---- qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-+++ qtwebengine/src/3rdparty/chromium/media/formats/mp4/box_definitions.cc
-@@ -1107,15 +1107,14 @@ bool OpusSpecificBox::Parse(BoxReader* reader) {
-   RCHECK(reader->Read4(&sample_rate));
-   RCHECK(reader->Read2s(&gain_db));
- 
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error The code below assumes little-endianness.
--#endif
--
--  memcpy(&extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET], &codec_delay_in_frames,
--         sizeof(codec_delay_in_frames));
--  memcpy(&extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET], &sample_rate,
--         sizeof(sample_rate));
--  memcpy(&extradata[OPUS_EXTRADATA_GAIN_OFFSET], &gain_db, sizeof(gain_db));
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET] = (codec_delay_in_frames >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SKIP_SAMPLES_OFFSET+1] = (codec_delay_in_frames >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET] = (sample_rate >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+1] = (sample_rate >> 8) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+2] = (sample_rate >> 16) & 0xff;
-+  extradata[OPUS_EXTRADATA_SAMPLE_RATE_OFFSET+3] = (sample_rate >> 24) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET] = (gain_db >> 0) & 0xff;
-+  extradata[OPUS_EXTRADATA_GAIN_OFFSET+1] = (gain_db >> 8) & 0xff;
- 
-   channel_count = extradata[OPUS_EXTRADATA_CHANNELS_OFFSET];
- 
---- qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-+++ qtwebengine/src/3rdparty/chromium/media/renderers/paint_canvas_video_renderer.cc
-@@ -31,8 +31,7 @@
- 
- // Skia internal format depends on a platform. On Android it is ABGR, on others
- // it is ARGB.
--#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToARGB
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToARGB
-@@ -42,8 +41,7 @@
- #define LIBYUV_I010_TO_ARGB libyuv::I010ToARGB
- #define LIBYUV_H010_TO_ARGB libyuv::H010ToARGB
- #define LIBYUV_NV12_TO_ARGB libyuv::NV12ToARGB
--#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
--    SK_A32_SHIFT == 24
-+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR
- #define LIBYUV_I422_TO_ARGB libyuv::I422ToABGR
- #define LIBYUV_I444_TO_ARGB libyuv::I444ToABGR
---- qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-+++ qtwebengine/src/3rdparty/chromium/net/cert/crl_set.cc
-@@ -6,6 +6,7 @@
- 
- #include "base/base64.h"
- #include "base/json/json_reader.h"
-+#include "base/sys_byteorder.h"
- #include "base/time/time.h"
- #include "base/trace_event/trace_event.h"
- #include "base/values.h"
-@@ -44,9 +45,9 @@ base::DictionaryValue* ReadHeader(base::StringPiece* data) {
-   uint16_t header_len;
-   if (data->size() < sizeof(header_len))
-     return nullptr;
--  // Assumes little-endian.
-   memcpy(&header_len, data->data(), sizeof(header_len));
-   data->remove_prefix(sizeof(header_len));
-+  header_len = base::ByteSwapToLE16(header_len);
- 
-   if (data->size() < header_len)
-     return nullptr;
-@@ -79,9 +80,9 @@ bool ReadCRL(base::StringPiece* data,
-   uint32_t num_serials;
-   if (data->size() < sizeof(num_serials))
-     return false;
--  // Assumes little endian.
-   memcpy(&num_serials, data->data(), sizeof(num_serials));
-   data->remove_prefix(sizeof(num_serials));
-+  num_serials = base::ByteSwapToLE32(num_serials);
- 
-   if (num_serials > 32 * 1024 * 1024)  // Sanity check.
-     return false;
-@@ -192,15 +193,6 @@ CRLSet::~CRLSet() = default;
- // static
- bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
-   TRACE_EVENT0(NetTracingCategory(), "CRLSet::Parse");
--// Other parts of Chrome assume that we're little endian, so we don't lose
--// anything by doing this.
--#if defined(__BYTE_ORDER)
--  // Linux check
--  static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "assumes little endian");
--#elif defined(__BIG_ENDIAN__)
--// Mac check
--#error assumes little endian
--#endif
- 
-   std::unique_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
-   if (!header_dict.get())
---- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-+++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
-@@ -377,6 +377,7 @@ typedef struct pt_regs regs_struct;
- 
- #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
- #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- #define SECCOMP_IP_MSB_IDX \
-   (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
- #define SECCOMP_IP_LSB_IDX \
-@@ -385,6 +386,16 @@ typedef struct pt_regs regs_struct;
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
- #define SECCOMP_ARG_LSB_IDX(nr) \
-   (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#else
-+#define SECCOMP_IP_MSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-+#define SECCOMP_IP_LSB_IDX \
-+  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-+#define SECCOMP_ARG_MSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-+#define SECCOMP_ARG_LSB_IDX(nr) \
-+  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-+#endif
- 
- #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
- #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
---- qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-+++ qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h
-@@ -90,11 +90,18 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
-     __FILE__, __LINE__, #cond); } } while (false)
- 
- #if !defined(ANDROID)   // On Android, we use the skia default settings.
-+#if defined(SK_CPU_BENDIAN)
-+#define SK_A32_SHIFT    0
-+#define SK_R32_SHIFT    8
-+#define SK_G32_SHIFT    16
-+#define SK_B32_SHIFT    24
-+#else
- #define SK_A32_SHIFT    24
- #define SK_R32_SHIFT    16
- #define SK_G32_SHIFT    8
- #define SK_B32_SHIFT    0
- #endif
-+#endif
- 
- #if defined(SK_BUILD_FOR_MAC)
- 
-@@ -108,17 +115,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
- // we should revisit this choice...
- #define SK_USE_FREETYPE_EMBOLDEN
- 
--#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
--// Above we set the order for ARGB channels in registers. I suspect that, on
--// big endian machines, you can keep this the same and everything will work.
--// The in-memory order will be different, of course, but as long as everything
--// is reading memory as words rather than bytes, it will all work. However, if
--// you find that colours are messed up I thought that I would leave a helpful
--// locator for you. Also see the comments in
--// base/gfx/bitmap_platform_device_linux.h
--#error Read the comment at this location
--#endif
--
- #endif
- 
- // The default crash macro writes to badbeef which can cause some strange
---- qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/skia/ext/image_operations_unittest.cc
-@@ -18,9 +18,11 @@
- #include "skia/ext/image_operations.h"
- #include "testing/gtest/include/gtest/gtest.h"
- #include "third_party/skia/include/core/SkBitmap.h"
-+#include "third_party/skia/include/core/SkColorPriv.h"
- #include "third_party/skia/include/core/SkColorSpace.h"
- #include "third_party/skia/include/core/SkImageInfo.h"
- #include "third_party/skia/include/core/SkRect.h"
-+#include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
- #include "ui/gfx/geometry/size.h"
- 
-@@ -151,7 +153,7 @@ void DrawCheckerToBitmap(int w, int h,
- 
-       bool use_color2 = (x_bit != y_bit);  // xor
- 
--      *bmp->getAddr32(x, y) = (use_color2 ? color2 : color1);
-+      *bmp->getAddr32(x, y) = SkPreMultiplyColor(use_color2 ? color2 : color1);
-     }
-   }
- }
-@@ -273,7 +275,7 @@ void CheckResizeMethodShouldAverageGrid(
-         std::max(tested_pixel.max_color_distance,
-                  tested_method.max_color_distance_override);
- 
--    const SkColor actual_color = *dest.getAddr32(x, y);
-+    const SkColor actual_color = SkUnPreMultiply::PMColorToColor(*dest.getAddr32(x, y));
- 
-     // Check that the pixels away from the border region are very close
-     // to the expected average color
-@@ -528,7 +530,7 @@ TEST(ImageOperations, ScaleUp) {
-   for (int src_y = 0; src_y < src_h; ++src_y) {
-     for (int src_x = 0; src_x < src_w; ++src_x) {
-       *src.getAddr32(src_x, src_y) =
--          SkColorSetARGB(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-+          SkPackARGB32(255, 10 + src_x * 100, 10 + src_y * 100, 0);
-     }
-   }
- 
-@@ -552,7 +554,7 @@ TEST(ImageOperations, ScaleUp) {
-               lanczos3(src_x + 0.5 - dst_x_in_src) *
-               lanczos3(src_y + 0.5 - dst_y_in_src);
-           sum += coeff;
--          SkColor tmp = *src.getAddr32(src_x, src_y);
-+          SkColor tmp = SkUnPreMultiply::PMColorToColor(*src.getAddr32(src_x, src_y));
-           a += coeff * SkColorGetA(tmp);
-           r += coeff * SkColorGetR(tmp);
-           g += coeff * SkColorGetG(tmp);
-@@ -571,7 +573,7 @@ TEST(ImageOperations, ScaleUp) {
-       if (r > 255.0f) r = 255.0f;
-       if (g > 255.0f) g = 255.0f;
-       if (b > 255.0f) b = 255.0f;
--      SkColor dst_color = *dst.getAddr32(dst_x, dst_y);
-+      SkColor dst_color = SkUnPreMultiply::PMColorToColor(*dst.getAddr32(dst_x, dst_y));
-       EXPECT_LE(fabs(SkColorGetA(dst_color) - a), 1.5f);
-       EXPECT_LE(fabs(SkColorGetR(dst_color) - r), 1.5f);
-       EXPECT_LE(fabs(SkColorGetG(dst_color) - g), 1.5f);
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc
-@@ -456,8 +456,8 @@ void Unpack<WebGLImageConversion::kDataFormatBGRA8, uint8_t, uint8_t>(
-   for (unsigned i = 0; i < pixels_per_row; ++i) {
-     uint32_t bgra = source32[i];
- #if defined(ARCH_CPU_BIG_ENDIAN)
--    uint32_t brMask = 0xff00ff00;
--    uint32_t gaMask = 0x00ff00ff;
-+    uint32_t br_mask = 0xff00ff00;
-+    uint32_t ga_mask = 0x00ff00ff;
- #else
-     uint32_t br_mask = 0x00ff00ff;
-     uint32_t ga_mask = 0xff00ff00;
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion_test.cc
-@@ -76,9 +76,9 @@ TEST_F(WebGLImageConversionTest, convertBGRA8toRGBA8) {
-                              0x34567888, 0x12345678, 0x34567888,
-                              0x12345678, 0x34567888, 0x12345678};
- #if defined(ARCH_CPU_BIG_ENDIAN)
--  uint32_t expectedData[9] = {0x56341278, 0x78563488, 0x56341278,
--                              0x78563488, 0x56341278, 0x78563488,
--                              0x56341278, 0x78563488, 0x56341278};
-+  uint32_t expected_data[9] = {0x56341278, 0x78563488, 0x56341278,
-+			       0x78563488, 0x56341278, 0x78563488,
-+			       0x56341278, 0x78563488, 0x56341278};
- #else
-   uint32_t expected_data[9] = {0x12785634, 0x34887856, 0x12785634,
-                                0x34887856, 0x12785634, 0x34887856,
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/graphics_context_test.cc
-@@ -52,7 +52,7 @@ namespace blink {
-   {                                                              \
-     for (int y = opaqueRect.Y(); y < opaqueRect.MaxY(); ++y)     \
-       for (int x = opaqueRect.X(); x < opaqueRect.MaxX(); ++x) { \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;               \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));	 \
-         EXPECT_EQ(255, alpha);                                   \
-       }                                                          \
-   }
-@@ -61,12 +61,16 @@ namespace blink {
-   {                                                           \
-     for (int y = 0; y < bitmap.height(); ++y)                 \
-       for (int x = 0; x < bitmap.width(); ++x) {              \
--        int alpha = *bitmap.getAddr32(x, y) >> 24;            \
-+        int alpha = SkGetPackedA32(*bitmap.getAddr32(x, y));  \
-         bool opaque = opaqueRect.Contains(x, y);              \
-         EXPECT_EQ(opaque, alpha == 255);                      \
-       }                                                       \
-   }
- 
-+static inline uint32_t PackARGB32(uint32_t argb) {
-+  return SkPackARGB32NoCheck(argb>>24, (argb<<8)>>24, (argb<<16)>>24, (argb<<24)>>24);
-+}
-+
- TEST(GraphicsContextTest, Recording) {
-   SkBitmap bitmap;
-   bitmap.allocN32Pixels(100, 100);
-@@ -184,10 +188,10 @@ class GraphicsContextHighConstrastTest : public testing::Test {
- TEST_F(GraphicsContextHighConstrastTest, MAYBE_NoHighContrast) {
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -205,10 +209,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_HighContrastOff) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff808080, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff808080), *bitmap_.getAddr32(3, 0));
- }
- 
- // Simple invert for testing. Each color component |c|
-@@ -228,10 +232,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_SimpleInvertForTesting) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xff7f7f7f, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xff7f7f7f), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert brightness (with gamma correction).
-@@ -250,10 +254,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertBrightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xff00ffff, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xff00ffff), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness (in HSL space).
-@@ -272,10 +276,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightness) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // Invert lightness plus grayscale.
-@@ -288,10 +292,10 @@ TEST_F(GraphicsContextHighConstrastTest, InvertLightnessPlusGrayscale) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffe2e2e2, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffdddddd, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffe2e2e2), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffdddddd), *bitmap_.getAddr32(3, 0));
- }
- 
- // TODO(crbug.com/850782): Reenable this.
-@@ -309,10 +313,10 @@ TEST_F(GraphicsContextHighConstrastTest, MAYBE_InvertLightnessPlusContrast) {
- 
-   DrawColorsToContext();
- 
--  EXPECT_EQ(0xffffffff, *bitmap_.getAddr32(0, 0));
--  EXPECT_EQ(0xff000000, *bitmap_.getAddr32(1, 0));
--  EXPECT_EQ(0xffff0000, *bitmap_.getAddr32(2, 0));
--  EXPECT_EQ(0xffeeeeee, *bitmap_.getAddr32(3, 0));
-+  EXPECT_EQ(PackARGB32(0xffffffff), *bitmap_.getAddr32(0, 0));
-+  EXPECT_EQ(PackARGB32(0xff000000), *bitmap_.getAddr32(1, 0));
-+  EXPECT_EQ(PackARGB32(0xffff0000), *bitmap_.getAddr32(2, 0));
-+  EXPECT_EQ(PackARGB32(0xffeeeeee), *bitmap_.getAddr32(3, 0));
- }
- 
- }  // namespace blink
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/highcontrast/highcontrast_classifier.cc
-@@ -1060,55 +1060,47 @@ void DequantizeMinFirst(const int32_t rank,
- 
- // -----------------------------------------------------------------------------
- // CONSTANTS
--// Note that for now, endianness of the target machine needs to match that of
--// the one training was performed on.
- // -----------------------------------------------------------------------------
- const int32_t dnn_hiddenlayer_0_weights_part_0_shape[2] = {4, 10};
- const union {
--  uint8_t bytes[160];
-   float values[40];
- } dnn_hiddenlayer_0_weights_part_0 = {{
--    0xbc, 0x22, 0x0a, 0xbf, 0xb4, 0x46, 0x8c, 0x3f, 0xba, 0x31, 0x34, 0xbe,
--    0x4c, 0x65, 0xdb, 0xbe, 0xf0, 0x54, 0x5e, 0xbe, 0xc1, 0x5d, 0xb3, 0x3f,
--    0xf4, 0xe6, 0x15, 0xbf, 0x05, 0xc6, 0x34, 0xbf, 0xc0, 0x37, 0x7e, 0xbd,
--    0x6c, 0x35, 0x0b, 0xbf, 0xca, 0x53, 0x26, 0xbf, 0x58, 0xb4, 0x87, 0x3f,
--    0x37, 0xee, 0x39, 0xbf, 0xda, 0xfa, 0xf9, 0xbe, 0x97, 0xc1, 0x06, 0xbf,
--    0xf9, 0x4e, 0x81, 0x3f, 0xb2, 0x44, 0x85, 0xbf, 0x7f, 0x98, 0x7c, 0x3d,
--    0x15, 0x26, 0xbc, 0xbe, 0x5c, 0x48, 0x05, 0x3f, 0xc8, 0xaa, 0xa1, 0xbd,
--    0x35, 0xb3, 0x43, 0xbe, 0xeb, 0x46, 0x91, 0x3f, 0x80, 0x71, 0xe3, 0x3c,
--    0xd1, 0x98, 0x79, 0x3f, 0x3c, 0xd0, 0x0d, 0xbf, 0x1e, 0x02, 0xd3, 0x3e,
--    0x5d, 0x4b, 0xa2, 0xbf, 0x68, 0xac, 0xaa, 0xbd, 0xf8, 0xe1, 0x75, 0x3e,
--    0x4a, 0x9c, 0x27, 0xbe, 0xf8, 0xae, 0xb2, 0xbe, 0x7f, 0x9d, 0x91, 0x3f,
--    0x1e, 0x8b, 0xa8, 0xbe, 0x35, 0x7e, 0xb2, 0x3f, 0xbe, 0x8c, 0xd3, 0xbe,
--    0xf9, 0xcd, 0xb5, 0x3f, 0xa1, 0x50, 0xaa, 0x3f, 0xe4, 0x6d, 0xdd, 0xbe,
--    0x0d, 0xce, 0xd3, 0xbe,
-+     -0.539592504501343,   1.09590768814087, -0.175970941781998, -0.428507208824158,
-+     -0.217120885848999,   1.40129864215851,   -0.5855553150177, -0.706146538257599,
-+    -0.0620648860931396, -0.543783903121948, -0.649716019630432,   1.06019115447998,
-+     -0.726291120052338, -0.488241970539093, -0.526391446590424,   1.01022255420685,
-+      -1.04115891456604, 0.0616688691079617, -0.367478042840958,  0.520635366439819,
-+    -0.0789390206336975,  -0.19111330807209,   1.13497674465179, 0.0277640819549561,
-+      0.974988043308258, -0.553958654403687,  0.412125527858734,   -1.2679249048233,
-+    -0.0833366513252258,  0.240119814872742, -0.163682132959366,  -0.34899115562439,
-+        1.1376188993454, -0.329186379909515,    1.3944765329361, -0.413183152675629,
-+       1.42034828662872,   1.33058559894562, -0.432479023933411, -0.413681417703629
- }};
- const int32_t dnn_hiddenlayer_0_biases_part_0_shape[1] = {10};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_hiddenlayer_0_biases_part_0 = {{
--    0x00, 0x00, 0x00, 0x00, 0xbf, 0x6a, 0x53, 0x3e, 0xd3, 0xc1,
--    0xd0, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd8, 0xc0, 0x3e,
--    0xca, 0xe7, 0x35, 0x3e, 0x23, 0xa5, 0x44, 0x3f, 0x61, 0xfd,
--    0xd2, 0x3e, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xe0, 0x43, 0x3c,
-+                    0.0,  0.206461891531944,
-+      0.407728761434555,                0.0,
-+      0.376653373241425,  0.177642017602921,
-+       0.76814478635788,  0.412089377641678,
-+                    0.0, 0.0119554307311773
- }};
- const int32_t dnn_logits_biases_part_0_shape[1] = {1};
- const union {
--  uint8_t bytes[4];
-   float values[1];
- } dnn_logits_biases_part_0 = {{
--    0x75, 0xca, 0xd7, 0xbe,
-+    -0.421466499567032
- }};
- const int32_t dnn_logits_weights_part_0_shape[2] = {10, 1};
- const union {
--  uint8_t bytes[40];
-   float values[10];
- } dnn_logits_weights_part_0 = {{
--    0x13, 0x12, 0x39, 0x3f, 0xf3, 0xa5, 0xc2, 0xbf, 0x81, 0x7f,
--    0xbe, 0x3f, 0xf8, 0x17, 0x26, 0x3e, 0xa4, 0x19, 0xa6, 0x3f,
--    0xf0, 0xc9, 0xb7, 0xbf, 0x6a, 0x99, 0xd2, 0x3f, 0x8a, 0x7d,
--    0xe9, 0x3f, 0x83, 0x9a, 0x3a, 0xbf, 0xf1, 0x6c, 0x08, 0x3e,
-+      0.722932040691376,  -1.52068936824799,
-+       1.48826611042023,  0.162200808525085,
-+       1.29765748977661,  -1.43585014343262,
-+       1.64530682563782,   1.82414364814758,
-+     -0.728920161724091,  0.133228078484535
- }};
- 
- }  // anonymous namespace
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/bmp/bmp_image_reader.h
-@@ -37,6 +37,7 @@
- #include "third_party/blink/renderer/platform/wtf/allocator.h"
- #include "third_party/blink/renderer/platform/wtf/cpu.h"
- #include "third_party/blink/renderer/platform/wtf/noncopyable.h"
-+#include "base/sys_byteorder.h"
- 
- namespace blink {
- 
-@@ -50,11 +51,11 @@ class PLATFORM_EXPORT BMPImageReader final {
-   // Read a value from |buffer|, converting to an int assuming little
-   // endianness
-   static inline uint16_t ReadUint16(const char* buffer) {
--    return *reinterpret_cast<const uint16_t*>(buffer);
-+    return base::ByteSwapToLE16(*reinterpret_cast<const uint16_t*>(buffer));
-   }
- 
-   static inline uint32_t ReadUint32(const char* buffer) {
--    return *reinterpret_cast<const uint32_t*>(buffer);
-+    return base::ByteSwapToLE32(*reinterpret_cast<const uint32_t*>(buffer));
-   }
- 
-   // |parent| is the decoder that owns us.
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
-@@ -49,23 +49,30 @@ extern "C" {
- #include <setjmp.h>
- }
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
- #if defined(JCS_ALPHA_EXTENSIONS)
- #define TURBO_JPEG_RGB_SWIZZLE
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline J_COLOR_SPACE rgbOutputColorSpace() {
-   return JCS_EXT_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ARGB;
-+}
-+#elif SK_PMCOLOR_BYTE_ORDER(A, B, G, R)
-+inline J_COLOR_SPACE rgbOutputColorSpace() {
-+  return JCS_EXT_ABGR;
-+}
-+#else
-+#error Component order not supported by libjpeg_turbo
- #endif
- inline bool turboSwizzled(J_COLOR_SPACE colorSpace) {
--  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA;
-+  return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA ||
-+    colorSpace == JCS_EXT_ABGR || colorSpace == JCS_EXT_ARGB;
- }
- #else
- inline J_COLOR_SPACE rgbOutputColorSpace() {
---- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/image-decoders/webp/webp_image_decoder.cc
-@@ -32,18 +32,20 @@
- #include "third_party/blink/renderer/platform/histogram.h"
- #include "third_party/skia/include/core/SkData.h"
- 
--#if defined(ARCH_CPU_BIG_ENDIAN)
--#error Blink assumes a little-endian target.
--#endif
--
--#if SK_B32_SHIFT  // Output little-endian RGBA pixels (Android).
-+#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_rgbA : MODE_RGBA;
- }
--#else  // Output little-endian BGRA pixels.
-+#elif SK_PMCOLOR_BYTE_ORDER(B, G, R, A)
- inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-   return hasAlpha ? MODE_bgrA : MODE_BGRA;
- }
-+#elif SK_PMCOLOR_BYTE_ORDER(A, R, G, B)
-+inline WEBP_CSP_MODE outputMode(bool hasAlpha) {
-+  return hasAlpha ? MODE_Argb : MODE_ARGB;
-+}
-+#else
-+#error Component order not supported by libwebp
- #endif
- 
- namespace {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/asn1/a_int.c
-@@ -369,7 +369,9 @@ int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v)
- 
-     OPENSSL_free(out->data);
-     out->data = newdata;
-+#ifndef OPENSSL_BIGENDIAN
-     v = CRYPTO_bswap8(v);
-+#endif
-     memcpy(out->data, &v, sizeof(v));
- 
-     out->type = V_ASN1_INTEGER;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/chacha/chacha.c
-@@ -29,6 +29,14 @@
-   (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \
-    ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24))
- 
-+#define U32TO8_LITTLE(p, v)    \
-+  {                            \
-+    (p)[0] = (v >> 0) & 0xff;  \
-+    (p)[1] = (v >> 8) & 0xff;  \
-+    (p)[2] = (v >> 16) & 0xff; \
-+    (p)[3] = (v >> 24) & 0xff; \
-+  }
-+
- // sigma contains the ChaCha constants, which happen to be an ASCII string.
- static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-                                    '2', '-', 'b', 'y', 't', 'e', ' ', 'k' };
-@@ -45,9 +53,27 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
- void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-                       const uint8_t nonce[16]) {
-   uint32_t x[16];
--  OPENSSL_memcpy(x, sigma, sizeof(sigma));
--  OPENSSL_memcpy(&x[4], key, 32);
--  OPENSSL_memcpy(&x[12], nonce, 16);
-+  int i;
-+
-+  x[0] = U8TO32_LITTLE(sigma + 0);
-+  x[1] = U8TO32_LITTLE(sigma + 4);
-+  x[2] = U8TO32_LITTLE(sigma + 8);
-+  x[3] = U8TO32_LITTLE(sigma + 12);
-+
-+  x[4] = U8TO32_LITTLE(key + 0);
-+  x[5] = U8TO32_LITTLE(key + 4);
-+  x[6] = U8TO32_LITTLE(key + 8);
-+  x[7] = U8TO32_LITTLE(key + 12);
-+
-+  x[8] = U8TO32_LITTLE(key + 16);
-+  x[9] = U8TO32_LITTLE(key + 20);
-+  x[10] = U8TO32_LITTLE(key + 24);
-+  x[11] = U8TO32_LITTLE(key + 28);
-+
-+  x[12] = U8TO32_LITTLE(nonce + 0);
-+  x[13] = U8TO32_LITTLE(nonce + 4);
-+  x[14] = U8TO32_LITTLE(nonce + 8);
-+  x[15] = U8TO32_LITTLE(nonce + 12);
- 
-   for (size_t i = 0; i < 20; i += 2) {
-     QUARTERROUND(0, 4, 8, 12)
-@@ -60,8 +86,10 @@ void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32],
-     QUARTERROUND(3, 4, 9, 14)
-   }
- 
--  OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4);
--  OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4);
-+  for (i = 0; i < 4; ++i) {
-+    U32TO8_LITTLE(out + 4 * i, x[i]);
-+    U32TO8_LITTLE(&out[16] + 4 * i, x[12+i]);
-+  }
- }
- 
- #if !defined(OPENSSL_NO_ASM) &&                         \
-@@ -105,14 +133,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- 
- #else
- 
--#define U32TO8_LITTLE(p, v)    \
--  {                            \
--    (p)[0] = (v >> 0) & 0xff;  \
--    (p)[1] = (v >> 8) & 0xff;  \
--    (p)[2] = (v >> 16) & 0xff; \
--    (p)[3] = (v >> 24) & 0xff; \
--  }
--
- // chacha_core performs 20 rounds of ChaCha on the input words in
- // |input| and writes the 64 output bytes to |output|.
- static void chacha_core(uint8_t output[64], const uint32_t input[16]) {
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c
-@@ -625,7 +625,11 @@ static void gcm_siv_crypt(uint8_t *out, const uint8_t *in, size_t in_len,
-   for (size_t done = 0; done < in_len;) {
-     uint8_t keystream[AES_BLOCK_SIZE];
-     enc_block(counter.c, keystream, key);
-+#ifdef OPENSSL_BIGENDIAN
-+    counter.w[0] = CRYPTO_bswap4(CRYPTO_bswap4(counter.w[0]) + 1);
-+#else
-     counter.w[0]++;
-+#endif
- 
-     size_t todo = AES_BLOCK_SIZE;
-     if (in_len - done < todo) {
-@@ -673,8 +677,13 @@ static void gcm_siv_polyval(
-     } bitlens;
-   } length_block;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  length_block.bitlens.ad = CRYPTO_bswap8(ad_len * 8);
-+  length_block.bitlens.in = CRYPTO_bswap8(in_len * 8);
-+#else
-   length_block.bitlens.ad = ad_len * 8;
-   length_block.bitlens.in = in_len * 8;
-+#endif
-   CRYPTO_POLYVAL_update_blocks(&polyval_ctx, length_block.c,
-                                sizeof(length_block));
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/compiler_test.cc
-@@ -40,9 +40,13 @@ static void CheckRepresentation(T value) {
-   UnsignedT value_u = static_cast<UnsignedT>(value);
-   EXPECT_EQ(sizeof(UnsignedT), sizeof(T));
- 
--  // Integers must be little-endian.
-+  // Integers must be either big-endian or little-endian.
-   uint8_t expected[sizeof(UnsignedT)];
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = sizeof(UnsignedT); i-- > 0; ) {
-+#else
-   for (size_t i = 0; i < sizeof(UnsignedT); i++) {
-+#endif
-     expected[i] = static_cast<uint8_t>(value_u);
-     // Divide instead of right-shift to appease compilers that warn if |T| is a
-     // char. The explicit cast is also needed to appease MSVC if integer
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/curve25519/spake25519.c
-@@ -339,8 +339,17 @@ static void scalar_double(scalar *s) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
--    const uint32_t carry_out = s->words[i] >> 31;
--    s->words[i] = (s->words[i] << 1) | carry;
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint32_t si = CRYPTO_bswap4(s->words[i]);
-+#else
-+    const uint32_t si = s->words[i];
-+#endif
-+    const uint32_t carry_out = si >> 31;
-+#ifdef OPENSSL_BIGENDIAN
-+    s->words[i] = CRYPTO_bswap4((si << 1) | carry);
-+#else
-+    s->words[i] = (si << 1) | carry;
-+#endif
-     carry = carry_out;
-   }
- }
-@@ -350,8 +359,13 @@ static void scalar_add(scalar *dest, const scalar *src) {
-   uint32_t carry = 0;
- 
-   for (size_t i = 0; i < 8; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    uint64_t tmp = ((uint64_t)CRYPTO_bswap4(dest->words[i]) + CRYPTO_bswap4(src->words[i])) + carry;
-+    dest->words[i] = CRYPTO_bswap4((uint32_t)tmp);
-+#else
-     uint64_t tmp = ((uint64_t)dest->words[i] + src->words[i]) + carry;
-     dest->words[i] = (uint32_t)tmp;
-+#endif
-     carry = (uint32_t)(tmp >> 32);
-   }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/evp/scrypt.c
-@@ -196,10 +196,28 @@ int EVP_PBE_scrypt(const char *password, size_t password_len,
-     goto err;
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  uint32_t *B32 = B->words;
-+  size_t B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   for (uint64_t i = 0; i < p; i++) {
-     scryptROMix(B + 2 * r * i, r, N, T, V);
-   }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  B32 = B->words;
-+  B_words = B_bytes >> 2;
-+  do {
-+    *B32 = CRYPTO_bswap4(*B32);
-+    B32++;
-+  } while(--B_words);
-+#endif
-+
-   if (!PKCS5_PBKDF2_HMAC(password, password_len, (const uint8_t *)B, B_bytes, 1,
-                          EVP_sha256(), key_len, out_key)) {
-     goto err;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c
-@@ -136,9 +136,13 @@ BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret) {
-   // Make sure the top bytes will be zeroed.
-   ret->d[num_words - 1] = 0;
- 
--  // We only support little-endian platforms, so we can simply memcpy the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  uint8_t *out = (uint8_t *)ret->d;
-+  for (size_t i = 0; i < len; i++)
-+    out[i ^ (BN_BYTES-1)] = in[i];
-+#else
-   OPENSSL_memcpy(ret->d, in, len);
-+#endif
-   return ret;
- }
- 
-@@ -157,7 +161,11 @@ size_t BN_bn2bin(const BIGNUM *in, uint8_t *out) {
- static int fits_in_bytes(const uint8_t *bytes, size_t num_bytes, size_t len) {
-   uint8_t mask = 0;
-   for (size_t i = len; i < num_bytes; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    mask |= bytes[i ^ (BN_BYTES-1)];
-+#else
-     mask |= bytes[i];
-+#endif
-   }
-   return mask == 0;
- }
-@@ -172,9 +180,13 @@ int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply memcpy into the
--  // internal representation.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[i] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   OPENSSL_memcpy(out, bytes, num_bytes);
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out + num_bytes, 0, len - num_bytes);
-   return 1;
-@@ -190,11 +202,15 @@ int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in) {
-     num_bytes = len;
-   }
- 
--  // We only support little-endian platforms, so we can simply write the buffer
--  // in reverse.
-+#ifdef OPENSSL_BIGENDIAN
-+  for (size_t i = 0; i < num_bytes; i++) {
-+    out[len - i - 1] = bytes[i ^ (BN_BYTES-1)];
-+  }
-+#else
-   for (size_t i = 0; i < num_bytes; i++) {
-     out[len - i - 1] = bytes[i];
-   }
-+#endif
-   // Pad out the rest of the buffer with zeroes.
-   OPENSSL_memset(out, 0, len - num_bytes);
-   return 1;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/ecdsa/ecdsa.c
-@@ -80,7 +80,11 @@ static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out,
-   }
-   OPENSSL_memset(out, 0, sizeof(EC_SCALAR));
-   for (size_t i = 0; i < digest_len; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out->bytes[i ^ (BN_BYTES-1)] = digest[digest_len - 1 - i];
-+#else
-     out->bytes[i] = digest[digest_len - 1 - i];
-+#endif
-   }
- 
-   // If it is still too long, truncate remaining bits with a shift.
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/gcm.c
-@@ -78,6 +78,14 @@
-     }                                                                 \
-   } while (0)
- 
-+#ifdef OPENSSL_BIGENDIAN
-+#define GCM_bswap4(x) (x)
-+#define GCM_bswap8(x) (x)
-+#else
-+#define GCM_bswap4 CRYPTO_bswap4
-+#define GCM_bswap8 CRYPTO_bswap8
-+#endif
-+
- // kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four
- // bits of a |size_t|.
- static const size_t kSizeTWithoutLower4Bits = (size_t) -16;
-@@ -173,8 +181,8 @@ static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) {
-     Z.lo ^= Htable[nlo].lo;
-   }
- 
--  Xi[0] = CRYPTO_bswap8(Z.hi);
--  Xi[1] = CRYPTO_bswap8(Z.lo);
-+  Xi[0] = GCM_bswap8(Z.hi);
-+  Xi[1] = GCM_bswap8(Z.lo);
- }
- 
- // Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for
-@@ -233,8 +241,8 @@ static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16],
-       Z.lo ^= Htable[nlo].lo;
-     }
- 
--    Xi[0] = CRYPTO_bswap8(Z.hi);
--    Xi[1] = CRYPTO_bswap8(Z.lo);
-+    Xi[0] = GCM_bswap8(Z.hi);
-+    Xi[1] = GCM_bswap8(Z.lo);
-   } while (inp += 16, len -= 16);
- }
- #else  // GHASH_ASM
-@@ -360,8 +368,8 @@ void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash,
-   OPENSSL_memcpy(H.c, gcm_key, 16);
- 
-   // H is stored in host byte order
--  H.u[0] = CRYPTO_bswap8(H.u[0]);
--  H.u[1] = CRYPTO_bswap8(H.u[1]);
-+  H.u[0] = GCM_bswap8(H.u[0]);
-+  H.u[1] = GCM_bswap8(H.u[1]);
- 
-   OPENSSL_memcpy(out_key, H.c, 16);
- 
-@@ -474,15 +482,15 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       GCM_MUL(ctx, Yi);
-     }
-     len0 <<= 3;
--    ctx->Yi.u[1] ^= CRYPTO_bswap8(len0);
-+    ctx->Yi.u[1] ^= GCM_bswap8(len0);
- 
-     GCM_MUL(ctx, Yi);
--    ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+    ctr = GCM_bswap4(ctx->Yi.d[3]);
-   }
- 
-   (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key);
-   ++ctr;
--  ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+  ctx->Yi.d[3] = GCM_bswap4(ctr);
- }
- 
- int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) {
-@@ -580,7 +588,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -602,7 +610,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n];
-       n = (n + 1) % 16;
-@@ -621,7 +629,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -638,7 +646,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -653,7 +661,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)];
-       store_word_le(out + i, tmp);
-@@ -668,7 +676,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -707,7 +715,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     ctx->ares = 0;
-   }
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
-   n = ctx->mres;
-   if (n) {
-@@ -732,7 +740,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-       if (n == 0) {
-         (*block)(ctx->Yi.c, ctx->EKi.c, key);
-         ++ctr;
--        ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+        ctx->Yi.d[3] = GCM_bswap4(ctr);
-       }
-       c = in[i];
-       out[i] = c ^ ctx->EKi.c[n];
-@@ -754,7 +762,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (j) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -771,7 +779,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-     while (len >= 16) {
-       (*block)(ctx->Yi.c, ctx->EKi.c, key);
-       ++ctr;
--      ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+      ctx->Yi.d[3] = GCM_bswap4(ctr);
-       for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-         store_word_le(out + i,
-                       load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -785,7 +793,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   while (len >= 16) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     for (size_t i = 0; i < 16; i += sizeof(size_t)) {
-       size_t c = load_word_le(in + i);
-       store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]);
-@@ -800,7 +808,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -866,13 +874,13 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     GHASH(ctx, out, GHASH_CHUNK);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-@@ -885,7 +893,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- 
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     in += i;
-     len -= i;
- #if defined(GHASH)
-@@ -904,7 +912,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n];
-       ++n;
-@@ -970,14 +978,14 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   }
- #endif
- 
--  ctr = CRYPTO_bswap4(ctx->Yi.d[3]);
-+  ctr = GCM_bswap4(ctx->Yi.d[3]);
- 
- #if defined(GHASH)
-   while (len >= GHASH_CHUNK) {
-     GHASH(ctx, in, GHASH_CHUNK);
-     (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c);
-     ctr += GHASH_CHUNK / 16;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += GHASH_CHUNK;
-     in += GHASH_CHUNK;
-     len -= GHASH_CHUNK;
-@@ -1003,7 +1011,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
- #endif
-     (*stream)(in, out, j, key, ctx->Yi.c);
-     ctr += (unsigned int)j;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     out += i;
-     in += i;
-     len -= i;
-@@ -1011,7 +1019,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key,
-   if (len) {
-     (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key);
-     ++ctr;
--    ctx->Yi.d[3] = CRYPTO_bswap4(ctr);
-+    ctx->Yi.d[3] = GCM_bswap4(ctr);
-     while (len--) {
-       uint8_t c = in[n];
-       ctx->Xi.c[n] ^= c;
-@@ -1036,8 +1044,8 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) {
-     GCM_MUL(ctx, Xi);
-   }
- 
--  alen = CRYPTO_bswap8(alen);
--  clen = CRYPTO_bswap8(clen);
-+  alen = GCM_bswap8(alen);
-+  clen = GCM_bswap8(clen);
- 
-   ctx->Xi.u[0] ^= alen;
-   ctx->Xi.u[1] ^= clen;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/internal.h
-@@ -70,11 +70,17 @@ extern "C" {
- static inline uint32_t GETU32(const void *in) {
-   uint32_t v;
-   OPENSSL_memcpy(&v, in, sizeof(v));
-+#ifdef OPENSSL_BIGENDIAN
-+  return v;
-+#else
-   return CRYPTO_bswap4(v);
-+#endif
- }
- 
- static inline void PUTU32(void *out, uint32_t v) {
-+#ifndef OPENSSL_BIGENDIAN
-   v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(out, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/modes/polyval.c
-@@ -32,16 +32,26 @@ static void byte_reverse(polyval_block *b) {
- // the GHASH field, multiplies that by 'x' and serialises the result back into
- // |b|, but with GHASH's backwards bit ordering.
- static void reverse_and_mulX_ghash(polyval_block *b) {
-+#ifdef OPENSSL_BIGENDIAN
-+  uint64_t hi = CRYPTO_bswap8(b->u[0]);
-+  uint64_t lo = CRYPTO_bswap8(b->u[1]);
-+#else
-   uint64_t hi = b->u[0];
-   uint64_t lo = b->u[1];
-+#endif
-   const crypto_word_t carry = constant_time_eq_w(hi & 1, 1);
-   hi >>= 1;
-   hi |= lo << 63;
-   lo >>= 1;
-   lo ^= ((uint64_t) constant_time_select_w(carry, 0xe1, 0)) << 56;
- 
-+#ifdef OPENSSL_BIGENDIAN
-+  b->u[0] = lo;
-+  b->u[1] = hi;
-+#else
-   b->u[0] = CRYPTO_bswap8(lo);
-   b->u[1] = CRYPTO_bswap8(hi);
-+#endif
- }
- 
- // POLYVAL(H, X_1, ..., X_n) =
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/fipsmodule/rand/ctrdrbg.c
-@@ -70,8 +70,12 @@ OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0,
- // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a
- // big-endian number.
- static void ctr32_add(CTR_DRBG_STATE *drbg, uint32_t n) {
-+#ifdef OPENSSL_BIGENDIAN
-+  drbg->counter.words[3] += n;
-+#else
-   drbg->counter.words[3] =
-       CRYPTO_bswap4(CRYPTO_bswap4(drbg->counter.words[3]) + n);
-+#endif
- }
- 
- static int ctr_drbg_update(CTR_DRBG_STATE *drbg, const uint8_t *data,
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/crypto/poly1305/poly1305.c
-@@ -32,10 +32,16 @@
- static uint32_t U8TO32_LE(const uint8_t *m) {
-   uint32_t r;
-   OPENSSL_memcpy(&r, m, sizeof(r));
-+#ifdef OPENSSL_BIGENDIAN
-+  r = CRYPTO_bswap4(r);
-+#endif
-   return r;
- }
- 
- static void U32TO8_LE(uint8_t *m, uint32_t v) {
-+#ifdef OPENSSL_BIGENDIAN
-+  v = CRYPTO_bswap4(v);
-+#endif
-   OPENSSL_memcpy(m, &v, sizeof(v));
- }
- 
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h
-@@ -99,6 +99,10 @@ extern "C" {
- #elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)
- #define OPENSSL_64_BIT
- #define OPENSSL_PPC64LE
-+#elif (defined(__PPC64__) || defined(__powerpc64__))
-+#define OPENSSL_64_BIT
-+#define OPENSSL_PPC64
-+#define OPENSSL_BIGENDIAN
- #elif defined(__mips__) && !defined(__LP64__)
- #define OPENSSL_32_BIT
- #define OPENSSL_MIPS
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/curve25519.c
-@@ -3032,9 +3032,14 @@ int ED25519_verify(const uint8_t *message, size_t message_len,
-     UINT64_C(0x1000000000000000),
-   };
-   for (size_t i = 3;; i--) {
--    if (scopy.u64[i] > kOrder[i]) {
-+#ifdef OPENSSL_BIGENDIAN
-+    const uint64_t n = CRYPTO_bswap8(scopy.u64[i]);
-+#else
-+    const uint64_t n = scopy.u64[i];
-+#endif
-+    if (n > kOrder[i]) {
-       return 0;
--    } else if (scopy.u64[i] < kOrder[i]) {
-+    } else if (n < kOrder[i]) {
-       break;
-     } else if (i == 0) {
-       return 0;
---- qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-+++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/third_party/fiat/p256.c
-@@ -882,12 +882,24 @@ static void fe_tobytes(uint8_t out[NBYTES], const fe in) {
-   }
- }
- 
-+#ifdef OPENSSL_BIGENDIAN
-+static void fe_tobytes_be(uint8_t out[NBYTES], const fe in) {
-+  for (int i = 0; i<NBYTES; i++) {
-+    out[i ^ (BN_BYTES-1)] = (uint8_t)(in[i/sizeof(in[0])] >> (8*(i%sizeof(in[0]))));
-+  }
-+}
-+#endif
-+
- static void fe_frombytes(fe out, const uint8_t in[NBYTES]) {
-   for (int i = 0; i<NLIMBS; i++) {
-     out[i] = 0;
-   }
-   for (int i = 0; i<NBYTES; i++) {
-+#ifdef OPENSSL_BIGENDIAN
-+    out[i/sizeof(out[0])] |= ((limb_t)in[i ^ (BN_BYTES-1)]) << (8*(i%sizeof(out[0])));
-+#else
-     out[i/sizeof(out[0])] |= ((limb_t)in[i]) << (8*(i%sizeof(out[0])));
-+#endif
-   }
- }
- 
-@@ -906,7 +918,11 @@ static void fe_to_generic(EC_FELEM *out, const fe in) {
-   OPENSSL_STATIC_ASSERT(
-       256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2),
-       "fe_tobytes leaves bytes uninitialized");
-+#ifdef OPENSSL_BIGENDIAN
-+  fe_tobytes_be(out->bytes, in);
-+#else
-   fe_tobytes(out->bytes, in);
-+#endif
- }
- 
- // fe_inv calculates |out| = |in|^{-1}
-@@ -1524,7 +1540,11 @@ static char get_bit(const uint8_t *in, int i) {
-   if (i < 0 || i >= 256) {
-     return 0;
-   }
-+#ifdef OPENSSL_BIGENDIAN
-+  return (in[(i >> 3) ^ (sizeof(BN_ULONG)-1)] >> (i & 7)) & 1;
-+#else
-   return (in[i >> 3] >> (i & 7)) & 1;
-+#endif
- }
- 
- // Interleaved point multiplication using precomputed point multiples: The
---- qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/crc32c/BUILD.gn
-@@ -15,13 +15,10 @@ config("crc32c_config") {
-   ]
- 
-   defines = [
--    "BYTE_ORDER_BIG_ENDIAN=0",
-+    "BYTE_ORDER_BIG_ENDIAN=__BYTE_ORDER__==__ORDER_BIG_ENDIAN__",
-     "CRC32C_TESTS_BUILT_WITH_GLOG=0",
-   ]
- 
--  # If we ever support big-endian builds, add logic to conditionally enable
--  # BYTE_ORDER_BIG_ENDIAN.
--
-   if (target_cpu == "x86" || target_cpu == "x64") {
-     defines += [
-       "HAVE_MM_PREFETCH=1",
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h
-@@ -220,18 +220,15 @@ template<typename T> T EndianSwap(T t) {
-   if (sizeof(T) == 1) {   // Compile-time if-then's.
-     return t;
-   } else if (sizeof(T) == 2) {
--    union { T t; uint16_t i; } u;
--    u.t = t;
-+    union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP16(u.i);
-     return u.t;
-   } else if (sizeof(T) == 4) {
--    union { T t; uint32_t i; } u;
--    u.t = t;
-+    union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP32(u.i);
-     return u.t;
-   } else if (sizeof(T) == 8) {
--    union { T t; uint64_t i; } u;
--    u.t = t;
-+    union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t);
-     u.i = FLATBUFFERS_BYTESWAP64(u.i);
-     return u.t;
-   } else {
---- qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/minireflect.h
-@@ -122,58 +122,58 @@ inline void IterateValue(ElementaryType type, const uint8_t *val,
-                          soffset_t vector_index, IterationVisitor *visitor) {
-   switch (type) {
-     case ET_UTYPE: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UType(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_BOOL: {
--      visitor->Bool(*reinterpret_cast<const uint8_t *>(val) != 0);
-+      visitor->Bool(ReadScalar<uint8_t>(val) != 0);
-       break;
-     }
-     case ET_CHAR: {
--      auto tval = *reinterpret_cast<const int8_t *>(val);
-+      auto tval = ReadScalar<int8_t>(val);
-       visitor->Char(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UCHAR: {
--      auto tval = *reinterpret_cast<const uint8_t *>(val);
-+      auto tval = ReadScalar<uint8_t>(val);
-       visitor->UChar(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_SHORT: {
--      auto tval = *reinterpret_cast<const int16_t *>(val);
-+      auto tval = ReadScalar<int16_t>(val);
-       visitor->Short(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_USHORT: {
--      auto tval = *reinterpret_cast<const uint16_t *>(val);
-+      auto tval = ReadScalar<uint16_t>(val);
-       visitor->UShort(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_INT: {
--      auto tval = *reinterpret_cast<const int32_t *>(val);
-+      auto tval = ReadScalar<int32_t>(val);
-       visitor->Int(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_UINT: {
--      auto tval = *reinterpret_cast<const uint32_t *>(val);
-+      auto tval = ReadScalar<uint32_t>(val);
-       visitor->UInt(tval, EnumName(tval, type_table));
-       break;
-     }
-     case ET_LONG: {
--      visitor->Long(*reinterpret_cast<const int64_t *>(val));
-+      visitor->Long(ReadScalar<int64_t>(val));
-       break;
-     }
-     case ET_ULONG: {
--      visitor->ULong(*reinterpret_cast<const uint64_t *>(val));
-+      visitor->ULong(ReadScalar<uint64_t>(val));
-       break;
-     }
-     case ET_FLOAT: {
--      visitor->Float(*reinterpret_cast<const float *>(val));
-+      visitor->Float(ReadScalar<float>(val));
-       break;
-     }
-     case ET_DOUBLE: {
--      visitor->Double(*reinterpret_cast<const double *>(val));
-+      visitor->Double(ReadScalar<double>(val));
-       break;
-     }
-     case ET_STRING: {
---- qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/port/port_chromium.h
-@@ -23,8 +23,11 @@
- namespace leveldb {
- namespace port {
- 
--// Chromium only supports little endian.
-+#if ARCH_CPU_LITTLE_ENDIAN
- static const bool kLittleEndian = true;
-+#else
-+static const bool kLittleEndian = false;
-+#endif
- 
- class LOCKABLE Mutex {
-  public:
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/BUILD.gn
-@@ -2,10 +2,16 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
-+import("//build/config/host_byteorder.gni")
-+
- static_library("modp_b64") {
-   sources = [
-     "modp_b64.cc",
-     "modp_b64.h",
-     "modp_b64_data.h",
-   ]
-+
-+  if (host_byteorder == "big") {
-+    defines = [ "WORDS_BIGENDIAN=1" ]
-+  }
- }
---- qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/modp_b64/modp_b64.cc
-@@ -118,7 +118,7 @@ size_t modp_b64_encode(char* dest, const char* str, size_t len)
- }
- 
- #ifdef WORDS_BIGENDIAN   /* BIG ENDIAN -- SUN / IBM / MOTOROLA */
--int modp_b64_decode(char* dest, const char* src, int len)
-+size_t modp_b64_decode(char* dest, const char* src, size_t len)
- {
-     if (len == 0) return 0;
- 
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/base/utils.h
-@@ -22,6 +22,7 @@
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
-+#include <type_traits>
- #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
- #include <sys/types.h>
- #endif
-@@ -91,7 +92,7 @@ struct FreeDeleter {
- 
- template <typename T>
- constexpr T AssumeLittleEndian(T value) {
--  static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-+  static_assert(std::is_same<T,T>::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__,
-                 "Unimplemented on big-endian archs");
-   return value;
- }
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h
-@@ -138,6 +138,13 @@ class PERFETTO_EXPORT Message {
- 
-     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
-     memcpy(pos, &value, sizeof(T));
-+#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
-+    for (size_t i = sizeof(T)/2; i--; ) {
-+      uint8_t tmp = pos[i];
-+      pos[i] = pos[sizeof(T)-1-i];
-+      pos[sizeof(T)-1-i] = tmp;
-+    }
-+#endif
-     pos += sizeof(T);
-     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
-     WriteToStream(buffer, pos);
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc
-@@ -21,12 +21,6 @@
- #include "perfetto/base/logging.h"
- #include "perfetto/protozero/message_handle.h"
- 
--#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
--// The memcpy() for float and double below needs to be adjusted if we want to
--// support big endian CPUs. There doesn't seem to be a compelling need today.
--#error Unimplemented for big endian archs.
--#endif
--
- namespace protozero {
- 
- // static
---- qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc
-@@ -29,7 +29,8 @@ using namespace proto_utils;
- #define BYTE_SWAP_TO_LE32(x) (x)
- #define BYTE_SWAP_TO_LE64(x) (x)
- #else
--#error Unimplemented for big endian archs.
-+#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x)
-+#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x)
- #endif
- 
- ProtoDecoder::Field ProtoDecoder::ReadField() {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/core/SkPostConfig.h
-@@ -40,12 +40,6 @@
- #  error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
- #endif
- 
--#if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
--    #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
--    #error "If you still want to use Skia,"
--    #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
--#endif
--
- /**
-  * Ensure the port has defined all of SK_X32_SHIFT, or none of them.
-  */
---- qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/include/private/GrTypesPriv.h
-@@ -65,9 +65,6 @@ enum GrPixelConfig {
- static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
- 
- // Aliases for pixel configs that match skia's byte order.
--#ifndef SK_CPU_LENDIAN
--#error "Skia gpu currently assumes little endian"
--#endif
- #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
- #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/codec/SkCodecPriv.h
-@@ -14,6 +14,7 @@
- #include "SkEncodedOrigin.h"
- #include "SkImageInfo.h"
- #include "SkTypes.h"
-+#include "SkEndian.h"
- 
- #ifdef SK_PRINT_CODEC_MESSAGES
-     #define SkCodecPrintf SkDebugf
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkColor.cpp
-@@ -108,13 +108,29 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
- template <>
- SkColor4f SkColor4f::FromColor(SkColor bgra) {
-     SkColor4f rgba;
--    swizzle_rb(Sk4f_fromL32(bgra)).store(rgba.vec());
-+    Sk4f c4f = Sk4f_fromL32(bgra);
-+#ifdef SK_CPU_BENDIAN
-+    // ARGB -> RGBA
-+    c4f = SkNx_shuffle<1, 2, 3, 0>(c4f);
-+#else
-+    // BGRA -> RGBA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    c4f.store(rgba.vec());
-     return rgba;
- }
- 
- template <>
- SkColor SkColor4f::toSkColor() const {
--    return Sk4f_toL32(swizzle_rb(Sk4f::Load(this->vec())));
-+    Sk4f c4f = Sk4f::Load(this->vec());
-+#ifdef SK_CPU_BENDIAN
-+    // RGBA -> ARGB
-+    c4f = SkNx_shuffle<3, 0, 1, 2>(c4f);
-+#else
-+    // RGBA -> BGRA
-+    c4f = swizzle_rb(c4f);
-+#endif
-+    return Sk4f_toL32(c4f);
- }
- 
- template <>
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/core/SkPixmap.cpp
-@@ -246,7 +246,8 @@ SkColor SkPixmap::getColor(int x, int y) const {
-     const bool needsUnpremul = (kPremul_SkAlphaType == fInfo.alphaType());
-     auto toColor = [needsUnpremul](uint32_t maybePremulColor) {
-         return needsUnpremul ? SkUnPreMultiply::PMColorToColor(maybePremulColor)
--                             : SkSwizzle_BGRA_to_PMColor(maybePremulColor);
-+                             : SkColorSetARGB(SkGetPackedA32(maybePremulColor), SkGetPackedR32(maybePremulColor),
-+					      SkGetPackedG32(maybePremulColor), SkGetPackedB32(maybePremulColor));
-     };
- 
-     switch (this->colorType()) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/Sk4px_none.h
-@@ -35,7 +35,6 @@ inline Sk4px Sk4px::Wide::div255() const {
- }
- 
- inline Sk4px Sk4px::alphas() const {
--    static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
-     return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
-                  (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
-                  (*this)[11], (*this)[11], (*this)[11], (*this)[11],
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkBlitRow_opts.h
-@@ -237,8 +237,8 @@ void blit_row_s32a_opaque(SkPMColor* dst, const SkPMColor* src, int len, U8CPU a
-         // with chromium:611002 we need to keep it until we figure out where
-         // the non-premultiplied src values (like 0x00FFFFFF) are coming from.
-         // TODO(mtklein): sort this out and assert *src is premul here.
--        if (*src & 0xFF000000) {
--            *dst = (*src >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-+        if (*src & (0xFF << SK_A32_SHIFT)) {
-+            *dst = ((*src << (24 - SK_A32_SHIFT)) >= 0xFF000000) ? *src : SkPMSrcOver(*src, *dst);
-         }
-         src++;
-         dst++;
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkRasterPipeline_opts.h
-@@ -948,10 +948,17 @@ SI void from_4444(U16 _4444, F* r, F* g, F* b, F* a) {
-     *a = cast(wide & (15<< 0)) * (1.0f / (15<< 0));
- }
- SI void from_8888(U32 _8888, F* r, F* g, F* b, F* a) {
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast((_8888 >> 24)       ) * (1/255.0f);
-+    *g = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-+    *b = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-+    *a = cast((_8888      ) & 0xff) * (1/255.0f);
-+#else
-     *r = cast((_8888      ) & 0xff) * (1/255.0f);
-     *g = cast((_8888 >>  8) & 0xff) * (1/255.0f);
-     *b = cast((_8888 >> 16) & 0xff) * (1/255.0f);
-     *a = cast((_8888 >> 24)       ) * (1/255.0f);
-+#endif
- }
- SI void from_1010102(U32 rgba, F* r, F* g, F* b, F* a) {
-     *r = cast((rgba      ) & 0x3ff) * (1/1023.0f);
-@@ -1278,10 +1285,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-     U32 dst = load<U32>(ptr, tail);
-+#ifdef SK_CPU_BENDIAN
-+    dr = cast((dst >> 24)       );
-+    dg = cast((dst >> 16) & 0xff);
-+    db = cast((dst >>  8) & 0xff);
-+    da = cast((dst      ) & 0xff);
-+#else
-     dr = cast((dst      ) & 0xff);
-     dg = cast((dst >>  8) & 0xff);
-     db = cast((dst >> 16) & 0xff);
-     da = cast((dst >> 24)       );
-+#endif
-     // {dr,dg,db,da} are in [0,255]
-     // { r, g, b, a} are in [0,  1] (but may be out of gamut)
- 
-@@ -1292,10 +1306,17 @@ STAGE(srcover_rgba_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     // { r, g, b, a} are now in [0,255]  (but may be out of gamut)
- 
-     // to_unorm() clamps back to gamut.  Scaling by 1 since we're already 255-biased.
-+#ifdef SK_CPU_BENDIAN
-+    dst = to_unorm(r, 1, 255) << 24
-+        | to_unorm(g, 1, 255) << 16
-+        | to_unorm(b, 1, 255) <<  8
-+        | to_unorm(a, 1, 255);
-+#else
-     dst = to_unorm(r, 1, 255)
-         | to_unorm(g, 1, 255) <<  8
-         | to_unorm(b, 1, 255) << 16
-         | to_unorm(a, 1, 255) << 24;
-+#endif
-     store(ptr, dst, tail);
- }
- 
-@@ -1694,10 +1715,17 @@ STAGE(gather_8888, const SkRasterPipeline_GatherCtx* ctx) {
- STAGE(store_8888, const SkRasterPipeline_MemoryCtx* ctx) {
-     auto ptr = ptr_at_xy<uint32_t>(ctx, dx,dy);
- 
-+#ifdef SK_CPU_BENDIAN
-+    U32 px = to_unorm(r, 255) << 24
-+           | to_unorm(g, 255) << 16
-+           | to_unorm(b, 255) <<  8
-+           | to_unorm(a, 255);
-+#else
-     U32 px = to_unorm(r, 255)
-            | to_unorm(g, 255) <<  8
-            | to_unorm(b, 255) << 16
-            | to_unorm(a, 255) << 24;
-+#endif
-     store(ptr, px, tail);
- }
- 
-@@ -2852,10 +2880,17 @@ SI void from_8888(U32 rgba, U16* r, U16* g, U16* b, U16* a) {
-         return cast<U16>(v);
-     };
- #endif
-+#ifdef SK_CPU_BENDIAN
-+    *r = cast_U16(rgba >>   16) >>  8;
-+    *g = cast_U16(rgba >>   16) & 255;
-+    *b = cast_U16(rgba & 65535) >>  8;
-+    *a = cast_U16(rgba & 65535) & 255;
-+#else
-     *r = cast_U16(rgba & 65535) & 255;
-     *g = cast_U16(rgba & 65535) >>  8;
-     *b = cast_U16(rgba >>   16) & 255;
-     *a = cast_U16(rgba >>   16) >>  8;
-+#endif
- }
- 
- SI void load_8888_(const uint32_t* ptr, size_t tail, U16* r, U16* g, U16* b, U16* a) {
-@@ -2897,10 +2932,15 @@ SI void store_8888_(uint32_t* ptr, size_t tail, U16 r, U16 g, U16 b, U16 a) {
-         case 2: vst4_lane_u8((uint8_t*)(ptr+1), rgba, 1);
-         case 1: vst4_lane_u8((uint8_t*)(ptr+0), rgba, 0);
-     }
-+#else
-+#ifdef SK_CPU_BENDIAN
-+    store(ptr, tail, cast<U32>((r<<8) | g) << 16
-+                   | cast<U32>((b<<8) | a) << 0);
- #else
-     store(ptr, tail, cast<U32>(r | (g<<8)) <<  0
-                    | cast<U32>(b | (a<<8)) << 16);
- #endif
-+#endif
- }
- 
- STAGE_PP(load_8888, const SkRasterPipeline_MemoryCtx* ctx) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.cpp
-@@ -34,6 +34,10 @@ void Value::init_tagged(Tag t) {
- 
- // Pointer values store a type (in the upper kTagBits bits) and a pointer.
- void Value::init_tagged_pointer(Tag t, void* p) {
-+#if !defined(SK_CPU_LENDIAN)
-+    // Check that kRecAlign is large enough to leave room for the tag
-+    static_assert(sizeof(Value) > sizeof(uintptr_t) || !(kRecAlign & Value::kTagMask), "kRecAlign is not a multiple of kTagMask+1");
-+#endif
-     *this->cast<uintptr_t>() = reinterpret_cast<uintptr_t>(p);
- 
-     if (sizeof(Value) == sizeof(uintptr_t)) {
-@@ -169,7 +173,7 @@ private:
- #if defined(SK_CPU_LENDIAN)
-         *s64 &= 0x00ffffffffffffffULL >> ((kMaxInlineStringSize - size) * 8);
- #else
--        static_assert(false, "Big-endian builds are not supported at this time.");
-+        *s64 &= 0xffffffffffffff00ULL << ((kMaxInlineStringSize - size) * 8);
- #endif
-     }
- };
---- qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/src/utils/SkJSON.h
-@@ -120,6 +120,7 @@ protected:
-          -- highest 3 bits reserved for type storage
- 
-      */
-+#if defined(SK_CPU_LENDIAN)
-     enum class Tag : uint8_t {
-         // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-         // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-@@ -134,6 +135,22 @@ protected:
-         kObject                       = 0b11100000,  // ptr to external storage
-     };
-     static constexpr uint8_t kTagMask = 0b11100000;
-+#else
-+    enum class Tag : uint8_t {
-+        // We picked kShortString == 0 so that tag 0x00 and stored max_size-size (7-7=0)
-+        // conveniently overlap the '\0' terminator, allowing us to store a 7 character
-+        // C string inline.
-+        kShortString                  = 0b00000000,  // inline payload
-+        kNull                         = 0b00000001,  // no payload
-+        kBool                         = 0b00000010,  // inline payload
-+        kInt                          = 0b00000011,  // inline payload
-+        kFloat                        = 0b00000100,  // inline payload
-+        kString                       = 0b00000101,  // ptr to external storage
-+        kArray                        = 0b00000110,  // ptr to external storage
-+        kObject                       = 0b00000111,  // ptr to external storage
-+    };
-+    static constexpr uint8_t kTagMask = 0b00000111;
-+#endif
- 
-     void init_tagged(Tag);
-     void init_tagged_pointer(Tag, void*);
-@@ -192,14 +209,14 @@ private:
- 
-     uint8_t fData8[kValueSize];
- 
--#if defined(SK_CPU_LENDIAN)
-     static constexpr size_t kTagOffset = kValueSize - 1;
- 
-+#if defined(SK_CPU_LENDIAN)
-     static constexpr uintptr_t kTagPointerMask =
-             ~(static_cast<uintptr_t>(kTagMask) << ((sizeof(uintptr_t) - 1) * 8));
- #else
--    // The current value layout assumes LE and will take some tweaking for BE.
--    static_assert(false, "Big-endian builds are not supported at this time.");
-+    static constexpr uintptr_t kTagPointerMask =
-+            ~static_cast<uintptr_t>(kTagMask);
- #endif
- };
- 
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -66,10 +66,15 @@ static float eval_curve(const skcms_Curve* curve, float x) {
-         uint16_t be_l, be_h;
-         memcpy(&be_l, curve->table_16 + 2*lo, 2);
-         memcpy(&be_h, curve->table_16 + 2*hi, 2);
-+#if __BIG_ENDIAN__
-+        l = be_l * (1/65535.0f);
-+        h = be_h * (1/65535.0f);
-+#else
-         uint16_t le_l = ((be_l << 8) | (be_l >> 8)) & 0xffff;
-         uint16_t le_h = ((be_h << 8) | (be_h >> 8)) & 0xffff;
-         l = le_l * (1/65535.0f);
-         h = le_h * (1/65535.0f);
-+#endif
-     }
-     return l + (h-l)*t;
- }
-@@ -124,21 +129,29 @@ enum {
- static uint16_t read_big_u16(const uint8_t* ptr) {
-     uint16_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ushort(be);
- #else
-     return __builtin_bswap16(be);
- #endif
-+#endif
- }
- 
- static uint32_t read_big_u32(const uint8_t* ptr) {
-     uint32_t be;
-     memcpy(&be, ptr, sizeof(be));
-+#if __BIG_ENDIAN__
-+    return be;
-+#else
- #if defined(_MSC_VER)
-     return _byteswap_ulong(be);
- #else
-     return __builtin_bswap32(be);
- #endif
-+#endif
- }
- 
- static int32_t read_big_i32(const uint8_t* ptr) {
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/src/Transform_inl.h
-@@ -392,9 +392,11 @@ SI U32 gather_32(const uint8_t* p, I32 ix) {
- }
- 
- SI U32 gather_24(const uint8_t* p, I32 ix) {
-+#if !__BIG_ENDIAN__
-     // First, back up a byte.  Any place we're gathering from has a safe junk byte to read
-     // in front of it, either a previous table value, or some tag metadata.
-     p -= 1;
-+#endif
- 
-     // Load the i'th 24-bit value from p, and 1 extra byte.
-     auto load_24_32 = [p](int i) {
-@@ -435,8 +437,10 @@ SI U32 gather_24(const uint8_t* p, I32 ix) {
- 
- #if !defined(__arm__)
-     SI void gather_48(const uint8_t* p, I32 ix, U64* v) {
-+#if !__BIG_ENDIAN__
-         // As in gather_24(), with everything doubled.
-         p -= 2;
-+#endif
- 
-         // Load the i'th 48-bit value from p, and 2 extra bytes.
-         auto load_48_64 = [p](int i) {
-@@ -499,7 +503,9 @@ SI F F_from_U8(U8 v) {
- SI F F_from_U16_BE(U16 v) {
-     // All 16-bit ICC values are big-endian, so we byte swap before converting to float.
-     // MSVC catches the "loss" of data here in the portable path, so we also make sure to mask.
-+#if !__BIG_ENDIAN__
-     v = U16( 0 | ((v & 0x00ff) << 8) | ((v & 0xff00) >> 8) );
-+#endif
-     return cast<F>(v) * (1/65535.0f);
- }
- 
-@@ -534,9 +540,15 @@ SI F table(const skcms_Curve* curve, F v) {
- SI void sample_clut_8(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     U32 rgb = gather_24(a2b->grid_8, ix);
- 
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+    *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-+    *b = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-+#else
-     *r = cast<F>((rgb >>  0) & 0xff) * (1/255.0f);
-     *g = cast<F>((rgb >>  8) & 0xff) * (1/255.0f);
-     *b = cast<F>((rgb >> 16) & 0xff) * (1/255.0f);
-+#endif
- }
- 
- SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-@@ -549,12 +561,18 @@ SI void sample_clut_16(const skcms_A2B* a2b, I32 ix, F* r, F* g, F* b) {
-     // This strategy is much faster for 64-bit builds, and fine for 32-bit x86 too.
-     U64 rgb;
-     gather_48(a2b->grid_16, ix, &rgb);
-+#if __BIG_ENDIAN__
-+    *r = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
-+    *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-+    *b = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-+#else
-     rgb = swap_endian_16x4(rgb);
- 
-     *r = cast<F>((rgb >>  0) & 0xffff) * (1/65535.0f);
-     *g = cast<F>((rgb >> 16) & 0xffff) * (1/65535.0f);
-     *b = cast<F>((rgb >> 32) & 0xffff) * (1/65535.0f);
- #endif
-+#endif
- }
- 
- // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3)
-@@ -695,10 +713,17 @@ static void exec_ops(const Op* ops, const void** args,
-             case Op_load_8888:{
-                 U32 rgba = load<U32>(src + 4*i);
- 
-+#if __BIG_ENDIAN__
-+                r = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+                g = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-+                b = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-+                a = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-+#else
-                 r = cast<F>((rgba >>  0) & 0xff) * (1/255.0f);
-                 g = cast<F>((rgba >>  8) & 0xff) * (1/255.0f);
-                 b = cast<F>((rgba >> 16) & 0xff) * (1/255.0f);
-                 a = cast<F>((rgba >> 24) & 0xff) * (1/255.0f);
-+#endif
-             } break;
- 
-             case Op_load_8888_palette8:{
-@@ -727,13 +752,29 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U32 R = load_3<U32>(rgb+0),
-+                    G = load_3<U32>(rgb+1),
-+                    B = load_3<U32>(rgb+2);
-+                // R,G,B are little-endian 16-bit, so byte swap them before converting to float.
-+                r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-+                g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-+                b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#else
-                 r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-                 g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-                 b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -743,17 +784,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-+                g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-+                b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+                a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#else
-                 r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-                 g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-                 b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-                 a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = swap_endian_16x4(load<U64>(rgba));
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = load<U64>(rgba);
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -763,10 +820,21 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgb = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = vld3_u16(rgb);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                r = cast<F>(load_3<U32>(rgb+0)) * (1/65535.0f);
-+                g = cast<F>(load_3<U32>(rgb+1)) * (1/65535.0f);
-+                b = cast<F>(load_3<U32>(rgb+2)) * (1/65535.0f);
-+#else
-                 U32 R = load_3<U32>(rgb+0),
-                     G = load_3<U32>(rgb+1),
-                     B = load_3<U32>(rgb+2);
-@@ -774,6 +842,7 @@ static void exec_ops(const Op* ops, const void** args,
-                 r = cast<F>((R & 0x00ff)<<8 | (R & 0xff00)>>8) * (1/65535.0f);
-                 g = cast<F>((G & 0x00ff)<<8 | (G & 0xff00)>>8) * (1/65535.0f);
-                 b = cast<F>((B & 0x00ff)<<8 | (B & 0xff00)>>8) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -783,17 +852,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 const uint16_t* rgba = (const uint16_t*)ptr; // cast to const uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = vld4_u16(rgba);
-+#if __BIG_ENDIAN__
-+                r = cast<F>((U16)v.val[0]) * (1/65535.0f);
-+                g = cast<F>((U16)v.val[1]) * (1/65535.0f);
-+                b = cast<F>((U16)v.val[2]) * (1/65535.0f);
-+                a = cast<F>((U16)v.val[3]) * (1/65535.0f);
-+#else
-                 r = cast<F>(swap_endian_16((U16)v.val[0])) * (1/65535.0f);
-                 g = cast<F>(swap_endian_16((U16)v.val[1])) * (1/65535.0f);
-                 b = cast<F>(swap_endian_16((U16)v.val[2])) * (1/65535.0f);
-                 a = cast<F>(swap_endian_16((U16)v.val[3])) * (1/65535.0f);
-+#endif
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = load<U64>(rgba);
-+
-+                r = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+                g = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-+                b = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-+                a = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-+#else
-                 U64 px = swap_endian_16x4(load<U64>(rgba));
- 
-                 r = cast<F>((px >>  0) & 0xffff) * (1/65535.0f);
-                 g = cast<F>((px >> 16) & 0xffff) * (1/65535.0f);
-                 b = cast<F>((px >> 32) & 0xffff) * (1/65535.0f);
-                 a = cast<F>((px >> 48) & 0xffff) * (1/65535.0f);
-+#endif
-             #endif
-             } break;
- 
-@@ -828,10 +913,17 @@ static void exec_ops(const Op* ops, const void** args,
-                     A = (U16)v.val[3];
-             #else
-                 U64 px = load<U64>(rgba);
-+#if __BIG_ENDIAN__
-+                U16 R = cast<U16>((px >> 48) & 0xffff),
-+                    G = cast<U16>((px >> 32) & 0xffff),
-+                    B = cast<U16>((px >> 16) & 0xffff),
-+                    A = cast<U16>((px >>  0) & 0xffff);
-+#else
-                 U16 R = cast<U16>((px >>  0) & 0xffff),
-                     G = cast<U16>((px >> 16) & 0xffff),
-                     B = cast<U16>((px >> 32) & 0xffff),
-                     A = cast<U16>((px >> 48) & 0xffff);
-+#endif
-             #endif
-                 r = F_from_Half(R);
-                 g = F_from_Half(G);
-@@ -1024,10 +1116,17 @@ static void exec_ops(const Op* ops, const void** args,
-             } return;
- 
-             case Op_store_8888: {
-+#if __BIG_ENDIAN__
-+                store(dst + 4*i, cast<U32>(to_fixed(r * 255) << 24)
-+                               | cast<U32>(to_fixed(g * 255) << 16)
-+                               | cast<U32>(to_fixed(b * 255) <<  8)
-+                               | cast<U32>(to_fixed(a * 255) <<  0));
-+#else
-                 store(dst + 4*i, cast<U32>(to_fixed(r * 255) <<  0)
-                                | cast<U32>(to_fixed(g * 255) <<  8)
-                                | cast<U32>(to_fixed(b * 255) << 16)
-                                | cast<U32>(to_fixed(a * 255) << 24));
-+#endif
-             } return;
- 
-             case Op_store_1010102: {
-@@ -1043,15 +1142,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                I32 R = to_fixed(r * 65535),
-+                    G = to_fixed(g * 65535),
-+                    B = to_fixed(b * 65535);
-+                store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-+                store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-+                store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#else
-                 store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-                 store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-                 store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#endif
-             #endif
- 
-             } return;
-@@ -1062,18 +1176,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+                    (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#else
-                     (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-                     (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, swap_endian_16x4(px));
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, px);
-+#endif
-             #endif
-             } return;
- 
-@@ -1083,18 +1212,30 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgb = (uint16_t*)ptr;          // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x3_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-+#endif
-                 }};
-                 vst3_u16(rgb, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store_3(rgb+0, cast<U16>(to_fixed(r * 65535)));
-+                store_3(rgb+1, cast<U16>(to_fixed(g * 65535)));
-+                store_3(rgb+2, cast<U16>(to_fixed(b * 65535)));
-+#else
-                 I32 R = to_fixed(r * 65535),
-                     G = to_fixed(g * 65535),
-                     B = to_fixed(b * 65535);
-                 store_3(rgb+0, cast<U16>((R & 0x00ff) << 8 | (R & 0xff00) >> 8) );
-                 store_3(rgb+1, cast<U16>((G & 0x00ff) << 8 | (G & 0xff00) >> 8) );
-                 store_3(rgb+2, cast<U16>((B & 0x00ff) << 8 | (B & 0xff00) >> 8) );
-+#endif
-             #endif
- 
-             } return;
-@@ -1105,18 +1246,33 @@ static void exec_ops(const Op* ops, const void** args,
-                 uint16_t* rgba = (uint16_t*)ptr;        // for this cast to uint16_t* to be safe.
-             #if defined(USING_NEON)
-                 uint16x4x4_t v = {{
-+#if __BIG_ENDIAN__
-+                    (uint16x4_t)cast<U16>(to_fixed(r * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(g * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(b * 65535)),
-+                    (uint16x4_t)cast<U16>(to_fixed(a * 65535)),
-+#else
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(r * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(g * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(b * 65535))),
-                     (uint16x4_t)swap_endian_16(cast<U16>(to_fixed(a * 65535))),
-+#endif
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                U64 px = cast<U64>(to_fixed(r * 65535)) << 48
-+                       | cast<U64>(to_fixed(g * 65535)) << 32
-+                       | cast<U64>(to_fixed(b * 65535)) << 16
-+                       | cast<U64>(to_fixed(a * 65535)) <<  0;
-+                store(rgba, px);
-+#else
-                 U64 px = cast<U64>(to_fixed(r * 65535)) <<  0
-                        | cast<U64>(to_fixed(g * 65535)) << 16
-                        | cast<U64>(to_fixed(b * 65535)) << 32
-                        | cast<U64>(to_fixed(a * 65535)) << 48;
-                 store(rgba, swap_endian_16x4(px));
-+#endif
-             #endif
-             } return;
- 
-@@ -1160,10 +1316,17 @@ static void exec_ops(const Op* ops, const void** args,
-                 }};
-                 vst4_u16(rgba, v);
-             #else
-+#if __BIG_ENDIAN__
-+                store(rgba, cast<U64>(R) << 48
-+                          | cast<U64>(G) << 32
-+                          | cast<U64>(B) << 16
-+                          | cast<U64>(A) <<  0);
-+#else
-                 store(rgba, cast<U64>(R) <<  0
-                           | cast<U64>(G) << 16
-                           | cast<U64>(B) << 32
-                           | cast<U64>(A) << 48);
-+#endif
-             #endif
- 
-             } return;
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc
-@@ -93,13 +93,15 @@ size_t WavReader::num_samples() const {
- }
- 
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
-   // There could be metadata after the audio; ensure we don't read it.
-   num_samples = std::min(num_samples, num_samples_remaining_);
-   const size_t read =
-       fread(samples, sizeof(*samples), num_samples, file_handle_);
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+  for (size_t i = 0; i < read; i++) {
-+      samples[i] = __builtin_bswap16(samples[i]);
-+  }
-+#endif
-   // If we didn't read what was requested, ensure we've reached the EOF.
-   RTC_CHECK(read == num_samples || feof(file_handle_));
-   RTC_CHECK_LE(read, num_samples_remaining_);
-@@ -178,13 +180,26 @@ size_t WavWriter::num_samples() const {
- 
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+  static const size_t kChunksize = 4096 / sizeof(uint16_t);
-+  for (size_t i = 0; i < num_samples; i += kChunksize) {
-+    int16_t isamples[kChunksize];
-+    const size_t chunk = std::min(kChunksize, num_samples - i);
-+    for (size_t j = 0; j < chunk; j++) {
-+      isamples[j] = __builtin_bswap16(samples[i + j]);
-+    }
-+    const size_t written =
-+        fwrite(isamples, sizeof(*isamples), chunk, file_handle_);
-+    RTC_CHECK_EQ(chunk, written);
-+    num_samples_ += written;
-+    RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+  }
-+#else
-   const size_t written =
-       fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-   RTC_CHECK_EQ(num_samples, written);
-   num_samples_ += written;
-   RTC_CHECK(num_samples_ >= written);  // detect size_t overflow
-+#endif
- }
- 
- void WavWriter::WriteSamples(const float* samples, size_t num_samples) {
---- qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc
-@@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) {
-   return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+  *f = __builtin_bswap16(x);
-+}
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+  *f = __builtin_bswap32(x);
-+}
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+  *f = static_cast<uint32_t>(d) | static_cast<uint32_t>(c) << 8 |
-+       static_cast<uint32_t>(b) << 16 | static_cast<uint32_t>(a) << 24;
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+  return __builtin_bswap16(x);
-+}
-+static inline uint32_t ReadLE32(uint32_t x) {
-+  return __builtin_bswap32(x);
-+}
-+static inline std::string ReadFourCC(uint32_t x) {
-+  return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
- 
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
---- qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/aura/mus/os_exchange_data_provider_mus.cc
-@@ -14,6 +14,7 @@
- #include "base/strings/string_split.h"
- #include "base/strings/string_util.h"
- #include "base/strings/utf_string_conversions.h"
-+#include "base/sys_byteorder.h"
- #include "net/base/filename_util.h"
- #include "ui/base/clipboard/clipboard_constants.h"
- #include "ui/base/clipboard/clipboard_format_type.h"
-@@ -279,8 +280,13 @@ void OSExchangeDataProviderMus::SetHtml(const base::string16& html,
-   std::vector<unsigned char> bytes;
-   // Manually jam a UTF16 BOM into bytes because otherwise, other programs will
-   // assume UTF-8.
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-   bytes.push_back(0xFF);
-   bytes.push_back(0xFE);
-+#else
-+  bytes.push_back(0xFE);
-+  bytes.push_back(0xFF);
-+#endif
-   AddString16ToVector(html, &bytes);
-   mime_data_[ui::kMimeTypeHTML] = bytes;
- }
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc
-@@ -154,16 +154,42 @@ class ScopedFileWriter {
-   DISALLOW_COPY_AND_ASSIGN(ScopedFileWriter);
- };
- 
-+static inline uint16_t byteswap(uint16_t v) { return __builtin_bswap16(v); }
-+static inline uint32_t byteswap(uint32_t v) { return __builtin_bswap32(v); }
-+
-+template<class T> class byteswapped_t {
-+private:
-+  T value;
-+public:
-+  inline byteswapped_t(T v) : value(byteswap(v)) { }
-+  inline T operator=(T v) { value = byteswap(v); return v; }
-+  inline T operator+=(T v) { v += byteswap(value); value = byteswap(v); return v; }
-+  inline operator T() const { return byteswap(value); }
-+};
-+
-+#if !defined(ARCH_CPU_LITTLE_ENDIAN)
-+
-+typedef byteswapped_t<uint16_t> uint16le_t;
-+typedef byteswapped_t<uint32_t> uint32le_t;
-+
-+#else
-+
-+typedef uint16_t uint16le_t;
-+typedef uint32_t uint32le_t;
-+
-+#endif
-+
- }  // namespace
- 
- namespace ui {
- 
- #pragma pack(push, 2)
- struct DataPack::Entry {
--  uint16_t resource_id;
--  uint32_t file_offset;
-+  uint16le_t resource_id;
-+  uint32le_t file_offset;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Entry* entry = reinterpret_cast<const Entry*>(void_entry);
-     return key - entry->resource_id;
-@@ -171,10 +197,11 @@ struct DataPack::Entry {
- };
- 
- struct DataPack::Alias {
--  uint16_t resource_id;
--  uint16_t entry_index;
-+  uint16le_t resource_id;
-+  uint16le_t entry_index;
- 
-   static int CompareById(const void* void_key, const void* void_entry) {
-+    // Key is host endian
-     uint16_t key = *reinterpret_cast<const uint16_t*>(void_key);
-     const Alias* entry = reinterpret_cast<const Alias*>(void_entry);
-     return key - entry->resource_id;
-@@ -284,7 +311,7 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
-   // Parse the version and check for truncated header.
-   uint32_t version = 0;
-   if (data_length > sizeof(version))
--    version = reinterpret_cast<const uint32_t*>(data)[0];
-+    version = reinterpret_cast<const uint32le_t*>(data)[0];
-   size_t header_length =
-       version == kFileFormatV4 ? kHeaderLengthV4 : kHeaderLengthV5;
-   if (version == 0 || data_length < header_length) {
-@@ -295,14 +322,14 @@ bool DataPack::LoadImpl(std::unique_ptr<DataPack::DataSource> data_source) {
- 
-   // Parse the header of the file.
-   if (version == kFileFormatV4) {
--    resource_count_ = reinterpret_cast<const uint32_t*>(data)[1];
-+    resource_count_ = reinterpret_cast<const uint32le_t*>(data)[1];
-     alias_count_ = 0;
-     text_encoding_type_ = static_cast<TextEncodingType>(data[8]);
-   } else if (version == kFileFormatV5) {
-     // Version 5 added the alias table and changed the header format.
-     text_encoding_type_ = static_cast<TextEncodingType>(data[4]);
--    resource_count_ = reinterpret_cast<const uint16_t*>(data)[4];
--    alias_count_ = reinterpret_cast<const uint16_t*>(data)[5];
-+    resource_count_ = reinterpret_cast<const uint16le_t*>(data)[4];
-+    alias_count_ = reinterpret_cast<const uint16le_t*>(data)[5];
-   } else {
-     LOG(ERROR) << "Bad data pack version: got " << version << ", expected "
-                << kFileFormatV4 << " or " << kFileFormatV5;
-@@ -447,9 +474,6 @@ void DataPack::CheckForDuplicateResources(
- bool DataPack::WritePack(const base::FilePath& path,
-                          const std::map<uint16_t, base::StringPiece>& resources,
-                          TextEncodingType text_encoding_type) {
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
-   if (text_encoding_type != UTF8 && text_encoding_type != UTF16 &&
-       text_encoding_type != BINARY) {
-     LOG(ERROR) << "Invalid text encoding type, got " << text_encoding_type
-@@ -467,7 +491,7 @@ bool DataPack::WritePack(const base::FilePath& path,
-   if (!file.valid())
-     return false;
- 
--  uint32_t encoding = static_cast<uint32_t>(text_encoding_type);
-+  uint32le_t encoding = static_cast<uint32le_t>(text_encoding_type);
- 
-   // Build a list of final resource aliases, and an alias map at the same time.
-   std::vector<uint16_t> resource_ids;
-@@ -494,13 +518,14 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // These values are guaranteed to fit in a uint16_t due to the earlier
-   // check of |resources_count|.
--  const uint16_t alias_count = static_cast<uint16_t>(aliases.size());
--  const uint16_t entry_count = static_cast<uint16_t>(resource_ids.size());
-+  const uint16le_t alias_count = static_cast<uint16le_t>(aliases.size());
-+  const uint16le_t entry_count = static_cast<uint16le_t>(resource_ids.size());
-   DCHECK_EQ(static_cast<size_t>(entry_count) + static_cast<size_t>(alias_count),
-             resources_count);
- 
--  file.Write(&kFileFormatV5, sizeof(kFileFormatV5));
--  file.Write(&encoding, sizeof(uint32_t));
-+  uint32le_t version = kFileFormatV5;
-+  file.Write(&version, sizeof(version));
-+  file.Write(&encoding, sizeof(uint32le_t));
-   file.Write(&entry_count, sizeof(entry_count));
-   file.Write(&alias_count, sizeof(alias_count));
- 
-@@ -508,8 +533,8 @@ bool DataPack::WritePack(const base::FilePath& path,
-   // last item so we can compute the size of the list item.
-   const uint32_t index_length = (entry_count + 1) * sizeof(Entry);
-   const uint32_t alias_table_length = alias_count * sizeof(Alias);
--  uint32_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
--  for (const uint16_t resource_id : resource_ids) {
-+  uint32le_t data_offset = kHeaderLengthV5 + index_length + alias_table_length;
-+  for (const uint16le_t resource_id : resource_ids) {
-     file.Write(&resource_id, sizeof(resource_id));
-     file.Write(&data_offset, sizeof(data_offset));
-     data_offset += resources.find(resource_id)->second.length();
-@@ -517,13 +542,13 @@ bool DataPack::WritePack(const base::FilePath& path,
- 
-   // We place an extra entry after the last item that allows us to read the
-   // size of the last item.
--  const uint16_t resource_id = 0;
-+  const uint16le_t resource_id = 0;
-   file.Write(&resource_id, sizeof(resource_id));
-   file.Write(&data_offset, sizeof(data_offset));
- 
-   // Write the aliases table, if any. Note: |aliases| is an std::map,
-   // ensuring values are written in increasing order.
--  for (const std::pair<uint16_t, uint16_t>& alias : aliases) {
-+  for (const std::pair<uint16le_t, uint16le_t> alias : aliases) {
-     file.Write(&alias, sizeof(alias));
-   }
- 
---- qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-+++ qtwebengine/src/3rdparty/chromium/ui/base/resource/data_pack.cc.orig
-@@ -382,12 +382,6 @@ bool DataPack::HasResource(uint16_t resource_id) const {
- 
- bool DataPack::GetStringPiece(uint16_t resource_id,
-                               base::StringPiece* data) const {
--  // It won't be hard to make this endian-agnostic, but it's not worth
--  // bothering to do right now.
--#if !defined(ARCH_CPU_LITTLE_ENDIAN)
--#error "datapack assumes little endian"
--#endif
--
-   const Entry* target = LookupEntryById(resource_id);
-   if (!target)
-     return false;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/jpeg_codec.cc
-@@ -212,11 +212,11 @@ bool JPEGCodec::Decode(const unsigned char* input, size_t input_size,
-       // used by Chromium (i.e. RGBA and BGRA) and we just map the input
-       // parameters to a colorspace.
-       if (format == FORMAT_RGBA ||
--          (format == FORMAT_SkBitmap && SK_R32_SHIFT == 0)) {
-+          (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(R, G, B, A))) {
-         cinfo->out_color_space = JCS_EXT_RGBX;
-         cinfo->output_components = 4;
-       } else if (format == FORMAT_BGRA ||
--                 (format == FORMAT_SkBitmap && SK_B32_SHIFT == 0)) {
-+                 (format == FORMAT_SkBitmap && SK_PMCOLOR_BYTE_ORDER(B, G, R, A))) {
-         cinfo->out_color_space = JCS_EXT_BGRX;
-         cinfo->output_components = 4;
-       } else {
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.cc
-@@ -169,6 +169,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         png_set_bgr(png_ptr);
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+        png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_BEFORE);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
-@@ -183,6 +187,10 @@ void DecodeInfoCallback(png_struct* png_ptr, png_info* info_ptr) {
-         state->output_channels = 4;
-         png_set_bgr(png_ptr);
-         break;
-+      case PNGCodec::FORMAT_ARGB:
-+        state->output_channels = 4;
-+	png_set_swap_alpha(png_ptr);
-+        break;
-       case PNGCodec::FORMAT_SkBitmap:
-         state->output_channels = 4;
-         break;
-@@ -475,6 +483,8 @@ bool PNGCodec::Encode(const unsigned char* input,
-     case FORMAT_BGRA:
-       colorType = kBGRA_8888_SkColorType;
-       break;
-+    case FORMAT_ARGB:
-+      return false;
-     case FORMAT_SkBitmap:
-       colorType = kN32_SkColorType;
-       break;
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec.h
-@@ -37,6 +37,10 @@ class CODEC_EXPORT PNGCodec {
-     // This is the default Windows DIB order.
-     FORMAT_BGRA,
- 
-+    // 4 bytes per pixel, in ARGB order in memory regardless of endianness.
-+    // Only supported for decoding
-+    FORMAT_ARGB,
-+
-     // SkBitmap format. For Encode() kN32_SkColorType (4 bytes per pixel) and
-     // kAlpha_8_SkColorType (1 byte per pixel) formats are supported.
-     // kAlpha_8_SkColorType gets encoded into a grayscale PNG treating alpha as
---- qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/codec/png_codec_unittest.cc
-@@ -853,7 +853,7 @@ TEST(PNGCodec, EncodeA8SkBitmap) {
-     for (int y = 0; y < h; y++) {
-       uint8_t original_pixel = *original_bitmap.getAddr8(x, y);
-       uint32_t decoded_pixel = *decoded_bitmap.getAddr32(x, y);
--      EXPECT_TRUE(BGRAGrayEqualsA8Gray(decoded_pixel, original_pixel));
-+      EXPECT_TRUE(BGRAGrayEqualsA8Gray(SkUnPreMultiply::PMColorToColor(decoded_pixel), original_pixel));
-     }
-   }
- }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/color_analysis.cc
-@@ -16,6 +16,7 @@
- #include <vector>
- 
- #include "base/logging.h"
-+#include "base/sys_byteorder.h"
- #include "third_party/skia/include/core/SkBitmap.h"
- #include "third_party/skia/include/core/SkUnPreMultiply.h"
- #include "ui/gfx/codec/png_codec.h"
-@@ -506,10 +507,17 @@ SkColor FindClosestColor(const uint8_t* image,
-   SkColor best_color = color;
-   const uint8_t* byte = image;
-   for (int i = 0; i < width * height; ++i) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-     uint8_t b = *(byte++);
-     uint8_t g = *(byte++);
-     uint8_t r = *(byte++);
-     uint8_t a = *(byte++);
-+#else
-+    uint8_t a = *(byte++);
-+    uint8_t r = *(byte++);
-+    uint8_t g = *(byte++);
-+    uint8_t b = *(byte++);
-+#endif
-     // Ignore fully transparent pixels.
-     if (a == 0)
-       continue;
-@@ -527,7 +535,6 @@ SkColor FindClosestColor(const uint8_t* image,
- 
- // For a 16x16 icon on an Intel Core i5 this function takes approximately
- // 0.5 ms to run.
--// TODO(port): This code assumes the CPU architecture is little-endian.
- SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-                                     int img_width,
-                                     int img_height,
-@@ -550,10 +557,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-         int pixel_pos = sampler->GetSample(img_width, img_height) %
-             (img_width * img_height);
- 
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = decoded_data[pixel_pos * 4];
-         uint8_t g = decoded_data[pixel_pos * 4 + 1];
-         uint8_t r = decoded_data[pixel_pos * 4 + 2];
-         uint8_t a = decoded_data[pixel_pos * 4 + 3];
-+#else
-+        uint8_t a = decoded_data[pixel_pos * 4];
-+        uint8_t r = decoded_data[pixel_pos * 4 + 1];
-+        uint8_t g = decoded_data[pixel_pos * 4 + 2];
-+        uint8_t b = decoded_data[pixel_pos * 4 + 3];
-+#endif
-         // Skip fully transparent pixels as they usually contain black in their
-         // RGB channels but do not contribute to the visual image.
-         if (a == 0)
-@@ -602,10 +616,17 @@ SkColor CalculateKMeanColorOfBuffer(uint8_t* decoded_data,
-       uint8_t* pixel = decoded_data;
-       uint8_t* decoded_data_end = decoded_data + (img_width * img_height * 4);
-       while (pixel < decoded_data_end) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-         uint8_t b = *(pixel++);
-         uint8_t g = *(pixel++);
-         uint8_t r = *(pixel++);
-         uint8_t a = *(pixel++);
-+#else
-+        uint8_t a = *(pixel++);
-+        uint8_t r = *(pixel++);
-+        uint8_t g = *(pixel++);
-+        uint8_t b = *(pixel++);
-+#endif
-         // Skip transparent pixels, see above.
-         if (a == 0)
-           continue;
-@@ -683,8 +704,12 @@ SkColor CalculateKMeanColorOfPNG(scoped_refptr<base::RefCountedMemory> png,
- 
-   if (png.get() && png->size() &&
-       gfx::PNGCodec::Decode(png->front(), png->size(),
--                            gfx::PNGCodec::FORMAT_BGRA, &decoded_data,
--                            &img_width, &img_height)) {
-+#if defined(ARCH_CPU_LITTLE_ENDIAN)
-+                            gfx::PNGCodec::FORMAT_BGRA,
-+#else
-+                            gfx::PNGCodec::FORMAT_ARGB,
-+#endif
-+			    &decoded_data, &img_width, &img_height)) {
-     return CalculateKMeanColorOfBuffer(&decoded_data[0], img_width, img_height,
-                                        lower_bound, upper_bound, sampler, true);
-   }
---- qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-+++ qtwebengine/src/3rdparty/chromium/ui/gfx/skbitmap_operations_unittest.cc
-@@ -238,7 +238,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
- 
-   for (int y = 0, i = 0; y < src_h; y++) {
-     for (int x = 0; x < src_w; x++) {
--      *src.getAddr32(x, y) = SkColorSetARGB(255, 0, 0, i % 255);
-+      *src.getAddr32(x, y) = SkPackARGB32(255, 0, 0, i % 255);
-       i++;
-     }
-   }
---- qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_host.cc
-@@ -135,8 +135,7 @@ bool DoSimpleHost(const INCHAR* host,
-     if (source == '%') {
-       // Unescape first, if possible.
-       // Source will be used only if decode operation was successful.
--      if (!DecodeEscaped(host, &i, host_len,
--                         reinterpret_cast<unsigned char*>(&source))) {
-+      if (!DecodeEscaped(host, &i, host_len, &source)) {
-         // Invalid escaped character. There is nothing that can make this
-         // host valid. We append an escaped percent so the URL looks reasonable
-         // and mark as failed.
---- qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-+++ qtwebengine/src/3rdparty/chromium/url/url_canon_internal.h
-@@ -305,9 +305,9 @@ inline bool Is8BitChar(base::char16 c) {
-   return c <= 255;
- }
- 
--template<typename CHAR>
-+template<typename CHAR, typename DST>
- inline bool DecodeEscaped(const CHAR* spec, int* begin, int end,
--                          unsigned char* unescaped_value) {
-+                          DST* unescaped_value) {
-   if (*begin + 3 > end ||
-       !Is8BitChar(spec[*begin + 1]) || !Is8BitChar(spec[*begin + 2])) {
-     // Invalid escape sequence because there's not enough room, or the
diff --git a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch b/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
deleted file mode 100644
index f580c814697..00000000000
--- a/srcpkgs/qt5/patches/0093-chromium-v8-elfv2.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-This fixes v8 on big endian ppc64 ELFv2.
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/constants-ppc.h
-@@ -21,7 +21,8 @@
- #endif
- 
- #if V8_HOST_ARCH_PPC && \
--    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
-+    (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
-+      (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
- #define ABI_USES_FUNCTION_DESCRIPTORS 1
- #else
- #define ABI_USES_FUNCTION_DESCRIPTORS 0
-@@ -33,13 +34,15 @@
- #define ABI_PASSES_HANDLES_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
-+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
- #else
- #define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
- #endif
- 
--#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
-+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
-+    (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
- #define ABI_CALL_VIA_IP 1
- #else
- #define ABI_CALL_VIA_IP 0
---- qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-+++ qtwebengine/src/3rdparty/chromium/v8/src/ppc/register-ppc.h
-@@ -145,7 +145,8 @@ const int kNumSafepointRegisters = 32;
- // The following constants describe the stack frame linkage area as
- // defined by the ABI.  Note that kNumRequiredStackFrameSlots must
- // satisfy alignment requirements (rounding up if required).
--#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN  // ppc64le linux
-+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
-+    defined(_CALL_ELF) && _CALL_ELF == 2)
- // [0] back chain
- // [1] condition register save area
- // [2] link register save area
diff --git a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch b/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
deleted file mode 100644
index ea269d383d1..00000000000
--- a/srcpkgs/qt5/patches/0094-big-endian-skia-portable.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-+++ qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/skcms/skcms.cc
-@@ -1828,6 +1828,14 @@ typedef enum {
-     #endif
- #endif
- 
-+// with current gcc 8.3.0 we get an internal compiler error when compiling
-+// for ppc64 big endian - so switch to portable until this is resolved
-+#if defined(__powerpc64__)
-+#  if defined(__BIG_ENDIAN__) && !defined(SKCMS_PORTABLE)
-+#    define SKCMS_PORTABLE
-+#  endif
-+#endif
-+
- #if defined(__clang__)
-     template <int N, typename T> using Vec = T __attribute__((ext_vector_type(N)));
- #elif defined(__GNUC__)
diff --git a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch b/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
deleted file mode 100644
index 15c33a57f03..00000000000
--- a/srcpkgs/qt5/patches/0100-sandbox-sched_getparam.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Allow SYS_sched_getparam and SYS_sched_getscheduler
-musl uses them for pthread_getschedparam()
-
-source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
-
---- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-11-12 20:48:20.013724661 +0100
-+++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc.patched	2019-11-12 20:58:57.330695676 +0100
-@@ -93,10 +93,16 @@
-     case __NR_sysinfo:
-     case __NR_times:
-     case __NR_uname:
-+#if !defined(__GLIBC__)
-+    case __NR_sched_getparam:
-+    case __NR_sched_getscheduler:
-+#endif
-       return Allow();
-     case __NR_sched_getaffinity:
-+#if defined(__GLIBC__)
-     case __NR_sched_getparam:
-     case __NR_sched_getscheduler:
-+#endif
-     case __NR_sched_setscheduler:
-       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
-     case __NR_prlimit64:
diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 1437a9091b9..245dc3d83cc 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -1,86 +1,31 @@
 # Template file for 'qt5'
 pkgname=qt5
-version=5.13.2
-revision=2
+version=5.14.2
+revision=1
+build_style=meta
 wrksrc="qt-everywhere-src-${version}"
-build_style=gnu-configure
-hostmakedepends="cmake clang flex git glib-devel gperf ninja pkg-config
- protobuf python re2c ruby which"
+hostmakedepends="cmake clang flex git glib-devel pkg-config
+ python re2c ruby which"
 makedepends="SDL2-devel Vulkan-Headers alsa-lib-devel double-conversion-devel
  eudev-libudev-devel ffmpeg-devel freetds-devel glib-devel gst-plugins-base1-devel
- gtk+3-devel icu-devel jsoncpp-devel libXv-devel libbluetooth-devel libcap-devel
- libevent-devel libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
- libvpx-devel libwebp-devel libxslt-devel minizip-devel nss-devel cups-devel
+ gtk+3-devel icu-devel libXv-devel libbluetooth-devel libcap-devel
+ libinput-devel libmng-devel libmysqlclient-devel libproxy-devel
+ libvpx-devel libwebp-devel libxslt-devel cups-devel
  opus-devel pciutils-devel pcre2-devel postgresql-libs-devel
- protobuf-devel pulseaudio-devel snappy-devel tslib-devel
+ protobuf-devel pulseaudio-devel tslib-devel libressl-devel
  unixodbc-devel xcb-util-image-devel xcb-util-keysyms-devel
  xcb-util-renderutil-devel xcb-util-wm-devel libzstd-devel harfbuzz-devel"
-depends="qtchooser"
+depends="qt5-dbus qt5-gui qt5-core qt5-widgets qt5-network qt5-xml
+ qt5-test qt5-sql qt5-concurrent qt5-printsupport qt5-opengl"
 short_desc="Cross-platform application and UI framework (QT5)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="https://qt.io/"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+checksum=c6fcd53c744df89e7d3223c02838a33309bd1c291fcb6f9341505fe99f7f19fa
 replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0 qt5-webkit-devel<5.6.0
  qt5-enginio<5.7.1 qt5-enginio-devel<5.7.1 qt5-plugin-gtk<5.7.1 qt5-canvas3d<5.13.0"
-
-build_options="webengine"
-desc_option_webengine="Build Chromium-based WebEngine component"
-
-makedepends+=" harfbuzz-devel"
-
-if [ "$XBPS_LIBC" = "musl" ]; then
-	hostmakedepends+=" musl-legacy-compat"
-fi
-if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-	makedepends+=" musl-legacy-compat"
-fi
-
-case "$XBPS_TARGET_MACHINE" in
-	armv5tel*) ;; # qtwebengine uses VSM assembler commands
-	ppc|ppc-musl) ;; # qtwebengine does not support ppc 32 bit
-	*) if [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
-		# webengine can be built only if word size matches
-		build_options_default="webengine"
-	fi;;
-esac
-
-if [ "$build_option_webengine" ]; then
-	if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
-		makedepends+=" libatomic-devel"
-	fi
-	if [ "$XBPS_NO_ATOMIC8" ]; then
-		hostmakedepends+=" libatomic-devel"
-	fi
-fi
-
-subpackages="qt5-3d qt5-3d-devel qt5-charts qt5-charts-devel
- qt5-connectivity qt5-connectivity-devel qt5-datavis3d qt5-datavis3d-devel
- qt5-declarative qt5-declarative-devel qt5-devel qt5-examples qt5-gamepad
- qt5-gamepad-devel qt5-graphicaleffects qt5-host-tools qt5-imageformats
- qt5-location qt5-location-devel qt5-multimedia qt5-multimedia-devel
- qt5-networkauth qt5-networkauth-devel qt5-plugin-mysql qt5-plugin-odbc
- qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds qt5-purchasing
- qt5-purchasing-devel qt5-qmake qt5-quickcontrols qt5-quickcontrols2
- qt5-quickcontrols2-devel qt5-remoteobjects qt5-remoteobjects-devel
- qt5-script qt5-script-devel qt5-scxml qt5-scxml-devel qt5-sensors
- qt5-sensors-devel qt5-serialbus qt5-serialbus-devel qt5-serialport
- qt5-serialport-devel qt5-speech qt5-speech-devel qt5-svg qt5-svg-devel
- qt5-tools qt5-tools-devel qt5-translations qt5-virtualkeyboard
- qt5-virtualkeyboard-devel qt5-wayland qt5-wayland-devel qt5-webchannel
- qt5-webchannel-devel qt5-webglplugin qt5-webglplugin-devel qt5-websockets
- qt5-websockets-devel qt5-webview qt5-webview-devel qt5-x11extras
- qt5-x11extras-devel qt5-xmlpatterns qt5-xmlpatterns-devel
- qt5-lottie qt5-lottie-devel"
-
-if [ "$build_option_webengine" ]; then
-	subpackages+=" qt5-webengine qt5-webengine-devel"
-fi
-
-if [ "$XBPS_WORDSIZE" -eq 32 ]; then
-	nodebug=yes  # prevent OOM
-fi
+lib32mode=full
 
 # Work around SSLv3_{client,server}_method missing in libressl-2.3.3
 CFLAGS="-DOPENSSL_NO_PSK -DOPENSSL_NO_NEXTPROTONEG"
@@ -93,26 +38,8 @@ if [ "$CROSS_BUILD" ]; then
 	# wayland-devel contains /usr/bin/wayland-scanner
 	hostmakedepends+=" icu-devel wayland-devel zlib-devel"
 	hostmakedepends+=" postgresql-libs-devel"
-	# Cross building qtwebengine requires some more host packages
-	if [ "$build_option_webengine" ]; then
-		hostmakedepends+=" nss-devel libevent-devel"
-	fi
 fi
 
-_bootstrap_gn() {
-	# Bootstrap gn (generate ninja)
-	echo "Bootstrapping 'gn'"
-	cd ${wrksrc}/qtwebengine/src/3rdparty/gn
-	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
-	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
-		python2 build/gen.py --no-last-commit-position --out-path \
-			${wrksrc}/qtwebengine/src/3rdparty/gn/out/Release --cc "$CC_host" \
-			--cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
-	ninja -C out/Release gn
-	cd ${wrksrc}
-}
-
-
 _cleanup_wrksrc_leak() {
 	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
 		# Replace references to ${wrksrc} in cmake files
@@ -167,6 +94,11 @@ _install_devel() {
 	local module=$1
 	cd ${wrksrc}/${module}
 	make INSTALL_ROOT=${PKGDESTDIR} install
+	vmkdir usr/lib/qt5/mkspecs/modules
+	if [ -d "${PKGDESTDIR}${wrksrc}/host/mkspecs/modules" ]; then
+		mv -nv ${PKGDESTDIR}${wrksrc}/host/mkspecs/modules/* \
+			${PKGDESTDIR}/usr/lib/qt5/mkspecs/modules/
+	fi
 	rm -rf ${PKGDESTDIR}/builddir
 	rm -rf ${PKGDESTDIR}/usr/share
 	rm -rf ${PKGDESTDIR}/usr/lib/qt5/bin
@@ -237,32 +169,6 @@ _msg_cross() {
 do_configure() {
 	local opts spec
 
-	# Compatibility functions res_ninit() and res_nclose() for musl libc
-	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/qtwebengine/src/3rdparty/chromium/net/dns
-
-	case "$XBPS_TARGET_MACHINE" in
-	armv5*|armv6*)	# Disable "yield" assembler instruction
-		sed -i qtwebengine/src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
-			qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
-			-e 's;"yield";"nop";'
-		;;
-	esac
-
-	case "$XBPS_TARGET_MACHINE" in
-	*-musl)
-		# Patch .../linux/*/config.{h,asm} to define HAVE_SYSCTL 0
-		local config chromium=${wrksrc}/qtwebengine/src/3rdparty/chromium
-		for config in $(find ${chromium}/third_party/ffmpeg/chromium/config -name "config\.*" | grep linux); do
-			sed -i ${config} -e "s;HAVE_SYSCTL 1;HAVE_SYSCTL 0;"
-		done
-		# Do not use allocator shim (incompatible with musl libc)
-		sed -i qtwebengine/src/3rdparty/chromium/build/config/allocator.gni \
-			-e "s;\(use_allocator_shim\) = .*;\1 = false;"
-		# Define to set 2 MiB stack size for qthread
-		export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152"
-		;;
-	esac
-
 	# Cross build patches
 	if [ "$CROSS_BUILD" ]; then
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
@@ -275,28 +181,6 @@ do_configure() {
 		for d in $(ls ${wrksrc}/qtbase/include); do
 			ln -sfv ${version}/${d}/private qtbase/include/${d}/private
 		done
-		if [ "$build_option_webengine" ]; then
-			_bootstrap_gn
-		fi
-
-		case "$XBPS_TARGET_MACHINE" in
-		mips*)	# sgidefs.h is in /usr/include/asm
-			for f in \
-				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
-				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
-				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
-				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
-				sed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
-			done
-			# Assume that RGBA order is correct for big endian CPUs
-			sed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
-				-e '/#error Read the comment at this location/d'
-			;;
-		esac
-		patch -Np0 < ${FILESDIR}/0090-hard-disable-qmlchachegen.patch
 	else
 		# qmake {CXX,L}FLAGS patches
 		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
@@ -344,29 +228,11 @@ do_configure() {
 	opts+=" -system-zlib"
 	opts+=" -system-sqlite"
 	opts+=" -system-harfbuzz"
-	# Rely on auto detection (fails if forced for cross builds)
-	if [ "$build_option_webengine" ]; then
-		# opts+=" -webengine-alsa"
-		opts+=" -no-webengine-embedded-build"
-		opts+=" -webengine-icu"
-		opts+=" -webengine-ffmpeg"
-		opts+=" -webengine-opus"
-		opts+=" -webengine-webp"
-		opts+=" -webengine-pepper-plugins"
-		opts+=" -webengine-printing-and-pdf"
-		opts+=" -webengine-proprietary-codecs"
-		opts+=" -webengine-pulseaudio"
-		opts+=" -webengine-spellchecker"
-		opts+=" -webengine-webrtc"
-		opts+=" -webengine-geolocation"
-		opts+=" -webengine-v8-snapshot"
-	fi
+	opts+=" -no-feature-eglfs_brcm" # missing include path
 	opts+=" -silent"
 	# opts+=" -v"
-	# make sure to disable webengine on platforms that we don't build it for
-	if [ -z "$build_option_webengine" ]; then
-		opts+=" -skip qtwebengine"
-	fi
+	opts+=" -skip qtwebengine"
+	opts+=" -skip qtwebview"
 	LDFLAGS+=" -Wl,--no-keep-memory"  # needs more than 8GB RAM else
 	if [ "$CROSS_BUILD" ]; then
 		spec=void-${XBPS_CROSS_TRIPLET}-g++
@@ -376,33 +242,13 @@ do_configure() {
 		opts+=" -sysroot ${XBPS_CROSS_BASE}"
 		opts+=" -hostprefix host"
 		opts+=" -extprefix /usr"
-		case "$XBPS_TARGET_MACHINE" in
-		arm*|mips*)
-			if [ "$build_option_webengine" ]; then
-				# V8 snapshot can't be built with a 64 bit host compiler
-				opts+=" -no-webengine-v8-snapshot"
-			fi
-			;;
-		esac
-		case "$XBPS_TARGET_MACHINE" in
-		aarch64*|armv7*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;false;true;"
-			;;
-		arm*)
-			sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-				-e "/arm_use_neon=/s;true;false;"
-
-			;;
-		esac
-		sed -i ${wrksrc}/qtwebengine/src/core/config/linux.pri \
-			-e "/equals(MARMV/s;true;false;"
 
 		# Make sure libQt5Designer is built
 		cp -v ${FILESDIR}/qttools_src.pro qttools/src/src.pro
 		cp -v ${FILESDIR}/designer_src.pro qttools/src/designer/src/src.pro
 		cp -v ${FILESDIR}/assistant.pro qttools/src/assistant/assistant.pro
 		cp -v ${FILESDIR}/linguist.pro qttools/src/linguist/linguist.pro
+		cp -v ${FILESDIR}/uitools.pro qttools/src/designer/src/uitools/uitools.pro
 	fi
 
 	CC="cc" CXX="c++" CPP="cpp" LD="c++" AR="ar" AS="as" NM="nm" \
@@ -415,10 +261,10 @@ do_configure() {
 }
 
 do_build() {
-	export NINJAJOBS=${makejobs}
 	# Run make twice because sometimes a file "chrome/grit/generated_resources.h"
 	# is not yet ready when it is to be included. Repeating make works around that
 	# problem without having to resort to disable_parallel_build=yes
+	# or some other files
 	make ${makejobs} || make ${makejobs}
 }
 
@@ -490,12 +336,15 @@ do_install() {
 		#
 		dirs+=" qtdeclarative/tools/qmlmin"
 		dirs+=" qtdeclarative/tools/qmllint"
+		dirs+=" qtdeclarative/tools/qmlcachegen"
 		dirs+=" qtdeclarative/tools/qmlimportscanner"
 		dirs+=" qtbase/src/tools/moc"
 		dirs+=" qtbase/src/tools/rcc"
 		dirs+=" qtbase/src/tools/uic"
 		dirs+=" qtbase/src/tools/qdbuscpp2xml"
 		dirs+=" qtbase/src/tools/qdbusxml2cpp"
+		dirs+=" qtbase/src/tools/qvkgen"
+		dirs+=" qtbase/src/tools/tracegen"
 		dirs+=" qtbase/src/tools/qlalr"
 		dirs+=" qt3d/tools/qgltf"
 		dirs+=" qtremoteobjects/tools/repc"
@@ -567,6 +416,102 @@ do_install() {
 	rm -rf ${DESTDIR}/builddir
 }
 
+qt5-gui_package() {
+	short_desc+=" - Gui"
+	pkg_install() {
+		vmove "usr/lib/libQt5Gui.so*"
+		vmove "usr/lib/libQt5XcbQpa.so*"
+		vmove "usr/lib/libQt5EglFSDeviceIntegration.so*"
+		vmove "usr/lib/libQt5EglFsKmsSupport.so*"
+		vmove usr/lib/qt5/plugins/generic
+		vmove usr/lib/qt5/plugins/platforms
+		vmove usr/lib/qt5/plugins/xcbglintegrations
+		vmove usr/lib/qt5/plugins/imageformats
+		vmove usr/lib/qt5/plugins/egldeviceintegrations
+		vmove usr/lib/qt5/plugins/platforminputcontexts
+		vmove usr/lib/qt5/plugins/platformthemes
+	}
+}
+
+qt5-dbus_package() {
+	short_desc+=" - DBus"
+	pkg_install() {
+		vmove "usr/lib/libQt5DBus.so*"
+	}
+}
+
+qt5-core_package() {
+	short_desc+=" - Core"
+	pkg_install() {
+		vmove "usr/lib/libQt5Core.so*"
+	}
+}
+
+qt5-opengl_package() {
+	short_desc+=" - OpenGL"
+	pkg_install() {
+		vmove "usr/lib/libQt5OpenGL.so*"
+	}
+}
+
+qt5-printsupport_package() {
+	short_desc+=" - Print Support"
+	pkg_install() {
+		vmove "usr/lib/libQt5PrintSupport.so*"
+		vmove usr/lib/qt5/plugins/printsupport
+	}
+}
+
+qt5-concurrent_package() {
+	short_desc+=" - Concurrency"
+	pkg_install() {
+		vmove "usr/lib/libQt5Concurrent.so*"
+	}
+}
+
+qt5-widgets_package() {
+	short_desc+=" - Widgets"
+	pkg_install() {
+		vmove "usr/lib/libQt5Widgets.so*"
+	}
+}
+
+qt5-network_package() {
+	short_desc+=" - Network"
+	pkg_install() {
+		vmove "usr/lib/libQt5Network.so*"
+		vmove usr/lib/qt5/plugins/bearer
+	}
+}
+
+qt5-sql_package() {
+	short_desc+=" - Sql"
+	pkg_install() {
+		vmove "usr/lib/libQt5Sql.so*"
+	}
+}
+
+qt5-test_package() {
+	short_desc+=" - Test"
+	pkg_install() {
+		vmove "usr/lib/libQt5Test.so*"
+	}
+}
+
+qt5-xml_package() {
+	short_desc+=" - Xml"
+	pkg_install() {
+		vmove "usr/lib/libQt5Xml.so*"
+	}
+}
+
+qt5-base-docs_package() {
+	short_desc+=" - Documentation"
+	pkg_install() {
+		vmove usr/share/doc/qt5
+	}
+}
+
 qt5-3d-devel_package() {
 	short_desc+=" - C++ and QML APIs for 3D graphics (development)"
 	depends="qt5-3d-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -640,7 +585,7 @@ qt5-declarative_package() {
 	short_desc+=" - Declarative component"
 	pkg_install() {
 		_install_subpkg qtdeclarative
-		_move_target_binaries qmlmin qmllint qmlimportscanner
+		_move_target_binaries qmlmin qmllint qmlimportscanner qmlcachegen
 	}
 }
 
@@ -787,6 +732,13 @@ qt5-quickcontrols2_package() {
 	}
 }
 
+qt5-quicktimeline_package() {
+	short_desc+=" - Keyframe-based animations"
+	pkg_install() {
+		_install_subpkg qtquicktimeline
+	}
+}
+
 qt5-remoteobjects-devel_package() {
 	short_desc+=" - Remote Objects (development)"
 	depends="qt5-remoteobjects-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -955,21 +907,6 @@ qt5-webchannel_package() {
 	}
 }
 
-qt5-webengine-devel_package() {
-	short_desc+=" - WebEngine component (development)"
-	depends="qt5-webengine-${version}_${revision} qt5-devel-${version}_${revision}"
-	pkg_install() {
-		_install_devel qtwebengine
-	}
-}
-
-qt5-webengine_package() {
-	short_desc+=" - WebEngine component"
-	pkg_install() {
-		_install_subpkg qtwebengine
-	}
-}
-
 qt5-webglplugin-devel_package() {
 	short_desc+=" - WebGL plugin (development)"
 	depends="qt5-webglplugin-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -1000,21 +937,6 @@ qt5-websockets_package() {
 	}
 }
 
-qt5-webview-devel_package() {
-	short_desc+=" - WebView component (development)"
-	depends="qt5-webview-${version}_${revision} qt5-devel-${version}_${revision}"
-	pkg_install() {
-		_install_devel qtwebview
-	}
-}
-
-qt5-webview_package() {
-	short_desc+=" - WebView component"
-	pkg_install() {
-		_install_subpkg qtwebview
-	}
-}
-
 qt5-x11extras-devel_package() {
 	short_desc+=" - X11 extras (development)"
 	depends="qt5-x11extras-${version}_${revision} qt5-devel-${version}_${revision}"
@@ -1040,6 +962,7 @@ qt5-xmlpatterns-devel_package() {
 
 qt5-xmlpatterns_package() {
 	short_desc+=" - XML components"
+	depends="qtchooser"
 	pkg_install() {
 		_install_subpkg qtxmlpatterns
 	}
@@ -1054,12 +977,13 @@ qt5-translations_package() {
 
 qt5-host-tools_package() {
 	short_desc+=" - Tools required when cross compiling"
+	depends="qtchooser"
 	pkg_install() {
 		local dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-tools-${version}
 		vmkdir usr/lib/qt5/bin
 		vmkdir usr/bin
-		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp \
-			lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
+		for f in moc rcc uic qlalr qdbuscpp2xml qdbusxml2cpp qvkgen fixqt4headers.pl tracegen \
+			syncqt.pl lconvert lupdate lupdate-pro lprodump lrelease lrelease-pro; do
 			if [ -r ${dest}/usr/lib/qt5/bin/${f} ]; then
 				mv -v ${dest}/usr/lib/qt5/bin/${f} ${PKGDESTDIR}/usr/lib/qt5/bin/
 			fi
@@ -1088,7 +1012,7 @@ qt5-tools-devel_package() {
 
 qt5-tools_package() {
 	short_desc+=" - Development tools"
-	depends="qt5-translations desktop-file-utils hicolor-icon-theme"
+	depends="qtchooser qt5-translations desktop-file-utils hicolor-icon-theme"
 	pkg_install() {
 		local f dest=${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/qt5-host-tools-${version}
 		_install_subpkg qttools
@@ -1129,8 +1053,19 @@ qt5-tools_package() {
 qt5-devel_package() {
 	depends="zlib-devel libressl-devel>=2.1.4 libXext-devel libXrender-devel
 		fontconfig-devel libglib-devel MesaLib-devel mtdev-devel
-		dbus-devel icu-devel cups-devel qt5-${version}_${revision}
+		dbus-devel icu-devel cups-devel
+		qt5-gui-${version}_${revision}
+		qt5-dbus-${version}_${revision}
+		qt5-core-${version}_${revision}
+		qt5-widgets-${version}_${revision}
 		qt5-qmake-${version}_${revision}
+		qt5-opengl-${version}_${revision}
+		qt5-printsupport-${version}_${revision}
+		qt5-concurrent-${version}_${revision}
+		qt5-sql-${version}_${revision}
+		qt5-test-${version}_${revision}
+		qt5-network-${version}_${revision}
+		qt5-xml-${version}_${revision}
 		qt5-host-tools-${version}_${revision}"
 	short_desc+=" - Development files"
 	# qt5-enginio-devel is gone
@@ -1181,6 +1116,7 @@ qt5-plugin-tds_package() {
 
 qt5-qmake_package() {
 	short_desc+=" - Qmake Makefile generator tool"
+	depends="qtchooser"
 	pkg_install() {
 		vmove usr/lib/qt5/bin/qmake
 		vmove usr/lib/qt5/mkspecs
@@ -1208,3 +1144,13 @@ qt5-qmake_package() {
 		fi
 	}
 }
+
+qt5-xcb-private-headers_package() {
+	short_desc+=" - Private headers for Qt5 Xcb"
+	depends="qt5-devel"
+	pkg_install() {
+		for f in ${wrksrc}/qtbase/src/plugins/platforms/xcb/*.h; do
+			vinstall $f 644 usr/include/qt5xcb-private
+		done
+	}
+}

From 309887ece1ed994e8ac3082e450a6dc26107a66f Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Thu, 2 Apr 2020 20:17:46 +0200
Subject: [PATCH 02/17] qt5: update to 5.14.2

---
 srcpkgs/qt5/template | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 245dc3d83cc..9a4744ee63e 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -43,13 +43,13 @@ fi
 _cleanup_wrksrc_leak() {
 	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
 		# Replace references to ${wrksrc} in cmake files
-		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+		vsed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
 			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
 			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
 	fi
 	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
 		# Replace references to ${wrksrc} in pkgconfig files
-		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+		vsed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
 			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
 			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
 	fi
@@ -172,9 +172,9 @@ do_configure() {
 	# Cross build patches
 	if [ "$CROSS_BUILD" ]; then
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
-		sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${XBPS_CFLAGS}|" \
+		vsed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${XBPS_CFLAGS}|" \
 			${wrksrc}/qtbase/mkspecs/common/gcc-base.conf
-		sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${XBPS_LDFLAGS}|" \
+		vsed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${XBPS_LDFLAGS}|" \
 			${wrksrc}/qtbase/mkspecs/common/g++-unix.conf
 
 		# Create symbolic links for private include directories
@@ -183,15 +183,15 @@ do_configure() {
 		done
 	else
 		# qmake {CXX,L}FLAGS patches
-		sed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
+		vsed -i -e "s|^\(CXXFLAGS =.*\)|\1 ${CXXFLAGS}|" \
 			-e "s|^\(LFLAGS =.*\)|\1 ${LDFLAGS}|" \
 			${wrksrc}/qtbase/qmake/Makefile.unix
 
 		# Build qmake using Void {C,LD}FLAGS
 		# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
-		sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CFLAGS}|" \
+		vsed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CFLAGS}|" \
 			${wrksrc}/qtbase/mkspecs/common/gcc-base.conf
-		sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \
+		vsed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \
 			${wrksrc}/qtbase/mkspecs/common/g++-unix.conf
 	fi
 
@@ -317,7 +317,7 @@ do_install() {
 		_msg_cross " Building ${base}"
 		cd ${wrksrc}/${dir}/${base}
 		[ -f "${base}.pro" ] && cp -a ${base}.pro{,.orig}
-		sed -i ${base}.pro \
+		vsed -i ${base}.pro \
 			-e "/option(host_build)/d" \
 			-e "/include(..\/3rdparty\/masm\/masm-defs.pri)/i include(../3rdparty/masm/masm.pri)"
 		make clean
@@ -329,7 +329,7 @@ do_install() {
 		[ -f "${base}.pro.orig" ] && mv -v ${base}.pro{.orig,}
 		mv -v Makefile{.orig,}
 		# Avoid rebuilding the Makefile by changing the rule
-		sed -i Makefile -e "s;^Makefile:;Makefile.host:;"
+		vsed -i Makefile -e "s;^Makefile:;Makefile.host:;"
 
 		#
 		# Build various tools for the target
@@ -376,7 +376,7 @@ do_install() {
 				cp ${FILESDIR}/${base}.pro ${base}.pro
 			else
 				# Otherwise strip the option(host_build)
-				sed -i ${base}.pro -e "/option(host_build)/d"
+				vsed -i ${base}.pro -e "/option(host_build)/d"
 			fi
 			# Create the Makefile
 			[ -f Makefile ] && mv -v Makefile{,.orig}
@@ -396,7 +396,7 @@ do_install() {
 				-e "s;^\(RANLIB\\s*=\).*;\1 $RANLIB;" \
 				\;
 			# Set a different destination directory and target name
-			sed -i Makefile \
+			vsed -i Makefile \
 				-e "s;^\(DESTDIR\\s*=\).*;\1 ${DESTDIR}/usr/lib/qt5/bin/;" \
 				-e "s;^\(TARGET\\s*=\).*;\1 ${DESTDIR}/usr/lib/qt5/bin/${base}-target;"
 			make ${makejobs}
@@ -404,8 +404,8 @@ do_install() {
 			[ -f "${base}.pro.orig" ] && mv -v ${base}.pro{.orig,}
 			[ -f Makefile.orig ] && mv -v Makefile{.orig,}
 			# Avoid rebuilding the Makefile by changing the rule
-			sed -i Makefile -e 's;^all:.*;all:;'
-			sed -i Makefile -e "s;^Makefile:;Makefile.host:;"
+			vsed -i Makefile -e 's;^all:.*;all:;'
+			vsed -i Makefile -e "s;^Makefile:;Makefile.host:;"
 			if [ -x "${wrksrc}/${dir}/bin/${base}-host" ]; then
 				mv -v ${wrksrc}/${dir}/bin/${base}{-host,}
 				touch ${wrksrc}/${dir}/bin/${base}

From 728bc15e1fa7033ed561b00e8935ac053c2ba33c Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 15 Oct 2019 13:19:43 +0200
Subject: [PATCH 03/17] New package: qt5-webengine-5.14.2

---
 srcpkgs/qt5-webengine-devel                   |    2 +-
 srcpkgs/qt5-webengine/files/resolv_compat.h   |   29 +
 ...te-instead-of-_libc_fpstate-on-linux.patch |   42 +
 ...reg.h-to-get-__WORDSIZE-on-musl-libc.patch |   26 +
 .../patches/0003-musl-dispatch-to-musl.patch  |  103 +
 .../patches/0004-musl-no-mallinfo.patch       |   40 +
 .../patches/0005-musl-off_t.patch             |   10 +
 .../patches/0006-musl-pread-pwrite.patch      |   18 +
 .../patches/0007-musl-replace-pvalloc.patch   |   14 +
 .../patches/0008-musl-resolve.patch           |   26 +
 .../patches/0009-musl-siginfo_t.patch         |   18 +
 .../patches/0010-musl-stackstart.patch        |   20 +
 .../patches/0011-musl-sandbox.patch           |   71 +
 ...0012-musl-chromium-default-stacksize.patch |   15 +
 .../0014-musl-cross-no-asm_ptrace_h.patch     |   30 +
 .../qt5-webengine/patches/0015-yasm-nls.patch |   13 +
 .../patches/0016-qt-musl-execinfo.patch       |   94 +
 .../0017-qt-musl-thread-stacksize.patch       |   26 +
 .../patches/0018-sandbox-membarrier.patch     |   60 +
 .../patches/0019-gn-cross-sysroot.patch       |   24 +
 .../patches/0020-msgvec-push_back.patch       |   14 +
 .../patches/0021-sandbox-sched_getparam.patch |   24 +
 .../0022-canonicalize-file-name-musl.patch    |   11 +
 .../patches/0090-chromium-ppc64le.patch       | 4048 +++++++++++++++++
 srcpkgs/qt5-webengine/template                |  160 +
 25 files changed, 4937 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webengine/files/resolv_compat.h
 create mode 100644 srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
 create mode 100644 srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch
 create mode 100644 srcpkgs/qt5-webengine/template

diff --git a/srcpkgs/qt5-webengine-devel b/srcpkgs/qt5-webengine-devel
index 75793eb6664..1bfdef1108b 120000
--- a/srcpkgs/qt5-webengine-devel
+++ b/srcpkgs/qt5-webengine-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webengine
\ No newline at end of file
diff --git a/srcpkgs/qt5-webengine/files/resolv_compat.h b/srcpkgs/qt5-webengine/files/resolv_compat.h
new file mode 100644
index 00000000000..4f0e852a19d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/files/resolv_compat.h
@@ -0,0 +1,29 @@
+#if !defined(__GLIBC__)
+/***************************************************************************
+ * resolv_compat.h
+ *
+ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc
+ * Note: res_init() is actually deprecated according to
+ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html
+ **************************************************************************/
+#include <string.h>
+
+static inline int res_ninit(res_state statp)
+{
+	int rc = res_init();
+	if (statp != &_res) {
+		memcpy(statp, &_res, sizeof(*statp));
+	}
+	return rc;
+}
+
+static inline int res_nclose(res_state statp)
+{
+	if (!statp)
+		return -1;
+	if (statp != &_res) {
+		memset(statp, 0, sizeof(*statp));
+	}
+	return 0;
+}
+#endif
diff --git a/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
new file mode 100644
index 00000000000..3e787d1374e
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0001-Use-_fpstate-instead-of-_libc_fpstate-on-linux.patch
@@ -0,0 +1,42 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h	2018-09-07 22:21:28.521763716 +0200
+@@ -50,7 +50,7 @@
+   //   info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                             const struct _libc_fpstate* fp);
++                             const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc	2018-09-07 22:21:45.766762688 +0200
+@@ -49,7 +49,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fp) {
++                                    const struct _fpstate* fp) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+ 
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+-                                    const struct _libc_fpstate* fpregs) {
++                                    const struct _fpstate* fpregs) {
+   const greg_t* regs = uc->uc_mcontext.gregs;
+ 
+   out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h	2018-09-07 23:36:32.049495285 +0200
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+ 
+ // These entries store a list of memory regions that the client wants included
diff --git a/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
new file mode 100644
index 00000000000..da4160b21bd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0002-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch
@@ -0,0 +1,26 @@
+From 9001c54d6b974449174a8cee8f3f5d78a9bd6c9e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sun, 1 Feb 2015 14:26:52 +0100
+Subject: [PATCH 3/6] include <sys/reg.h> to get __WORDSIZE on musl libc
+
+---
+ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common/linux/elf_core_dump.h b/src/common/linux/elf_core_dump.h
+index d03c7a8..02eb391 100644
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,9 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#ifndef __GLIBC__
++#include <sys/reg.h>
++#endif
+ 
+ #include "common/memory_range.h"
+ 
+-- 
+2.0.5
+
diff --git a/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
new file mode 100644
index 00000000000..de32a3dab95
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0003-musl-dispatch-to-musl.patch
@@ -0,0 +1,103 @@
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+--- qtwebengine/src/3rdparty/chromium/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
+@@ -6,6 +6,7 @@
+ 
+ #include <malloc.h>
+ 
++#if defined(__GLIBC__)
+ // This translation unit defines a default dispatch for the allocator shim which
+ // routes allocations to libc functions.
+ // The code here is strongly inspired from tcmalloc's libc_override_glibc.h.
+@@ -73,3 +74,92 @@ const AllocatorDispatch AllocatorDispatch::default_dispatch = {
+     nullptr,               /* free_definite_size_function */
+     nullptr,               /* next */
+ };
++
++#else // defined(__GLIBC__)
++
++#include <dlfcn.h>
++
++extern "C" {
++// Declare function pointers to the memory functions
++typedef void* (*t_libc_malloc)(size_t size);
++typedef void* (*t_libc_calloc)(size_t n, size_t size);
++typedef void* (*t_libc_realloc)(void* address, size_t size);
++typedef void* (*t_libc_memalign)(size_t alignment, size_t size);
++typedef void (*t_libc_free)(void* ptr);
++typedef size_t (*t_libc_malloc_usable_size)(void* ptr);
++
++// Static instances of pointers to libc.so dl symbols
++static t_libc_malloc libc_malloc = NULL;
++static t_libc_calloc libc_calloc = NULL;
++static t_libc_realloc libc_realloc = NULL;
++static t_libc_memalign libc_memalign = NULL;
++static t_libc_free libc_free = NULL;
++static t_libc_malloc_usable_size libc_malloc_usable_size = NULL;
++
++// resolve the symbols in libc.so
++void musl_libc_memory_init(void)
++{
++  libc_malloc = (t_libc_malloc) dlsym(RTLD_NEXT, "malloc");
++  libc_calloc = (t_libc_calloc) dlsym(RTLD_NEXT, "calloc");
++  libc_realloc = (t_libc_realloc) dlsym(RTLD_NEXT, "realloc");
++  libc_memalign = (t_libc_memalign) dlsym(RTLD_NEXT, "memalign");
++  libc_free = (t_libc_free) dlsym(RTLD_NEXT, "free");
++  libc_malloc_usable_size = (t_libc_malloc_usable_size) dlsym(RTLD_NEXT, "malloc_usable_size");
++}
++}  // extern "C"
++
++namespace {
++
++using base::allocator::AllocatorDispatch;
++
++void* MuslMalloc(const AllocatorDispatch*, size_t size, void* context) {
++  if (!libc_malloc)
++    musl_libc_memory_init();
++  return (*libc_malloc)(size);
++}
++
++void* MuslCalloc(const AllocatorDispatch*, size_t n, size_t size, void* context) {
++  if (!libc_calloc)
++    musl_libc_memory_init();
++  return (*libc_calloc)(n, size);
++}
++
++void* MuslRealloc(const AllocatorDispatch*, void* address, size_t size, void* context) {
++  if (!libc_realloc)
++    musl_libc_memory_init();
++  return (*libc_realloc)(address, size);
++}
++
++void* MuslMemalign(const AllocatorDispatch*, size_t alignment, size_t size, void* context) {
++  if (!libc_memalign)
++    musl_libc_memory_init();
++  return (*libc_memalign)(alignment, size);
++}
++
++void MuslFree(const AllocatorDispatch*, void* address, void* context) {
++  if (!libc_free)
++    musl_libc_memory_init();
++  (*libc_free)(address);
++}
++
++size_t MuslGetSizeEstimate(const AllocatorDispatch*, void* address, void* context) {
++  // TODO(siggi, primiano): malloc_usable_size may need redirection in the
++  //     presence of interposing shims that divert allocations.
++  if (!libc_malloc_usable_size)
++    musl_libc_memory_init();
++  return (*libc_malloc_usable_size)(address);
++}
++
++}  // namespace
++
++const AllocatorDispatch AllocatorDispatch::default_dispatch = {
++    &MuslMalloc,           /* alloc_function */
++    &MuslCalloc,           /* alloc_zero_initialized_function */
++    &MuslMemalign,         /* alloc_aligned_function */
++    &MuslRealloc,          /* realloc_function */
++    &MuslFree,             /* free_function */
++    &MuslGetSizeEstimate,  /* get_size_estimate_function */
++    nullptr,               /* next */
++};
++
++#endif
diff --git a/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
new file mode 100644
index 00000000000..c332b92b69d
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0004-musl-no-mallinfo.patch
@@ -0,0 +1,40 @@
+--- qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/trace_event/malloc_dump_provider.cc	2018-01-27 20:13:26.960932805 +0100
+@@ -243,7 +243,7 @@
+   allocated_objects_count = main_heap_info.block_count;
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+   struct mallinfo info = mallinfo();
+   DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+ 
+@@ -255,6 +255,8 @@
+ 
+   // Total allocated space is given by |uordblks|.
+   allocated_objects_size = info.uordblks;
++#else
++// musl libc does not support mallinfo()
+ #endif
+ 
+   MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
+--- qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2017-11-28 14:06:53.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/base/process/process_metrics_posix.cc	2018-01-27 20:48:11.571040348 +0100
+@@ -100,14 +100,14 @@
+   malloc_statistics_t stats = {0};
+   malloc_zone_statistics(nullptr, &stats);
+   return stats.size_in_use;
+-#elif defined(OS_LINUX) || defined(OS_ANDROID)
++#elif (defined(OS_LINUX) && defined(__GLIBC__)) || defined(OS_ANDROID)
+   struct mallinfo minfo = mallinfo();
+ #if defined(USE_TCMALLOC)
+   return minfo.uordblks;
+ #else
+   return minfo.hblkhd + minfo.arena;
+ #endif
+-#elif defined(OS_FUCHSIA)
++#else //if defined(OS_FUCHSIA) // also musl doesn't do this.
+   // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+   return 0;
+ #endif
+
diff --git a/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
new file mode 100644
index 00000000000..52db3b9ebf4
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0005-musl-off_t.patch
@@ -0,0 +1,10 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-05-26 14:58:54.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/ots/include/opentype-sanitiser.h	2016-10-01 14:31:30.885000000 +0200
+@@ -21,6 +21,7 @@
+ #define htons(x) _byteswap_ushort (x)
+ #else
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include <stdint.h>
+ #endif
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
new file mode 100644
index 00000000000..00017bba017
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0006-musl-pread-pwrite.patch
@@ -0,0 +1,18 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:26.639964100 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h	2018-09-07 21:25:11.611964995 +0200
+@@ -1794,6 +1794,15 @@
+ /* End of s390/s390x definitions                                             */
+ #endif
+ 
++#ifndef __GLIBC__
++  /* For Musl libc pread/pread is the same as pread64/pwrite64 */
++#ifndef __NR_pread
++#define __NR_pread              __NR_pread64
++#endif
++#ifndef __NR_pwrite
++#define __NR_pwrite             __NR_pwrite64
++#endif
++#endif /* ifndef __GLIBC__ */
+ 
+ /* After forking, we must make sure to only call system calls.               */
+ #if defined(__BOUNDED_POINTERS__)
diff --git a/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
new file mode 100644
index 00000000000..d5caf3836d7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0007-musl-replace-pvalloc.patch
@@ -0,0 +1,14 @@
+--- qtwebengine/src/core/api/qtbug-61521.cpp	2017-11-29 09:42:29.000000000 +0100
++++ qtwebengine/src/core/api/qtbug-61521.cpp	2018-01-28 06:49:29.454175725 +0100
+@@ -111,7 +111,11 @@
+ }
+ 
+ SHIM_HIDDEN void* ShimPvalloc(size_t size) {
++#if defined(__GLIBC__)
+     return pvalloc(size);
++#else
++    return valloc((size+4095)&~4095);
++#endif
+ }
+ 
+ SHIM_HIDDEN int ShimPosixMemalign(void** r, size_t a, size_t s) {
diff --git a/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
new file mode 100644
index 00000000000..edfceb79f30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0008-musl-resolve.patch
@@ -0,0 +1,26 @@
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_reloader.cc	2016-12-20 03:33:11.749059656 +0100
+@@ -9,6 +9,10 @@
+ 
+ #include <resolv.h>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/lazy_instance.h"
+ #include "base/logging.h"
+ #include "base/macros.h"
+--- qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-11-07 15:46:18.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/net/dns/dns_config_service_posix.cc	2016-12-20 03:40:07.671953098 +0100
+@@ -6,6 +6,10 @@
+ 
+ #include <string>
+ 
++#if !defined(__GLIBC__)
++#include "resolv_compat.h"
++#endif
++
+ #include "base/bind.h"
+ #include "base/files/file.h"
+ #include "base/files/file_path.h"
diff --git a/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
new file mode 100644
index 00000000000..fe760be1666
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0009-musl-siginfo_t.patch
@@ -0,0 +1,18 @@
+There's a subtle difference in the internal name of siginfo_t fields
+between glibc and musl. The structure itself is equivalent, so it
+should suffice to add a macro to rename the field.
+
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-02-17 05:57:43.000000000 +0100
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc	2015-06-03 08:20:25.032716427 +0200
+@@ -22,6 +22,11 @@
+ #include "sandbox/linux/services/android_ucontext.h"
+ #endif
+
++// musl libc defines siginfo_t __si_fields instead of _sifields
++#if !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ namespace {
+
+ const int kCapacityIncrement = 20;
diff --git a/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
new file mode 100644
index 00000000000..57136bc2bcd
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0010-musl-stackstart.patch
@@ -0,0 +1,20 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:08:43.586475349 +0100
++++ qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/stack_util.cc	2018-01-27 23:18:22.274505203 +0100
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+ 
+-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
++#if 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 webkit_unit_tests).
+@@ -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;
diff --git a/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
new file mode 100644
index 00000000000..d3de1e41183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0011-musl-sandbox.patch
@@ -0,0 +1,71 @@
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc	2018-09-13 19:53:53.453780253 +0200
+@@ -129,7 +129,7 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+   const Arg<unsigned long> flags(0);
+-
++#if defined(__GLIBC__)
+   // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+   const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+                                      CLONE_SIGHAND | CLONE_THREAD |
+@@ -148,6 +148,17 @@
+   return If(IsAndroid() ? android_test : glibc_test, Allow())
+       .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+       .Else(CrashSIGSYSClone());
++#else
++  const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++                       CLONE_THREAD | CLONE_SYSVSEM;
++  const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++                   CLONE_DETACHED;
++  const BoolExpr thread_clone_ok = (flags&~safe)==required;
++
++  return If(thread_clone_ok, Allow())
++      .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
++      .Else(CrashSIGSYSClone());
++#endif
+ }
+ 
+ ResultExpr RestrictPrctl() {
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-06-15 09:47:20.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc	2018-09-13 19:56:31.779773940 +0200
+@@ -375,6 +375,9 @@
+ #if defined(__i386__)
+     case __NR_waitpid:
+ #endif
++#if !defined(__GLIBC__)
++    case __NR_set_tid_address:
++#endif
+       return true;
+     case __NR_clone:  // Should be parameter-restricted.
+     case __NR_setns:  // Privileged.
+@@ -387,7 +390,9 @@
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+     case __NR_set_thread_area:
+ #endif
++#if defined(__GLIBC__)
+     case __NR_set_tid_address:
++#endif
+     case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+     case __NR_vfork:
+@@ -496,6 +501,9 @@
+     case __NR_mlock:
+     case __NR_munlock:
+     case __NR_munmap:
++#if !defined(__GLIBC__)
++    case __NR_mremap:
++#endif
+       return true;
+     case __NR_madvise:
+     case __NR_mincore:
+@@ -511,7 +519,9 @@
+     case __NR_modify_ldt:
+ #endif
+     case __NR_mprotect:
++#if defined(__GLIBC__)
+     case __NR_mremap:
++#endif
+     case __NR_msync:
+     case __NR_munlockall:
+     case __NR_readahead:
diff --git a/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
new file mode 100644
index 00000000000..7bf5a22fba7
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0012-musl-chromium-default-stacksize.patch
@@ -0,0 +1,15 @@
+--- qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc.orig	2018-09-19 18:05:15.523923703 +0200
++++ qtwebengine/src/3rdparty/chromium/base/threading/platform_thread_linux.cc	2018-09-19 18:08:05.150932454 +0200
+@@ -173,7 +173,12 @@
+ 
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
++#if defined(__GLIBC__)
+   return 0;
++#else // defined(__GLIBC__)
++  // For Musl libc try with a default stack size of 2 MiB
++  return 2 * 1024 * 1024;
++#endif // !defined(__GLIBC__)
+ #else
+   // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+   // default stack size isn't enough for some browser tests.
diff --git a/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
new file mode 100644
index 00000000000..140742f72c2
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0014-musl-cross-no-asm_ptrace_h.patch
@@ -0,0 +1,30 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc	2018-11-22 00:41:58.522477559 +0100
+@@ -38,7 +38,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_ptrace_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-08-27 10:21:31.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc	2018-11-22 00:49:39.533492245 +0100
+@@ -32,7 +32,12 @@
+ 
+ #include "client/linux/minidump_writer/linux_core_dumper.h"
+ 
++#if defined(__GLIBC__)
+ #include <asm/ptrace.h>
++#else
++/* For arm*-musl this definition is missing */
++#define ARM_sp uregs[13]
++#endif
+ #include <assert.h>
+ #include <elf.h>
+ #include <stdio.h>
diff --git a/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
new file mode 100644
index 00000000000..22ac0420764
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0015-yasm-nls.patch
@@ -0,0 +1,13 @@
+diff --git src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h src/3rdparty/chromium/third_party/yasm/source/config/linux/config.h
+index 9e36539..f588083 100644
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+--- qtwebengine/src/3rdparty/chromium//third_party/yasm/source/config/linux/config.h
+@@ -5,7 +5,7 @@
+ #define CPP_PROG "gcc -E"
+ 
+ /* */
+-#define ENABLE_NLS 1
++/* #undef ENABLE_NLS 1 */
+ 
+ /* Define to 1 if you have the `abort' function. */
+ #define HAVE_ABORT 1
diff --git a/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
new file mode 100644
index 00000000000..c1cdb537212
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0016-qt-musl-execinfo.patch
@@ -0,0 +1,94 @@
+--- qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc.orig	2019-04-09 09:31:16.000000000 +0200
++++ qtwebengine/src/3rdparty/chromium//base/debug/stack_trace_posix.cc	2019-05-06 23:16:13.245502467 +0200
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ 
+@@ -86,7 +86,7 @@
+   // Note: code in this function is NOT async-signal safe (std::string uses
+   // malloc internally).
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   std::string::size_type search_from = 0;
+   while (search_from < text->size()) {
+     // Look for the start of a mangled symbol, from search_from.
+@@ -121,7 +121,7 @@
+       search_from = mangled_start + 2;
+     }
+   }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ }
+ #endif  // !defined(USE_SYMBOLIZE)
+ 
+@@ -133,7 +133,7 @@
+   virtual ~BacktraceOutputHandler() = default;
+ };
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+   // This should be more than enough to store a 64-bit number in hex:
+   // 16 hex digits + 1 for null-terminator.
+@@ -216,7 +216,7 @@
+   }
+ #endif  // defined(USE_SYMBOLIZE)
+ }
+-#endif  // !defined(__UCLIBC__) && !defined(_AIX)
++#endif  // !defined(__GLIBC__) && !defined(_AIX)
+ 
+ void PrintToStderr(const char* output) {
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+@@ -812,7 +812,7 @@
+   // NOTE: This code MUST be async-signal safe (it's used by in-process
+   // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   // Though the backtrace API man page does not list any possible negative
+   // return values, we take no chance.
+   return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -825,13 +825,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   PrintBacktraceOutputHandler handler;
+   ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+ 
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+                                           const char* prefix_string) const {
+   StreamBacktraceOutputHandler handler(os);
+--- qtwebengine/src/3rdparty/chromium/base/debug/stack_trace.cc	2019-04-09 09:31:16.000000000 +0200
++++ -	2019-05-06 23:18:14.923566992 +0200
+@@ -233,7 +233,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+   std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+   OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+   return stream.str();
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2017-11-28 14:06:53.000000000 +0100
+--- qtwebengine/src/3rdparty/chromium//base/logging.cc	2018-01-27 22:46:34.970406807 +0100
+@@ -546,7 +546,7 @@
+ 
+ LogMessage::~LogMessage() {
+   size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) && \
+     !defined(OS_AIX)
+   if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
+     // Include a stack trace on a fatal, unless a debugger is attached.
diff --git a/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
new file mode 100644
index 00000000000..496753bef30
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0017-qt-musl-thread-stacksize.patch
@@ -0,0 +1,26 @@
+diff --git a/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc b/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+index 02bf49b..05ee182 100644
+--- qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
++++ qtwebengine/src/3rdparty/chromium/ppapi/utility/threading/simple_thread.cc
+@@ -13,7 +13,7 @@ namespace pp {
+ namespace {
+ 
+ // Use 2MB default stack size for Native Client, otherwise use system default.
+-#if defined(__native_client__)
++#if defined(__native_client__) || !defined(__GLIBC__)
+ const size_t kDefaultStackSize = 2 * 1024 * 1024;
+ #else
+ const size_t kDefaultStackSize = 0;
+diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+index cf7f3ec..e06a5ce 100644
+--- qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
++++ qtwebengine/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc
+@@ -761,7 +761,7 @@ void Thread::Start() {
+ #if V8_OS_MACOSX
+     // Default on Mac OS X is 512kB -- bump up to 1MB
+     stack_size = 1 * 1024 * 1024;
+-#elif V8_OS_AIX
++#elif V8_OS_AIX || !defined(__GLIBC__)
+     // Default on AIX is 96kB -- bump up to 2MB
+     stack_size = 2 * 1024 * 1024;
+ #endif
diff --git a/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
new file mode 100644
index 00000000000..b73971f2432
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0018-sandbox-membarrier.patch
@@ -0,0 +1,60 @@
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_32_linux_syscalls.h
+@@ -1422,5 +1422,9 @@
+ #define __NR_memfd_create 356
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 375
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1290,5 +1290,9 @@
+ #define __NR_memfd_create 319
+ #endif
+ 
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium//sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -370,6 +370,7 @@
+   switch (sysno) {
+     case __NR_exit:
+     case __NR_exit_group:
++    case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+ #if defined(__i386__)
diff --git a/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
new file mode 100644
index 00000000000..ee6689a4183
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0019-gn-cross-sysroot.patch
@@ -0,0 +1,24 @@
+There is no reason to run this script and running it fails on architectures
+chromium does not officially support (such as ppc64).
+
+--- qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/build/config/posix/BUILD.gn
+@@ -102,12 +102,12 @@ config("runtime_library") {
+       # when turning the sysroot on or off. (defines are passed via the command
+       # line, and build system rebuilds things when their commandline
+       # changes). Nothing should ever read this define.
+-      sysroot_hash =
+-          exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
+-                      [ "--print-hash=$current_cpu" ],
+-                      "trim string",
+-                      [ "//build/linux/sysroot_scripts/sysroots.json" ])
+-      defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
++      #sysroot_hash =
++      #    exec_script("//build/linux/sysroot_scripts/install-sysroot.py",
++      #                [ "--print-hash=$current_cpu" ],
++      #                "trim string",
++      #                [ "//build/linux/sysroot_scripts/sysroots.json" ])
++      #defines += [ "CR_SYSROOT_HASH=$sysroot_hash" ]
+     }
+     asmflags += sysroot_flags
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
new file mode 100644
index 00000000000..75481a2889f
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0020-msgvec-push_back.patch
@@ -0,0 +1,14 @@
+--- qtwebengine-everywhere-src-5.14.0-beta2/src/3rdparty/chromium/net/socket/udp_socket_posix.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:41:46.699068889 +0100
+@@ -1191,7 +1191,11 @@
+     msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+   msgvec->reserve(buffers.size());
+   for (size_t j = 0; j < buffers.size(); j++)
++#if defined(__GLIBC__)
+     msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++#else
++    msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
++#endif
+   int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+   SendResult send_result(0, 0, std::move(buffers));
+   if (result < 0) {
diff --git a/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
new file mode 100644
index 00000000000..a91e85eca3c
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0021-sandbox-sched_getparam.patch
@@ -0,0 +1,24 @@
+Allow SYS_sched_getparam and SYS_sched_getscheduler
+musl uses them for pthread_getschedparam()
+
+source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e
+
+--- a/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc	2019-10-08 08:27:43.000000000 +0200
++++ -	2019-11-11 22:33:51.865153684 +0100
+@@ -88,10 +88,16 @@
+     case __NR_sysinfo:
+     case __NR_times:
+     case __NR_uname:
++#if !defined(__GLIBC__)
++    case __NR_sched_getparam:
++    case __NR_sched_getscheduler:
++#endif
+       return Allow();
+     case __NR_sched_getaffinity:
++#if defined(__GLIBC__)
+     case __NR_sched_getparam:
+     case __NR_sched_getscheduler:
++#endif
+     case __NR_sched_setscheduler:
+       return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
+     case __NR_prlimit64:
diff --git a/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
new file mode 100644
index 00000000000..893ed2d41bb
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0022-canonicalize-file-name-musl.patch
@@ -0,0 +1,11 @@
+--- qtwebengine/src/3rdparty/chromium/third_party/nasm/nasmlib/realpath.c	2019-09-23 14:24:20.000000000 +0200
++++ -	2019-10-11 06:27:28.450329986 +0200
+@@ -57,7 +57,7 @@
+  */
+ char *nasm_realpath(const char *rel_path)
+ {
+-    char *rp = canonicalize_file_name(rel_path);
++    char *rp = realpath(rel_path, NULL);
+     return rp ? rp : nasm_strdup(rel_path);
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch b/srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch
new file mode 100644
index 00000000000..21796909b70
--- /dev/null
+++ b/srcpkgs/qt5-webengine/patches/0090-chromium-ppc64le.patch
@@ -0,0 +1,4048 @@
+This is a base patch that adds support for ppc64le glibc. Big endian and musl
+support is added in extra patches afterwards.
+
+Ping q66 if you're updating qt5 and the patch does not apply anymore.
+
+Source: https://wiki.raptorcs.com/w/index.php?title=Porting/Chromium
+Upstream: Currently being submitted
+
+--- qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
++++ qtwebengine/src/3rdparty/chromium/build/download_nacl_toolchains.py
+@@ -11,6 +11,10 @@ import sys
+ 
+ 
+ def Main(args):
++  # If `disable_nacl=1` is in GYP_DEFINES, exit
++  if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
++    return 0
++
+   script_dir = os.path.dirname(os.path.abspath(__file__))
+   src_dir = os.path.dirname(script_dir)
+   nacl_dir = os.path.join(src_dir, 'native_client')
+--- qtwebengine/src/3rdparty/chromium/sandbox/features.gni
++++ qtwebengine/src/3rdparty/chromium/sandbox/features.gni
+@@ -12,6 +12,6 @@ use_seccomp_bpf =
+     (is_linux || is_android) &&
+     (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
+      current_cpu == "arm64" || current_cpu == "mipsel" ||
+-     current_cpu == "mips64el")
++     current_cpu == "mips64el" || current_cpu == "ppc64")
+ 
+ use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/BUILD.gn
+@@ -416,6 +416,8 @@ component("sandbox_services") {
+ 
+ source_set("sandbox_services_headers") {
+   sources = [
++    "system_headers/ppc64_linux_syscalls.h",
++    "system_headers/ppc64_linux_ucontext.h",
+     "system_headers/arm64_linux_syscalls.h",
+     "system_headers/arm_linux_syscalls.h",
+     "system_headers/arm_linux_ucontext.h",
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+@@ -55,6 +55,13 @@
+ #define MAX_PUBLIC_SYSCALL 279u
+ #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
+ 
++#elif defined(__powerpc64__)
++
++#include <asm/unistd.h>
++#define MIN_SYSCALL 0u
++#define MAX_PUBLIC_SYSCALL 386u
++#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
++
+ #else
+ #error "Unsupported architecture"
+ #endif
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h
+@@ -16,6 +16,9 @@
+ #if defined(__mips__)
+ // sys/user.h in eglibc misses size_t definition
+ #include <stddef.h>
++#elif defined(__powerpc64__)
++// Manually define greg_t on ppc64
++typedef unsigned long long greg_t;
+ #endif
+ #endif
+ 
+@@ -346,6 +349,51 @@ struct regs_struct {
+ #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
+ #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
+ #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
++
++#elif defined(__powerpc64__)
++#include <asm/ptrace.h>
++
++typedef struct pt_regs regs_struct;
++
++#ifdef ARCH_CPU_LITTLE_ENDIAN
++#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE
++#else
++#define SECCOMP_ARCH AUDIT_ARCH_PPC64
++#endif
++
++#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg])
++
++#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3)
++#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0)
++#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip
++#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3)
++#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4)
++#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5)
++#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6)
++#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7)
++#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8)
++
++#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
++#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
++#define SECCOMP_IP_MSB_IDX \
++  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
++#define SECCOMP_IP_LSB_IDX \
++  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
++#define SECCOMP_ARG_MSB_IDX(nr) \
++  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
++#define SECCOMP_ARG_LSB_IDX(nr) \
++  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
++
++#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3]
++#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0]
++#define SECCOMP_PT_IP(_regs) (_regs).nip
++#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3]
++#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4]
++#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5]
++#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6]
++#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7]
++#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8]
++
+ #else
+ #error Unsupported target platform
+ 
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+@@ -87,7 +87,8 @@ bool IsBaselinePolicyWatched(int sysno) {
+          SyscallSets::IsPrctl(sysno) ||
+          SyscallSets::IsProcessGroupOrSession(sysno) ||
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+          SyscallSets::IsSocketCall(sysno) ||
+ #endif
+ #if defined(__arm__)
+@@ -190,7 +191,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
+   }
+ 
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+   if (sysno == __NR_mmap)
+     return RestrictMmapFlags();
+ #endif
+@@ -208,7 +209,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
+     return RestrictPrctl();
+ 
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+   if (sysno == __NR_socketpair) {
+     // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
+     static_assert(AF_UNIX == PF_UNIX,
+@@ -248,7 +249,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
+   }
+ 
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+   if (SyscallSets::IsSocketCall(sysno))
+     return RestrictSocketcallCommand();
+ #endif
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -35,7 +35,8 @@
+ #include <sys/ioctl.h>
+ #include <sys/ptrace.h>
+ #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
+-    !defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
++    !defined(__aarch64__) && !defined(__powerpc64__) && \
++    !defined(PTRACE_GET_THREAD_AREA)
+ // 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
+@@ -44,6 +44,11 @@
+ #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 !defined(F_DUPFD_CLOEXEC)
+@@ -106,6 +111,15 @@ inline bool IsArchitectureMips() {
+ #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
+@@ -247,7 +261,8 @@ ResultExpr RestrictFcntlCommands() {
+   // operator.
+   // Glibc overrides the kernel's O_LARGEFILE value. Account for this.
+   uint64_t kOLargeFileFlag = O_LARGEFILE;
+-  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips())
++  if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips() \
++      || IsArchitecturePPC64())
+     kOLargeFileFlag = 0100000;
+ 
+   const Arg<int> cmd(1);
+@@ -270,7 +285,7 @@ ResultExpr RestrictFcntlCommands() {
+       .Default(CrashSIGSYS());
+ }
+ 
+-#if defined(__i386__) || defined(__mips__)
++#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
+ ResultExpr RestrictSocketcallCommand() {
+   // Unfortunately, we are unable to restrict the first parameter to
+   // socketpair(2). Whilst initially sounding bad, it's noteworthy that very
+@@ -421,7 +422,7 @@ ResultExpr RestrictPrlimit(pid_t target_pid) {
+ ResultExpr RestrictPtrace() {
+   const Arg<int> request(0);
+   return Switch(request).CASES((
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__powerpc64__)
+         PTRACE_GETREGS,
+         PTRACE_GETFPREGS,
+         PTRACE_GET_THREAD_AREA,
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
+@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags();
+ // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME.
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands();
+ 
+-#if defined(__i386__) || defined(__mips__)
++#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__)
+ // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2),
+ // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2).
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand();
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
+   switch (sysno) {
+     case __NR_gettimeofday:
+ #if defined(__i386__) || defined(__x86_64__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_time:
+ #endif
+       return true;
+@@ -45,7 +46,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
+ #endif
+     case __NR_settimeofday:  // Privileged.
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_stime:
+ #endif
+     default:
+@@ -111,7 +113,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
+     case __NR_faccessat:  // EPERM not a valid errno.
+     case __NR_fchmodat:
+     case __NR_fchownat:  // Should be called chownat ?
+-#if defined(__x86_64__) || defined(__aarch64__)
++#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
+ #elif defined(__i386__) || defined(__arm__) || \
+     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
+@@ -130,7 +132,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
+     case __NR_memfd_create:
+     case __NR_mkdirat:
+     case __NR_mknodat:
+-#if defined(__i386__)
++#if defined(__i386__) || defined(__powerpc64__)
+     case __NR_oldlstat:
+     case __NR_oldstat:
+ #endif
+@@ -154,7 +156,8 @@ bool SyscallSets::IsFileSystem(int sysno) {
+     case __NR_truncate64:
+ #endif
+     case __NR_unlinkat:
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_utime:
+ #endif
+     case __NR_utimensat:  // New.
+@@ -173,7 +176,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
+ #endif
+       return true;
+ // TODO(jln): these should be denied gracefully as well (moved below).
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_fadvise64:  // EPERM not a valid errno.
+ #endif
+ #if defined(__i386__)
+@@ -186,7 +190,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
+     case __NR_flock:      // EPERM not a valid errno.
+     case __NR_fstatfs:    // Give information about the whole filesystem.
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_fstatfs64:
+ #endif
+     case __NR_fsync:  // EPERM not a valid errno.
+@@ -198,6 +203,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
+     case __NR_sync_file_range:  // EPERM not a valid errno.
+ #elif defined(__arm__)
+     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
++#elif defined(__powerpc64__)
++    case __NR_sync_file_range2: // EPERM not a valid errno.
+ #endif
+     default:
+       return false;
+@@ -223,7 +230,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
+ #endif
+     case __NR_getdents64:  // EPERM not a valid errno.
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_readdir:
+ #endif
+       return true;
+@@ -264,7 +272,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) {
+ bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
+   switch (sysno) {
+     case __NR_capset:
+-#if defined(__i386__) || defined(__x86_64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
+     case __NR_ioperm:  // Intel privilege.
+     case __NR_iopl:    // Intel privilege.
+ #endif
+@@ -314,7 +322,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
+     case __NR_rt_sigprocmask:
+     case __NR_rt_sigreturn:
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_sigaction:
+     case __NR_sigprocmask:
+     case __NR_sigreturn:
+@@ -331,7 +340,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
+ #endif
+     case __NR_signalfd4:
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_sigpending:
+     case __NR_sigsuspend:
+ #endif
+@@ -355,7 +365,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
+ #endif
+     case __NR_dup3:
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_shutdown:
+ #endif
+       return true;
+@@ -389,7 +399,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+     case __NR_membarrier:
+     case __NR_wait4:
+     case __NR_waitid:
+-#if defined(__i386__)
++#if defined(__i386__) || defined(__powerpc64__)
+     case __NR_waitpid:
+ #endif
+ #if !defined(__GLIBC__)
+@@ -411,7 +421,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+     case __NR_set_tid_address:
+ #endif
+     case __NR_unshare:
+-#if !defined(__mips__) && !defined(__aarch64__)
++#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_vfork:
+ #endif
+     default:
+@@ -460,7 +470,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
+       return true;
+     default:
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_socketpair:  // We will want to inspect its argument.
+ #endif
+       return false;
+@@ -470,7 +480,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
+ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
+   switch (sysno) {
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_accept:
+     case __NR_accept4:
+     case __NR_bind:
+@@ -485,7 +495,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
+ }
+ 
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+ // Big multiplexing system call for sockets.
+ bool SyscallSets::IsSocketCall(int sysno) {
+   switch (sysno) {
+@@ -499,7 +510,8 @@ bool SyscallSets::IsSocketCall(int sysno) {
+ }
+ #endif
+ 
+-#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
++#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
++    defined(__powerpc64__)
+ bool SyscallSets::IsNetworkSocketInformation(int sysno) {
+   switch (sysno) {
+     case __NR_getpeername:
+@@ -527,7 +539,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+     case __NR_mincore:
+     case __NR_mlockall:
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_mmap:
+ #endif
+ #if defined(__i386__) || defined(__arm__) || \
+@@ -559,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
+   switch (sysno) {
+     case __NR_lseek:
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR__llseek:
+ #endif
+ #if !defined(__aarch64__)
+@@ -571,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
+     case __NR_readv:
+     case __NR_pread64:
+ #if defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_recv:
+ #endif
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_recvfrom:  // Could specify source.
+     case __NR_recvmsg:   // Could specify source.
+ #endif
+-#if defined(__i386__) || defined(__x86_64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__)
+     case __NR_select:
+ #endif
+-#if defined(__i386__) || defined(__arm__) || defined(__mips__)
++#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__)
+     case __NR__newselect:
+ #endif
+ #if defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_send:
+ #endif
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_sendmsg:  // Could specify destination.
+     case __NR_sendto:   // Could specify destination.
+ #endif
+@@ -647,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
+       return true;
+     case __NR_getpriority:
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_nice:
+ #endif
+     case __NR_setpriority:
+@@ -659,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
+ bool SyscallSets::IsAdminOperation(int sysno) {
+   switch (sysno) {
+ #if defined(__i386__) || defined(__arm__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_bdflush:
+ #endif
+     case __NR_kexec_load:
+@@ -675,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) {
+ 
+ bool SyscallSets::IsKernelModule(int sysno) {
+   switch (sysno) {
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_create_module:
+     case __NR_get_kernel_syms:  // Should ENOSYS.
+     case __NR_query_module:
+@@ -708,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) {
+     case __NR_swapoff:
+     case __NR_swapon:
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_umount:
+ #endif
+     case __NR_umount2:
+@@ -724,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) {
+     case __NR_getcpu:
+     case __NR_mbind:
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_migrate_pages:
+ #endif
+     case __NR_move_pages:
+@@ -753,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
+   switch (sysno) {
+     case __NR_acct:  // Privileged.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_getrlimit:
+ #endif
+-#if defined(__i386__) || defined(__arm__)
++#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__)
+     case __NR_ugetrlimit:
+ #endif
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_ulimit:
+ #endif
+     case __NR_getrusage:
+@@ -794,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
+ #endif
+     case __NR_sysinfo:
+     case __NR_uname:
+-#if defined(__i386__)
++#if defined(__i386__) || defined(__powerpc64__)
+     case __NR_olduname:
+     case __NR_oldolduname:
+ #endif
+@@ -888,7 +908,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
+ #endif
+ 
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+ // Big system V multiplexing system call.
+ bool SyscallSets::IsSystemVIpc(int sysno) {
+   switch (sysno) {
+@@ -908,7 +929,8 @@ bool SyscallSets::IsAnySystemV(int sysno) {
+   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
+          IsSystemVSharedMemory(sysno);
+ #elif defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+   return IsSystemVIpc(sysno);
+ #endif
+ }
+@@ -961,7 +983,8 @@ bool SyscallSets::IsFaNotify(int sysno) {
+ bool SyscallSets::IsTimer(int sysno) {
+   switch (sysno) {
+     case __NR_getitimer:
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_alarm:
+ #endif
+     case __NR_setitimer:
+@@ -1020,18 +1043,22 @@ bool SyscallSets::IsMisc(int sysno) {
+     case __NR_syncfs:
+     case __NR_vhangup:
+ // The system calls below are not implemented.
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_afs_syscall:
+ #endif
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_break:
+ #endif
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_getpmsg:
+ #endif
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_gtty:
+     case __NR_idle:
+     case __NR_lock:
+@@ -1039,20 +1066,22 @@ bool SyscallSets::IsMisc(int sysno) {
+     case __NR_prof:
+     case __NR_profil:
+ #endif
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
++    defined(__powerpc64__)
+     case __NR_putpmsg:
+ #endif
+ #if defined(__x86_64__)
+     case __NR_security:
+ #endif
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+     case __NR_stty:
+ #endif
+-#if defined(__x86_64__)
++#if defined(__x86_64__) || defined(__powerpc64__)
+     case __NR_tuxcall:
+ #endif
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__powerpc64__)
+     case __NR_vserver:
+ #endif
+       return true;
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
+@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets {
+   static bool IsDeniedGetOrModifySocket(int sysno);
+ 
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+   // Big multiplexing system call for sockets.
+   static bool IsSocketCall(int sysno);
+ #endif
+ 
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+   static bool IsNetworkSocketInformation(int sysno);
+ #endif
+ 
+@@ -87,7 +88,8 @@ class SANDBOX_EXPORT SyscallSets {
+ #endif
+ 
+ #if defined(__i386__) || \
+-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
++    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
++    defined(__powerpc64__)
+   // Big system V multiplexing system call.
+   static bool IsSystemVIpc(int sysno);
+ #endif
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc
+@@ -16,7 +16,7 @@ namespace sandbox {
+ namespace {
+ 
+ #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
+-    defined(ARCH_CPU_MIPS_FAMILY)
++    defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY)
+ // Number that's not currently used by any Linux kernel ABIs.
+ const int kInvalidSyscallNumber = 0x351d3;
+ #else
+@@ -308,12 +308,56 @@ asm(// We need to be able to tell the kernel exactly where we made a
+     // Enter the kernel
+     "svc 0\n"
+     "2:ret\n"
++    ".cfi_endproc\n"
++    ".size SyscallAsm, .-SyscallAsm\n"
++#elif defined(__powerpc64__)
++    ".text\n"
++    ".align 4\n"
++    ".type SyscallAsm @function\n"
++    "SyscallAsm:\n"
++    ".cfi_startproc\n"
++
++    // Check if r3 is negative
++    "cmpdi 3, 0\n"
++    "bgt 2f\n"
++
++    // Load address of 3f into r3 and return
++    "mflr 10\n"
++    "bl 1f\n"
++    "1: mflr 3\n"
++    "mtlr 10\n"
++    "addi 3, 3, 4*13\n"
++    "blr\n"
++
++    // Load arguments from array into r3-8
++    // save param 3 in r10
++    "2:\n"
++    "mr 0, 3\n"
++    "ld 3, 0(4)\n"
++    "ld 5, 16(4)\n"
++    "ld 6, 24(4)\n"
++    "ld 7, 32(4)\n"
++    "ld 8, 40(4)\n"
++    "ld 4, 8(4)\n"
++    "li 9, 0\n"
++
++    // Enter kernel
++    "sc\n"
++
++    // Magic return address
++    "3:\n"
++    // Like MIPS, ppc64 return values are always positive.
++    // Check for error in cr0.SO and negate upon error
++    "bc 4, 3, 4f\n"
++    "neg 3, 3\n"
++    "4: blr\n"
++
+     ".cfi_endproc\n"
+     ".size SyscallAsm, .-SyscallAsm\n"
+ #endif
+     );  // asm
+ 
+-#if defined(__x86_64__)
++#if defined(__x86_64__) || defined(__powerpc64__)
+ extern "C" {
+ intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
+ }
+@@ -427,6 +471,8 @@ intptr_t Syscall::Call(int nr,
+     ret = inout;
+   }
+ 
++#elif defined(__powerpc64__)
++  intptr_t ret = SyscallAsm(nr, args);
+ #else
+ #error "Unimplemented architecture"
+ #endif
+@@ -443,8 +489,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) {
+     // needs to be changed back.
+     ret_val = -ret_val;
+     SECCOMP_PARM4(ctx) = 1;
+-  } else
++  } else {
+     SECCOMP_PARM4(ctx) = 0;
++  }
++#endif
++#if defined(__powerpc64__)
++  // Same as MIPS, need to invert ret and set error register (cr0.SO)
++  if (ret_val <= -1 && ret_val >= -4095) {
++    ret_val = -ret_val;
++    ctx->uc_mcontext.regs->ccr |= (1 << 28);
++  } else {
++    ctx->uc_mcontext.regs->ccr &= ~(1 << 28);
++  }
+ #endif
+   SECCOMP_RESULT(ctx) = static_cast<greg_t>(ret_val);
+ }
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/trap.cc
+@@ -230,6 +230,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
+       SetIsInSigHandler();
+     }
+ 
++#if defined(__powerpc64__)
++    // On ppc64+glibc, some syscalls seem to accidentally negate the first
++    // parameter which causes checks against it to fail. For now, manually
++    // negate them back.
++    // TODO(shawn@anastas.io): investigate this issue further
++    auto nr = SECCOMP_SYSCALL(ctx);
++    if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat ||
++        nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) {
++        if (static_cast<int>(SECCOMP_PARM1(ctx)) > 0) {
++            SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx);
++        }
++    }
++#endif
++
+     // Copy the seccomp-specific data into a arch_seccomp_data structure. This
+     // is what we are showing to TrapFnc callbacks that the system call
+     // evaluator registered with the sandbox.
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/services/credentials.cc
+@@ -79,7 +79,7 @@ bool ChrootToSafeEmptyDir() {
+   pid_t pid = -1;
+   alignas(16) char stack_buf[PTHREAD_STACK_MIN];
+ #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
+-    defined(ARCH_CPU_MIPS_FAMILY)
++    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
+   // The stack grows downward.
+   void* stack = stack_buf + sizeof(stack_buf);
+ #else
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc
+@@ -151,7 +151,7 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
+ #if defined(__NR_fstatat)
+     case __NR_fstatat:
+ #endif
+-#if defined(__x86_64__) || defined(__aarch64__)
++#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
+     case __NR_newfstatat:
+ #endif
+       return !fast_check_in_client_ || allowed_command_set_.test(COMMAND_STAT);
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h
+@@ -29,6 +29,9 @@
+ #ifndef EM_AARCH64
+ #define EM_AARCH64 183
+ #endif
++#ifndef EM_PPC64
++#define EM_PPC64 21
++#endif
+ 
+ #ifndef __AUDIT_ARCH_64BIT
+ #define __AUDIT_ARCH_64BIT 0x80000000
+@@ -54,6 +57,12 @@
+ #ifndef AUDIT_ARCH_AARCH64
+ #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
+ #endif
++#ifndef AUDIT_ARCH_PPC64
++#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT)
++#endif
++#ifndef AUDIT_ARCH_PPC64LE
++#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
++#endif
+ 
+ // For prctl.h
+ #ifndef PR_SET_SECCOMP
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h
+@@ -13,7 +13,7 @@
+ // (not undefined, but defined different values and in different memory
+ // layouts). So, fill the gap here.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
+-    defined(__aarch64__)
++    defined(__aarch64__) || defined(__powerpc64__)
+ 
+ #define LINUX_SIGHUP 1
+ #define LINUX_SIGINT 2
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h
+@@ -35,5 +35,9 @@
+ #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
+ #endif
+ 
++#if defined(__powerpc64__)
++#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h"
++#endif
++
+ #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
+ 
+--- qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/linux_ucontext.h
+@@ -11,6 +11,8 @@
+ #include "sandbox/linux/system_headers/arm_linux_ucontext.h"
+ #elif defined(__i386__)
+ #include "sandbox/linux/system_headers/i386_linux_ucontext.h"
++#elif defined(__powerpc64__)
++#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h"
+ #else
+ #error "No support for your architecture in PNaCl header"
+ #endif
+new file mode 100644
+--- /dev/null
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_syscalls.h
+@@ -0,0 +1,12 @@
++// Copyright 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
++#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
++
++#include <asm/unistd.h>
++
++//TODO: is it necessary to redefine syscall numbers for PPC64?
++
++#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_
+new file mode 100644
+--- /dev/null
++++ qtwebengine/src/3rdparty/chromium/sandbox/linux/system_headers/ppc64_linux_ucontext.h
+@@ -0,0 +1,12 @@
++// Copyright 2014 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
++#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
++
++#include <sys/ucontext.h>
++
++//TODO: is it necessary to redefine ucontext on PPC64?
++
++#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_
+--- qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
++++ qtwebengine/src/3rdparty/chromium/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+@@ -15,6 +15,11 @@
+ #include "sandbox/linux/system_headers/linux_syscalls.h"
+ #include "services/service_manager/sandbox/linux/sandbox_linux.h"
+ 
++// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
++#ifdef __powerpc64__
++#include <termios.h>
++#endif
++
+ // TODO(vignatti): replace the local definitions below with #include
+ // <linux/dma-buf.h> once kernel version 4.6 becomes widely used.
+ #include <linux/types.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
++++ qtwebengine/src/3rdparty/chromium/third_party/angle/src/libANGLE/Constants.h
+@@ -9,6 +9,7 @@
+ #ifndef LIBANGLE_CONSTANTS_H_
+ #define LIBANGLE_CONSTANTS_H_
+ 
++#include <cstddef>
+ #include "common/platform.h"
+ 
+ namespace gl
+--- qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/boringssl/BUILD.gn
+@@ -100,6 +100,13 @@ if (is_win && !is_msan && current_cpu != "arm64") {
+       } else {
+         public_configs = [ ":no_asm_config" ]
+       }
++    } else if (current_cpu == "ppc64") {
++      if (is_linux) {
++        # TODO: ppc64 (be) check
++        sources += crypto_sources_linux_ppc64le
++      } else {
++        public_configs = [ ":no_asm_config" ]
++      }
+     } else {
+       public_configs = [ ":no_asm_config" ]
+     }
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
+@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU;
+ typedef MDRawContextARM64_Old RawContextCPU;
+ #elif defined(__mips__)
+ typedef MDRawContextMIPS RawContextCPU;
++#elif defined(__powerpc64__)
++typedef MDRawContextPPC64 RawContextCPU;
+ #else
+ #error "This code has not been ported to your platform yet."
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
+@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
+   out->float_save.fir = mcontext.fpc_eir;
+ #endif
+ }
+-#endif  // __mips__
++
++#elif defined(__powerpc64__)
++
++uintptr_t ThreadInfo::GetInstructionPointer() const {
++    return mcontext.gp_regs[PT_NIP];
++}
++
++void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
++    out->context_flags = MD_CONTEXT_PPC64_FULL;
++    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
++        out->gpr[i] = mcontext.gp_regs[i];
++
++    out->lr = mcontext.gp_regs[PT_LNK];
++    out->srr0 = mcontext.gp_regs[PT_NIP];
++    out->srr1 = mcontext.gp_regs[PT_MSR];
++    out->cr = mcontext.gp_regs[PT_CCR];
++    out->xer = mcontext.gp_regs[PT_XER];
++    out->ctr = mcontext.gp_regs[PT_CTR];
++    
++    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
++        out->float_save.fpregs[i] = mcontext.fp_regs[i];
++
++    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];
++
++    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
++        out->vector_save.save_vr[i] = \
++            {(((uint64_t)vregs.vrregs[i][0]) << 32) 
++                          | vregs.vrregs[i][1], 
++            (((uint64_t)vregs.vrregs[i][2]) << 32)
++                         | vregs.vrregs[i][3]};
++
++    out->vrsave = vregs.vrsave;
++    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};
++    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
++}
++#endif  // __powerpc64__
+ 
+ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
+   assert(gp_regs || size);
+@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
+     *gp_regs = mcontext.gregs;
+   if (size)
+     *size = sizeof(mcontext.gregs);
++#elif defined(__powerpc64__)
++  if (gp_regs)
++    *gp_regs = mcontext.gp_regs;
++  if (size)
++    *size = sizeof(mcontext.gp_regs);
+ #else
+   if (gp_regs)
+     *gp_regs = &regs;
+@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
+     *fp_regs = &mcontext.fpregs;
+   if (size)
+     *size = sizeof(mcontext.fpregs);
++#elif defined(__powerpc64__)
++  if (fp_regs)
++    *fp_regs = &mcontext.fp_regs;
++  if (size)
++    *size = sizeof(mcontext.fp_regs);
+ #else
+   if (fp_regs)
+     *fp_regs = &fpregs;
+@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
+ #endif
+ }
+ 
++#if defined(__powerpc64__)
++void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {
++    if (v_regs)
++        *v_regs = &vregs;
++    if (size)
++        *size = sizeof(vregs);
++}
++#endif
++
+ }  // namespace google_breakpad
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
+@@ -68,6 +68,10 @@ struct ThreadInfo {
+   // Use the structures defined in <sys/user.h>
+   struct user_regs_struct regs;
+   struct user_fpsimd_struct fpregs;
++#elif defined(__powerpc64__)
++  // Use the structures defined in <sys/ucontext.h>.
++  mcontext_t mcontext;
++  vrregset_t vregs;
+ #elif defined(__mips__)
+   // Use the structure defined in <sys/ucontext.h>.
+   mcontext_t mcontext;
+@@ -84,6 +88,11 @@ struct ThreadInfo {
+ 
+   // Returns the pointer and size of float point register area.
+   void GetFloatingPointRegisters(void** fp_regs, size_t* size);
++
++#if defined(__powerpc64__)
++  // Returns the pointer and size of the vector register area. (PPC64 only)
++  void GetVectorRegisters(void** v_regs, size_t* size);
++#endif
+ };
+ 
+ }  // namespace google_breakpad
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
+   out->float_save.fir = uc->uc_mcontext.fpc_eir;  // Unused.
+ #endif
+ }
++
++#elif defined(__powerpc64__)
++
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
++    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];
++}
++
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
++    return uc->uc_mcontext.gp_regs[PT_NIP];
++}
++
++void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,
++                                    const vrregset_t* vregs) {
++    out->context_flags = MD_CONTEXT_PPC64_FULL;
++
++    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
++        out->gpr[i] = uc->uc_mcontext.gp_regs[i];
++
++    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    
++    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];
++    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];
++    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];
++    out->xer = uc->uc_mcontext.gp_regs[PT_XER];
++    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];
++    
++    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
++        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];
++
++    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];
++
++    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)
++        out->vector_save.save_vr[i] =
++            {(((uint64_t)vregs->vrregs[i][0]) << 32) 
++                         | vregs->vrregs[i][1], 
++             (((uint64_t)vregs->vrregs[i][2]) << 32)
++                         | vregs->vrregs[i][3]};
++
++    out->vrsave = vregs->vrsave;
++    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};
++    out->vector_save.save_vrvalid = 0xFFFFFFFF; 
++}
++
+ #endif
+ 
+ }  // namespace google_breakpad
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -54,6 +54,9 @@ struct UContextReader {
+ #elif defined(__aarch64__)
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+                              const struct fpsimd_context* fpregs);
++#elif defined(__powerpc64__)
++  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
++                             const vrregset_t* vregs);
+ #else
+   static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -467,9 +467,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
+     memcpy(&g_crash_context_.float_state, fp_ptr,
+            sizeof(g_crash_context_.float_state));
+   }
++#elif defined(__powerpc64__)
++  // On PPC64, we must copy VR state
++  ucontext_t* uc_ptr = (ucontext_t*)uc;
++  if (uc_ptr->uc_mcontext.v_regs) {
++    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,
++           sizeof(g_crash_context_.vector_state));
++  }
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+   // FP state is not part of user ABI on ARM Linux.
+-  // In case of MIPS Linux FP state is already part of ucontext_t
++  // In case of MIPS, Linux FP state is already part of ucontext_t
+   // and 'float_state' is not a member of CrashContext.
+   ucontext_t* uc_ptr = (ucontext_t*)uc;
+   if (uc_ptr->uc_mcontext.fpregs) {
+@@ -707,11 +714,19 @@ bool ExceptionHandler::WriteMinidump() {
+   }
+ #endif
+ 
+-#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
++#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \
++    && !defined(__powerpc64__)
+   // FPU state is not part of ARM EABI ucontext_t.
+   memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
+          sizeof(context.float_state));
+ #endif
++
++#if defined(__powerpc64__)
++  // Vector registers must be copied on PPC64
++  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,
++         sizeof(context.vector_state));
++#endif
++
+   context.tid = sys_gettid();
+ 
+   // Add an exception stream to the minidump for better reporting.
+@@ -732,6 +747,9 @@ bool ExceptionHandler::WriteMinidump() {
+ #elif defined(__mips__)
+   context.siginfo.si_addr =
+       reinterpret_cast<void*>(context.context.uc_mcontext.pc);
++#elif defined(__powerpc64__)
++  context.siginfo.si_addr =
++      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);
+ #else
+ #error "This code has not been ported to your platform yet."
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
+@@ -192,7 +192,11 @@ class ExceptionHandler {
+     siginfo_t siginfo;
+     pid_t tid;  // the crashing thread.
+     ucontext_t context;
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++    // PPC64's FP state is a part of ucontext_t like MIPS but the vector
++    // state is not, so a struct is needed.
++    vstate_t vector_state;
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+     // #ifdef this out because FP state is not part of user ABI for Linux ARM.
+     // In case of MIPS Linux FP state is already part of ucontext_t so
+     // 'float_state' is not required.
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
+@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) {
+   }
+ 
+   // Wait a while until the child should have crashed.
+-  usleep(1000000);
++  usleep(2000000);
+   // Kill the child if it is still running.
+   kill(child, SIGKILL);
+ 
+@@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[] = {
+ #if defined(__mips__)
+   // mfc2 zero,Impl - usually illegal in userspace.
+   0x48, 0x00, 0x00, 0x48
++#elif defined(__powerpc64__)
++  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu
+ #else
+   // This crashes with SIGILL on x86/x86-64/arm.
+   0xff, 0xff, 0xff, 0xff
+@@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
+ 
+   // These are defined here so the parent can use them to check the
+   // data from the minidump afterwards.
+-  // Use 4k here because the OS will hand out a single page even
++  // Use the page size here because the OS will hand out a single page even
+   // if a smaller size is requested, and this test wants to
+   // test the upper bound of the memory range.
+-  const uint32_t kMemorySize = 4096;  // bytes
++  const uint32_t kMemorySize = getpagesize();  // bytes
+   const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
+ 
+   const pid_t child = fork();
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
+@@ -138,7 +138,9 @@ class MicrodumpWriter {
+                   const MicrodumpExtraInfo& microdump_extra_info,
+                   LinuxDumper* dumper)
+       : ucontext_(context ? &context->context : NULL),
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++        vector_state_(context ? &context->vector_state : NULL),
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+         float_state_(context ? &context->float_state : NULL),
+ #endif
+         dumper_(dumper),
+@@ -337,6 +339,8 @@ class MicrodumpWriter {
+ # else
+ #  error "This mips ABI is currently not supported (n32)"
+ #endif
++#elif defined(__powerpc64__)
++    const char kArch[] = "ppc64";
+ #else
+ #error "This code has not been ported to your platform yet"
+ #endif
+@@ -409,7 +413,9 @@ class MicrodumpWriter {
+   void DumpCPUState() {
+     RawContextCPU cpu;
+     my_memset(&cpu, 0, sizeof(RawContextCPU));
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+     UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
+ #else
+     UContextReader::FillCPUContext(&cpu, ucontext_);
+@@ -605,7 +611,9 @@ class MicrodumpWriter {
+   void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
+ 
+   const ucontext_t* const ucontext_;
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++  const google_breakpad::vstate_t* const vector_state_;
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+   const google_breakpad::fpstate_t* const float_state_;
+ #endif
+   LinuxDumper* dumper_;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
+@@ -278,10 +278,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) {
+   CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
+   ASSERT_TRUE(ContainsMicrodump(buf));
+ 
++  int page_size = getpagesize();
+ #ifdef __LP64__
+-  ASSERT_NE(std::string::npos,
+-            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
+-                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
++  // This test is only available for the following page sizes
++  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));
++  if (page_size == 4096) { 
++    ASSERT_NE(std::string::npos,
++              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "
++                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
++  } else {
++    ASSERT_NE(std::string::npos,
++              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "
++                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
++  }
+ #else
+   ASSERT_NE(std::string::npos,
+             buf.find("M 00001000 0000002A 00001000 "
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
+@@ -116,6 +116,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
+ #elif defined(__mips__)
+   stack_pointer =
+       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
++#elif defined(__powerpc64__)
++  stack_pointer =
++      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
+ #else
+ #error "This code hasn't been ported to your platform yet."
+ #endif
+@@ -200,7 +203,10 @@ bool LinuxCoreDumper::EnumerateThreads() {
+         memset(&info, 0, sizeof(ThreadInfo));
+         info.tgid = status->pr_pgrp;
+         info.ppid = status->pr_ppid;
+-#if defined(__mips__)
++#if defined(__powerpc64__)
++        for (int i = 0; i < 31; i++)
++            info.mcontext.gp_regs[i] = status->pr_reg[i];
++#elif defined(__mips__)
+ #if defined(__ANDROID__)
+         for (int i = EF_R0; i <= EF_R31; i++)
+           info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
+@@ -798,7 +798,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
+       reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
+ 
+   // The number of bytes of stack which we try to capture.
+-  static const ptrdiff_t kStackToCapture = 32 * 1024;
++  // This now depends on page_size to avoid missing data
++  // on systems with larger page sizes.
++  static const ptrdiff_t kStackToCapture = 8 * page_size;
+ 
+   const MappingInfo* mapping = FindMapping(stack_pointer);
+   if (!mapping)
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
+@@ -60,7 +60,8 @@ namespace google_breakpad {
+  (defined(__mips__) && _MIPS_SIM == _ABIO32)
+ typedef Elf32_auxv_t elf_aux_entry;
+ #elif defined(__x86_64) || defined(__aarch64__) || \
+-     (defined(__mips__) && _MIPS_SIM != _ABIO32)
++     (defined(__mips__) && _MIPS_SIM != _ABIO32) || \
++     defined(__powerpc64__)
+ typedef Elf64_auxv_t elf_aux_entry;
+ #endif
+ 
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+@@ -51,6 +51,8 @@
+ #define TID_PTR_REGISTER "rcx"
+ #elif defined(__mips__)
+ #define TID_PTR_REGISTER "$1"
++#elif defined(__powerpc64__)
++#define TID_PTR_REGISTER "r8"
+ #else
+ #error This test has not been ported to this platform.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+@@ -154,19 +154,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
+   return true;
+ }
+ 
+-bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)
+-{
++bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {
+ #ifdef PTRACE_GETREGSET
+   struct iovec io;
+   info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
+-  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
++  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
+     return false;
+   }
+ 
+   info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
+-  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
++  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
+     return false;
+   }
++
++#if defined(__powerpc64__)
++  // Grab the vector registers on PPC64 too
++  info->GetVectorRegisters(&io.iov_base, &io.iov_len);
++  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {
++    return false;
++  }
++#endif // defined(__powerpc64__)
++
+   return true;
+ #else
+   return false;
+@@ -303,6 +311,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
+ #elif defined(__mips__)
+   stack_pointer =
+       reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
++#elif defined(__powerpc64__)
++  stack_pointer =
++      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);
+ #else
+ #error "This code hasn't been ported to your platform yet."
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+@@ -457,6 +457,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
+ #elif defined(__mips__)
+     pid_t* process_tid_location =
+         reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
++#elif defined(__powerpc64__)
++    pid_t* process_tid_location =
++        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);
+ #else
+ #error This test has not been ported to this platform.
+ #endif
+@@ -553,6 +556,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) {
+   uintptr_t heap_addr = thread_info.regs.rcx;
+ #elif defined(__mips__)
+   uintptr_t heap_addr = thread_info.mcontext.gregs[1];
++#elif defined(__powerpc64__)
++  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];
+ #else
+ #error This test has not been ported to this platform.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+@@ -136,7 +136,9 @@ class MinidumpWriter {
+       : fd_(minidump_fd),
+         path_(minidump_path),
+         ucontext_(context ? &context->context : NULL),
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++        vector_state_(context ? &context->vector_state : NULL),
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+         float_state_(context ? &context->float_state : NULL),
+ #endif
+         dumper_(dumper),
+@@ -468,7 +470,9 @@ class MinidumpWriter {
+         if (!cpu.Allocate())
+           return false;
+         my_memset(cpu.get(), 0, sizeof(RawContextCPU));
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+         UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
+ #else
+         UContextReader::FillCPUContext(cpu.get(), ucontext_);
+@@ -891,7 +895,7 @@ class MinidumpWriter {
+     dirent->location.rva = 0;
+   }
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)
+   bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
+     char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
+     static const char vendor_id_name[] = "vendor_id";
+@@ -911,7 +915,9 @@ class MinidumpWriter {
+ 
+     // processor_architecture should always be set, do this first
+     sys_info->processor_architecture =
+-#if defined(__mips__)
++#if defined(__powerpc64__)
++        MD_CPU_ARCHITECTURE_PPC64;
++#elif defined(__mips__)
+ # if _MIPS_SIM == _ABIO32
+         MD_CPU_ARCHITECTURE_MIPS;
+ # elif _MIPS_SIM == _ABI64
+@@ -1327,7 +1333,9 @@ class MinidumpWriter {
+   const char* path_;  // Path to the file where the minidum should be written.
+ 
+   const ucontext_t* const ucontext_;  // also from the signal handler
+-#if !defined(__ARM_EABI__) && !defined(__mips__)
++#if defined(__powerpc64__)
++  const google_breakpad::vstate_t* const vector_state_;
++#elif !defined(__ARM_EABI__) && !defined(__mips__)
+   const google_breakpad::fpstate_t* const float_state_;  // ditto
+ #endif
+   LinuxDumper* dumper_;
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -47,6 +47,8 @@ class ExceptionHandler;
+ 
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
++#elif defined(__powerpc64__)
++typedef vrregset_t vstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+ typedef struct _fpstate fpstate_t;
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+@@ -710,6 +710,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) {
+ #elif defined(__mips__)
+   context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
+       invalid_stack_pointer;
++#elif defined(__powerpc64__)
++  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =
++      invalid_stack_pointer;
+ #else
+ # error "This code has not been ported to your platform yet."
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
+@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) {
+   }
+ 
+ #if defined(__x86_64__) || defined(__aarch64__) || \
+-   (defined(__mips__) && _MIPS_SIM == _ABI64)
+-
++   (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__)
+   struct kernel_stat st;
+   if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
+ #else
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
+@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) {
+ TEST_F(MemoryMappedFileTest, MapWithOffset) {
+   // Put more data in the test file this time. Offsets can only be
+   // done on page boundaries, so we need a two page file to test this.
+-  const int page_size = 4096;
+-  char data1[2 * page_size];
+-  size_t data1_size = sizeof(data1);
++  const int page_size = getpagesize();
++  char *data1 = static_cast<char*>(malloc(2 * page_size));
++  EXPECT_TRUE(data1 != NULL);
++  size_t data1_size = (2 * page_size);
+   for (size_t i = 0; i < data1_size; ++i) {
+     data1[i] = i & 0x7f;
+   }
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
+@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) {
+ 
+   EXPECT_EQ(0U, allocator.pages_allocated());
+   uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
++  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());
+   ASSERT_FALSE(p == NULL);
+-  EXPECT_EQ(3U, allocator.pages_allocated());
++  EXPECT_EQ(expected_pages, allocator.pages_allocated());
+   for (unsigned i = 1; i < 10; ++i) {
+     uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
+     ASSERT_FALSE(p == NULL);
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_linux.cc
+@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
+   // Check architecture and set architecture variable to corresponding flag
+   // in objdump.
+   switch (context->GetContextCPU()) {
++#if defined(__i386) || defined(__x86_64)
+     case MD_CONTEXT_X86:
+       architecture = "i386";
+       break;
+     case MD_CONTEXT_AMD64:
+       architecture = "i386:x86-64";
+       break;
++#endif
+     default:
+       // Unsupported architecture. Note that ARM architectures are not
+       // supported because objdump does not support ARM.
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc
+@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) {
+ }
+ 
+ TEST(ExploitabilityTest, TestWindowsEngine) {
++// The following tests are only executable on an x86-class linux machine.
++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+             ExploitabilityFor("ascii_read_av.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) {
+             ExploitabilityFor("read_av_clobber_write.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
+             ExploitabilityFor("read_av_conditional.dmp"));
++#endif
+ }
+ 
+ TEST(ExploitabilityTest, TestLinuxEngine) {
++// The following tests are only executable on an x86-class linux machine.
++#if defined(__i386) || defined(__x86_64)
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+             ExploitabilityFor("linux_null_read_av.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
+             ExploitabilityFor("linux_executable_heap.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+             ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
+-#ifndef _WIN32
++#endif
++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+             ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
+@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) {
+             ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
+   ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
+             ExploitabilityFor("linux_write_to_under_4k.dmp"));
+-#endif  // _WIN32
++#endif  // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64))
+ }
+ 
+-#ifndef _WIN32
++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
+ TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
+   ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
+   uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
+@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
+                                                          context,
+                                                          &write_address));
+ }
+-#endif  // _WIN32
++#endif  // !defined(_WIN32) && (defined(__i386) || defined(__x86_64))
++
+ 
+ }  // namespace
+--- qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
+@@ -76,6 +76,8 @@
+   #define ELF_ARCH  EM_MIPS
+ #elif defined(__aarch64__)
+   #define ELF_ARCH  EM_AARCH64
++#elif defined(__powerpc64__)
++  #define ELF_ARCH  EM_PPC64
+ #endif
+ 
+ #if defined(__arm__)
+@@ -86,6 +88,8 @@ typedef user_regs user_regs_struct;
+ #elif defined (__mips__)
+ // This file-local typedef simplifies the source code.
+ typedef gregset_t user_regs_struct;
++#elif defined(__powerpc64__)
++typedef struct pt_regs user_regs_struct;
+ #endif
+ 
+ using google_breakpad::MDTypeHelper;
+@@ -320,6 +324,9 @@ struct CrashedProcess {
+ #endif
+ #if defined(__aarch64__)
+     user_fpsimd_struct fpregs;
++#endif
++#if defined(__powerpc64__)
++    mcontext_t mcontext;
+ #endif
+     uintptr_t stack_addr;
+     const uint8_t* stack;
+@@ -534,6 +541,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread,
+   thread->mcontext.fpc_eir = rawregs->float_save.fir;
+ #endif
+ }
++#elif defined(__powerpc64__)
++static void
++ParseThreadRegisters(CrashedProcess::Thread* thread,
++                     const MinidumpMemoryRange& range) {
++  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);
++
++  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)
++    thread->mcontext.gp_regs[i] = rawregs->gpr[i];
++
++  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;
++  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;
++  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;
++  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;
++  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;
++  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;
++  thread->mcontext.v_regs->vrsave = rawregs->vrsave;
++
++  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)
++      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];
++
++  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;
++
++  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {
++      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;
++      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;
++      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;
++      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;
++  }
++
++  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;
++}
++
+ #else
+ #error "This code has not been ported to your platform yet"
+ #endif
+@@ -622,6 +661,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo,
+ # else
+ #  error "This mips ABI is currently not supported (n32)"
+ # endif
++#elif defined(__powerpc64__)
++  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {
++    fprintf(stderr,
++            "This version of minidump-2-core only supports PPC64.\n");
++    exit(1);
++  }
+ #else
+ #error "This code has not been ported to your platform yet"
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/CONTRIBUTORS
+@@ -13,3 +13,4 @@ Mark Mentovai <mark@chromium.org>
+ Robert Sesek <rsesek@chromium.org>
+ Scott Graham <scottmg@chromium.org>
+ Joshua Peraza <jperaza@chromium.org>
++Shawn Anastasio <shawn@anastas.io>
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/user.h
+@@ -15,6 +15,7 @@
+ #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_
+ #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_
+ 
++#include <cstddef>
+ #include_next <sys/user.h>
+ 
+ #include <features.h>
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h
+@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 {
+   uint64_t fir;
+ };
+ 
++//! \brief ppc64-specific flags for MinidumpPPC64::context_flags
++//! Based on minidump_cpu_ppc64.h from breakpad
++enum MinidumpContextPPC64Flags : uint32_t {
++  //! \brief Identifies the context as PPC64.
++  kMinidumpContextPPC64 = 0x01000000,
++
++  //! \brief Indicates the validity of general purpose registers.
++  //!
++  //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid.
++  kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001,
++
++  //! \brief Indicates the validity of floating point registers.
++  //!
++  //! Registers `fp0`-`fp31`, `fpscr` are valid.
++  kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008,
++
++  //! \brief Indicates the validity of Altivec/VMX registers.
++  //!
++  //! Registers `v0`-`v31`, `vscr`, `vrsave`.
++  kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020,
++
++  //! \brief Indicates the validity of all registers
++  kMinidumpContextPPC64All = kMinidumpContextPPC64Base     |
++                             kMinidumpContextPPC64Floating |
++                             kMinidumpContextPPC64Vector
++};
++
++//! \brief A PPC64 CPU context carried in a minidump file.
++//! Based on minidump_cpu_ppc64.h from breakpad.
++struct MinidumpContextPPC64 {
++  uint64_t context_flags;
++
++  //! \brief General purpose registers.
++  uint64_t nip;
++  uint64_t msr;
++  uint64_t regs[32];
++  uint64_t ccr;
++  uint64_t xer;
++  uint64_t lnk;
++  uint64_t ctr;
++
++  //! \brief Floating point registers.
++  double fpregs[32];
++
++  //! \brief FPU status register.
++  double fpscr;
++
++  //! \brief Altivec/VMX vector registers.
++  struct {
++      //! \brief Vector registers are 128bits.
++      uint128_struct save_vr[32];
++      uint128_struct save_vscr;
++
++      //! \brief Padding included for breakpad compatibiltiy.
++      uint32_t save_pad5[4];
++
++      //! \brief VRSAVE register.
++      uint32_t save_vrsave;
++
++      //! \brief Padding included for breakpad compatibiltiy.
++      uint32_t save_pad6[7];
++  } vregs;
++};
++
+ }  // namespace crashpad
+ 
+ #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc
+@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
+       break;
+     }
+ 
++    case kCPUArchitecturePPC64: {
++      context = std::make_unique<MinidumpContextPPC64Writer>();
++      reinterpret_cast<MinidumpContextPPC64Writer*>(context.get())
++          ->InitalizeFromSnapshot(context_snapshot->ppc64);
++      break;
++    }
++
+     default: {
+       LOG(ERROR) << "unknown context architecture "
+                  << context_snapshot->architecture;
+@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const {
+   return sizeof(context_);
+ }
+ 
++MinidumpContextPPC64Writer::MinidumpContextPPC64Writer()
++  : MinidumpContextWriter(), context_() {
++    context_.context_flags = kMinidumpContextPPC64;
++}
++
++MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default;
++
++void MinidumpContextPPC64Writer::InitalizeFromSnapshot(
++    const CPUContextPPC64* context_snapshot) {
++  DCHECK_EQ(state(), kStateMutable);
++  DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64);
++
++  context_.context_flags = kMinidumpContextPPC64All;
++
++  memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs));
++  context_.nip = context_snapshot->nip;
++  context_.msr = context_snapshot->msr;
++  context_.ccr = context_snapshot->ccr;
++  context_.xer = context_snapshot->xer;
++  context_.lnk = context_snapshot->lnk;
++  context_.ctr = context_snapshot->ctr;
++
++  memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs));
++  context_.fpscr = context_snapshot->fpscr;
++
++  memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr,
++         sizeof(context_.vregs.save_vr));
++  memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr,
++         sizeof(context_.vregs.save_vscr));
++  context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave;
++}
++
++bool MinidumpContextPPC64Writer::WriteObject(
++    FileWriterInterface* file_writer) {
++  DCHECK_EQ(state(), kStateWritable);
++  return file_writer->Write(&context_, sizeof(context_));
++}
++
++size_t MinidumpContextPPC64Writer::ContextSize() const {
++  DCHECK_GE(state(), kStateFrozen);
++  return sizeof(context_);
++}
++
+ }  // namespace crashpad
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h
+@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
+   DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
+ };
+ 
++class MinidumpContextPPC64Writer final : public MinidumpContextWriter {
++ public:
++  MinidumpContextPPC64Writer();
++  ~MinidumpContextPPC64Writer() override;
++
++  //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot.
++  //!
++  //! \param[in] context_snapshot The context snapshot to use as source data.
++  //!
++  //! \note Valid in #kStateMutable. No mutation of context() may be done before
++  //!     calling this method, and it is not normally necessary to alter
++  //!     context() after calling this method.
++  void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot);
++
++  //! \brief Returns a pointer to the context structure that this object will
++  //!     write.
++  //!
++  //! \attention This returns a non-`const` pointer to this object’s private
++  //!     data so that a caller can populate the context structure directly.
++  //!     This is done because providing setter interfaces to each field in the
++  //!     context structure would be unwieldy and cumbersome. Care must be taken
++  //!     to populate the context structure correctly. The context structure
++  //!     must only be modified while this object is in the #kStateMutable
++  //!     state.
++  MinidumpContextPPC64* context() { return &context_; }
++
++ protected:
++  // MinidumpWritable:
++  bool WriteObject(FileWriterInterface* file_writer) override;
++
++  // MinidumpContextWriter:
++  size_t ContextSize() const override;
++
++ private:
++  MinidumpContextPPC64 context_;
++
++  DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer);
++};
++
+ }  // namespace crashpad
+ 
+ #endif  // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc
+@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) {
+       context, ExpectMinidumpContextMIPS64, kSeed);
+ }
+ 
++TEST(MinidumpContextWriter, PPC64_Zeros) {
++  EmptyContextTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
++    ExpectMinidumpContextPPC64);
++}
++
++TEST(MinidumpContextWriter, PPC64_FromSnapshot) {
++  constexpr uint32_t kSeed = 64;
++  CPUContextPPC64 context_ppc64;
++  CPUContext context;
++  context.ppc64 = &context_ppc64;
++  InitializeCPUContextPPC64(&context, kSeed);
++  FromSnapshotTest<MinidumpContextPPC64Writer, MinidumpContextPPC64>(
++      context, ExpectMinidumpContextPPC64, kSeed);
++}
++
+ }  // namespace
+ }  // namespace test
+ }  // namespace crashpad
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc
+@@ -126,6 +126,8 @@ std::string MinidumpMiscInfoDebugBuildString() {
+   static constexpr char kCPU[] = "mips";
+ #elif defined(ARCH_CPU_MIPS64EL)
+   static constexpr char kCPU[] = "mips64";
++#elif defined(ARCH_CPU_PPC64)
++  static constexpr char kCPU[] = "ppc64";
+ #else
+ #error define kCPU for this CPU
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc
+@@ -111,6 +111,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context,
+   for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) {
+     MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]);
+   }
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  MaybeCaptureMemoryAround(delegate, context.ppc64->nip);
++  for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) {
++    MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]);
++  }
+ #else
+ #error Port.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h
+@@ -43,7 +43,10 @@ enum CPUArchitecture {
+   kCPUArchitectureMIPSEL,
+ 
+   //! \brief 64-bit MIPSEL.
+-  kCPUArchitectureMIPS64EL
++  kCPUArchitectureMIPS64EL,
++
++  //! \brief 64-bit PPC64.
++  kCPUArchitecturePPC64
+ };
+ 
+ }  // namespace crashpad
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc
+@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const {
+       return arm->pc;
+     case kCPUArchitectureARM64:
+       return arm64->pc;
++    case kCPUArchitecturePPC64:
++      return ppc64->nip;
+     default:
+       NOTREACHED();
+       return ~0ull;
+@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const {
+       return arm->sp;
+     case kCPUArchitectureARM64:
+       return arm64->sp;
++    case kCPUArchitecturePPC64:
++      return ppc64->regs[1];
+     default:
+       NOTREACHED();
+       return ~0ull;
+@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const {
+     case kCPUArchitectureX86_64:
+     case kCPUArchitectureARM64:
+     case kCPUArchitectureMIPS64EL:
++    case kCPUArchitecturePPC64:
+       return true;
+     case kCPUArchitectureX86:
+     case kCPUArchitectureARM:
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h
+@@ -352,6 +352,24 @@ struct CPUContextMIPS64 {
+   uint64_t fir;
+ };
+ 
++//! \brief A context structure carrying PPC64 CPU state.
++struct CPUContextPPC64 {
++  uint64_t nip;
++  uint64_t msr;
++  uint64_t regs[32];
++  uint64_t ccr;
++  uint64_t xer;
++  uint64_t lnk;
++  uint64_t ctr;
++  double fpregs[32];
++  double fpscr;
++  struct {
++    uint128_struct save_vr[32];
++    uint128_struct save_vscr;
++    uint32_t save_vrsave;
++  } vregs;
++};
++
+ //! \brief A context structure capable of carrying the context of any supported
+ //!     CPU architecture.
+ struct CPUContext {
+@@ -382,6 +400,7 @@ struct CPUContext {
+     CPUContextARM64* arm64;
+     CPUContextMIPS* mipsel;
+     CPUContextMIPS64* mips64;
++    CPUContextPPC64* ppc64;
+   };
+ };
+ 
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h
+@@ -15,6 +15,7 @@
+ #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
+ #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_
+ 
++#include <cstring>
+ #include "build/build_config.h"
+ #include "snapshot/cpu_context.h"
+ #include "snapshot/linux/signal_context.h"
+@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS(
+ 
+ #endif  // ARCH_CPU_MIPS_FAMILY || DOXYGEN
+ 
++#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN
++
++//! \brief Initalizes a CPUContextPPC64 structure from native context
++//!     structures on Linux.
++//!
++//! \param[in] thread_context The native thread context.
++//! \param[in] float_context The native float context.
++//! \param[in] vector_context The native vector context.
++//! \param[out] context The CPUContextPPC64 structure to initalize.
++template <typename Traits>
++void InitializeCPUContextPPC64(
++    const ThreadContext::t64_t& thread_context,
++    const FloatContext::f64_t& float_context,
++    const VectorContext::v64_t& vector_context,
++    typename Traits::CPUContext* context) {
++
++  memcpy(context->regs, thread_context.gpr, sizeof(context->regs));
++  context->nip = thread_context.nip;
++  context->msr = thread_context.msr;
++  context->ccr = thread_context.ccr;
++  context->xer = thread_context.xer;
++  context->lnk = thread_context.lnk;
++  context->ctr = thread_context.ctr;
++
++  memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs));
++  context->fpscr = float_context.fpscr;
++
++  for (uint8_t i = 0; i < 32; i++) {
++    context->vregs.save_vr[i] = {
++      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
++        vector_context.vrregs[i][1],
++      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
++        vector_context.vrregs[i][3]
++    };
++  }
++  context->vregs.save_vrsave = vector_context.vrsave;
++  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
++}
++
++template <typename Traits>
++void InitializeCPUContextPPC64(
++    const SignalThreadContext64 &thread_context,
++    const SignalFloatContext64 &float_context,
++    const SignalVectorContext64 &vector_context,
++    typename Traits::CPUContext* context) {
++
++  memcpy(context->regs, thread_context.regs, sizeof(context->regs));
++  context->nip = thread_context.nip;
++  context->msr = thread_context.msr;
++  context->ccr = thread_context.ccr;
++  context->xer = thread_context.xer;
++  context->lnk = thread_context.lnk;
++  context->ctr = thread_context.ctr;
++
++  memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs));
++  context->fpscr = float_context.fpscr;
++
++  for (uint8_t i = 0; i < 32; i++) {
++    context->vregs.save_vr[i] = {
++      (((uint64_t)vector_context.vrregs[i][0]) << 32) |
++        vector_context.vrregs[i][1],
++      (((uint64_t)vector_context.vrregs[i][2]) << 32) |
++        vector_context.vrregs[i][3]
++    };
++  }
++  context->vregs.save_vrsave = vector_context.vrsave;
++  context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word};
++}
++
++
++#endif
++
+ }  // namespace internal
+ }  // namespace crashpad
+ 
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc
+@@ -159,9 +159,11 @@ void TestAgainstTarget(PtraceConnection* connection) {
+           const bool is_vdso_mapping =
+               device == 0 && inode == 0 && mapping_name == "[vdso]";
+           static constexpr char kPrefix[] = "linux-vdso.so.";
++          static constexpr char kPrefix64[] = "linux-vdso64.so.";
+           return is_vdso_mapping ==
+                  (module_name.empty() ||
+-                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0);
++                  module_name.compare(0, strlen(kPrefix), kPrefix) == 0 ||
++                  module_name.compare(0, strlen(kPrefix64), kPrefix64) == 0);
+         },
+         module_mapping->name,
+         module_mapping->device,
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc
+@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
+       reader, context_address, context_.mips64);
+ }
+ 
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++
++template <typename Traits>
++static bool ReadContext(ProcessReaderLinux* reader,
++                        LinuxVMAddress context_address,
++                        typename Traits::CPUContext* dest_context) {
++  const ProcessMemory* memory = reader->Memory();
++
++  LinuxVMAddress gp_regs_address = context_address +
++                                   offsetof(UContext, mcontext) +
++                                   offsetof(typename Traits::MContext, gp_regs);
++
++  typename Traits::SignalThreadContext thread_context;
++  if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) {
++    LOG(ERROR) << "Couldn't read gp_regs!";
++    return false;
++  }
++
++  LinuxVMAddress fp_regs_address = context_address +
++                                   offsetof(UContext, mcontext) +
++                                   offsetof(typename Traits::MContext, fp_regs);
++
++  typename Traits::SignalFloatContext fp_context;
++  if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) {
++    LOG(ERROR) << "Couldn't read fp_regs!";
++    return false;
++  }
++
++  LinuxVMAddress v_regs_ptr_address = context_address +
++                                  offsetof(UContext, mcontext) +
++                                  offsetof(typename Traits::MContext, vmx_reserve) + 8;
++
++  typename Traits::SignalVectorContext v_context;
++  if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) {
++    LOG(ERROR) << "Couldn't read v_regs!";
++    return false;
++  }
++
++  InitializeCPUContextPPC64<ContextTraits64>(thread_context, fp_context,
++                            v_context, dest_context);
++
++  return true;
++}
++
++template<>
++bool ExceptionSnapshotLinux::ReadContext<ContextTraits64>(
++    ProcessReaderLinux* reader,
++    LinuxVMAddress context_address) {
++  context_.architecture = kCPUArchitecturePPC64;
++  context_.ppc64 = &context_union_.ppc64;
++
++  return internal::ReadContext<ContextTraits64>(
++      reader, context_address, context_.ppc64);
++}
++
++template<>
++bool ExceptionSnapshotLinux::ReadContext<ContextTraits32>(
++    ProcessReaderLinux* reader,
++    LinuxVMAddress context_address) {
++  // PPC64 is 64-bit
++  return false;
++}
++
+ #endif  // ARCH_CPU_X86_FAMILY
+ 
+ bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h
+@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+     CPUContextMIPS mipsel;
+     CPUContextMIPS64 mips64;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    CPUContextPPC64 ppc64;
+ #endif
+   } context_union_;
+   CPUContext context_;
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc
+@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
+             0);
+ #undef CPU_ARCH_NAME
+ }
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++using NativeCPUContext = ucontext_t;
++
++void InitializeContext(NativeCPUContext* context) {
++  for (size_t reg = 0; reg < 32; ++reg) {
++    context->uc_mcontext.gp_regs[reg] = reg;
++  }
++
++  memset(&context->uc_mcontext.fp_regs, 44,
++      sizeof(context->uc_mcontext.fp_regs));
++}
+ 
++void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) {
++  EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64);
++
++  for (size_t reg = 0; reg < 32; ++reg) {
++    EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]);
++  }
++
++  EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs,
++            sizeof(actual.ppc64->fpregs)), 0);
++}
+ #else
+ #error Port.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc
+@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29]
+                                     : thread_info.thread_context.t32.regs[29];
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  stack_pointer = thread_info.thread_context.t64.gpr[1];
+ #else
+ #error Port.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux_test.cc
+@@ -591,6 +591,8 @@ bool WriteTestModule(const base::FilePath& module_path) {
+   module.ehdr.e_machine = EM_AARCH64;
+ #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL)
+   module.ehdr.e_machine = EM_MIPS;
++#elif defined(ARCH_CPU_PPC64)
++  module.ehdr.e_machine = EM_PPC64;
+ #endif
+ 
+   module.ehdr.e_version = EV_CURRENT;
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h
+@@ -422,6 +422,89 @@ static_assert(offsetof(UContext<ContextTraits64>, mcontext.fpregs) ==
+               "context offset mismatch");
+ #endif
+ 
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++
++struct SignalThreadContext64 {
++  uint64_t regs[32];
++  uint64_t nip;
++  uint64_t msr;
++  uint64_t orig_r3;
++  uint64_t ctr;
++  uint64_t lnk;
++  uint64_t xer;
++  uint64_t ccr;
++  uint64_t softe;
++  uint64_t trap;
++  uint64_t dar;
++  uint64_t dsisr;
++  uint64_t result;
++  uint64_t dscr;
++  uint64_t fpr0[3];
++};
++
++struct SignalFloatContext64 {
++  double regs[32];
++  double fpscr;
++};
++
++struct SignalVectorContext64 {
++  int32_t vrregs[32][4];
++  struct {
++    int32_t __pad[3];
++    int32_t vscr_word;
++  } vscr;
++  int32_t vrsave;
++  int32_t __pad[3];
++} __attribute__((__aligned__(16)));
++
++
++#pragma pack(pop)
++struct MContext64 {
++  uint64_t reserved[4];
++  int32_t signal;
++  int32_t __pad0;
++  uint64_t handler;
++  uint64_t oldmask;
++  uint64_t pt_regs_ptr;
++  SignalThreadContext64 gp_regs;
++  SignalFloatContext64  fp_regs;
++  SignalVectorContext64 *v_regs;
++  int64_t vmx_reserve[69];
++};
++
++struct ContextTraits64 : public Traits64 {
++  using MContext = MContext64;
++  using SignalThreadContext = SignalThreadContext64;
++  using SignalFloatContext = SignalFloatContext64;
++  using SignalVectorContext = SignalVectorContext64;
++  using CPUContext = CPUContextPPC64;
++};
++
++struct ContextTraits32 : public Traits32 {};
++
++struct UContext {
++  uint64_t flags;
++  uint64_t link;
++  SignalStack<ContextTraits64> stack;
++  Sigset<ContextTraits64> sigmask;
++  MContext64 mcontext;
++};
++#pragma pack(push, 1)
++
++static_assert(sizeof(UContext) == sizeof(ucontext_t),
++              "ucontext_t size mismatch");
++static_assert(sizeof(MContext64) == sizeof(mcontext_t),
++              "mcontext_t size mismatch");
++static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t),
++              "gregset_t size mismatch");
++static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t),
++              "fpregset_t size mismatch");
++static_assert(sizeof(SignalVectorContext64) == sizeof(_libc_vrstate),
++              "vrstate size mismatch");
++static_assert(offsetof(UContext, mcontext) ==
++              offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch");
++static_assert(offsetof(MContext64, gp_regs) ==
++              offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch");
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc
+@@ -203,6 +203,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL
+                                     : kCPUArchitectureMIPSEL;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  return kCPUArchitecturePPC64;
+ #else
+ #error port to your architecture
+ #endif
+@@ -218,6 +220,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   // Not implementable on MIPS
+   return 0;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  // Not yet implemented on PPC64
++  return 0;
+ #else
+ #error port to your architecture
+ #endif
+@@ -238,6 +243,9 @@ std::string SystemSnapshotLinux::CPUVendor() const {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   // Not implementable on MIPS
+   return std::string();
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  // Not yet implemented on PPC64
++  return std::string();
+ #else
+ #error port to your architecture
+ #endif
+@@ -371,6 +379,9 @@ bool SystemSnapshotLinux::NXEnabled() const {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   // Not implementable on MIPS
+   return false;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  // Not yet implemented on PPC64
++  return false;
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc
+@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
+         thread.thread_info.float_context.f32,
+         context_.mipsel);
+   }
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  context_.architecture = kCPUArchitecturePPC64;
++  context_.ppc64 = &context_union_.ppc64;
++  InitializeCPUContextPPC64<ContextTraits64>(
++      thread.thread_info.thread_context.t64,
++      thread.thread_info.float_context.f64,
++      thread.thread_info.vector_context.v64,
++      context_.ppc64);
+ #else
+ #error Port.
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h
+@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot {
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+     CPUContextMIPS mipsel;
+     CPUContextMIPS64 mips64;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    CPUContextPPC64 ppc64;
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc
+@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) {
+     if (type == AT_IGNORE) {
+       continue;
+     }
++#if defined(ARCH_CPU_PPC64_FAMILY)
++    if (type == AT_IGNOREPPC) {
++      continue;
++    }
++#endif
+     if (!MapInsertOrReplace(&values_, type, value, nullptr)) {
+       LOG(ERROR) << "duplicate auxv entry";
+       return false;
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc
+@@ -93,8 +93,8 @@ int PtraceBroker::Run() {
+ }
+ 
+ bool PtraceBroker::AllocateAttachments() {
+-  constexpr size_t page_size = 4096;
+-  constexpr size_t alloc_size =
++  static size_t page_size = getpagesize();
++  size_t alloc_size =
+       (sizeof(ScopedPtraceAttach) + page_size - 1) & ~(page_size - 1);
+   void* alloc = sbrk(alloc_size);
+   if (reinterpret_cast<intptr_t>(alloc) == -1) {
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc
+@@ -394,6 +394,64 @@ bool GetThreadArea64(pid_t tid,
+   return true;
+ }
+ 
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it).
++// That means we can simply use PTRACE_GETREGESET.
++
++template <typename Destination>
++bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) {
++  iovec iov;
++  iov.iov_base = reinterpret_cast<void*>(dest);
++  iov.iov_len = sizeof(*dest);
++  if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast<void*>(set), &iov) != 0) {
++    PLOG_IF(ERROR, can_log) << "ptrace";
++    return false;
++  }
++  if (iov.iov_len != sizeof(*dest)) {
++    LOG_IF(ERROR, can_log) << "Unexpected registers size";
++    return false;
++  }
++  return true;
++}
++
++bool GetVectorRegisters64(pid_t tid,
++                          VectorContext* context,
++                          bool can_log) {
++  return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log);
++}
++
++bool GetFloatingPointRegisters64(pid_t tid,
++                                 FloatContext* context,
++                                 bool can_log) {
++  return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log);
++}
++
++bool GetThreadArea64(pid_t tid,
++                     const ThreadContext& context,
++                     LinuxVMAddress* address,
++                     bool can_log) {
++  // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer
++  // is stored in GPR 13.
++  ThreadContext::t64_t tc;
++  if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) {
++    LOG_IF(ERROR, can_log) << "Unable to get thread pointer!";
++    return false;
++  }
++
++  *address = tc.gpr[13];
++
++  return true;
++}
++
++// Stubs for 32-bit functions not applicable on PPC64
++bool GetFloatingPointRegisters32(pid_t tid,
++                                 FloatContext* context,
++                                 bool can_log) { return false; }
++bool GetThreadArea32(pid_t tid,
++                     const ThreadContext &context,
++                     LinuxVMAddress *address,
++                     bool can_log) { return false; }
++
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+@@ -486,6 +544,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) {
+   if (is_64_bit_) {
+     return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) &&
+            GetFloatingPointRegisters64(tid, &info->float_context, can_log_) &&
++#if defined(ARCH_CPU_PPC64_FAMILY)
++           GetVectorRegisters64(tid, &info->vector_context, can_log_) &&
++#endif
+            GetThreadArea64(tid,
+                            info->thread_context,
+                            &info->thread_specific_data_address,
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h
+@@ -28,6 +28,10 @@
+ #include <android/api-level.h>
+ #endif
+ 
++#if defined(ARCH_CPU_PPC64_FAMILY)
++#include <sys/ucontext.h>
++#endif
++
+ namespace crashpad {
+ 
+ //! \brief The set of general purpose registers for an architecture family.
+@@ -79,6 +83,8 @@ union ThreadContext {
+     uint32_t cp0_status;
+     uint32_t cp0_cause;
+     uint32_t padding1_;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    // PPC64 is 64-bit
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+@@ -132,6 +138,21 @@ union ThreadContext {
+     uint64_t cp0_badvaddr;
+     uint64_t cp0_status;
+     uint64_t cp0_cause;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    // Reflects struct pt_regs in asm/ptrace.h.
++    uint64_t gpr[32];
++    uint64_t nip;
++    uint64_t msr;
++    uint64_t orig_gpr3;
++    uint64_t ctr;
++    uint64_t lnk;
++    uint64_t xer;
++    uint64_t ccr;
++    uint64_t softe;
++    uint64_t trap;
++    uint64_t dar;
++    uint64_t dsisr;
++    uint64_t result;
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+@@ -143,6 +164,8 @@ union ThreadContext {
+   using NativeThreadContext = user_regs;
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+ // No appropriate NativeThreadsContext type available for MIPS
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  using NativeThreadContext = struct pt_regs;
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64
+@@ -218,6 +241,9 @@ union FloatContext {
+     } fpregs[32];
+     uint32_t fpcsr;
+     uint32_t fpu_id;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    // Crashpad's PPC support is 64-bit only, so this
++    // 32bit-only struct is declared as empty.
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+@@ -252,6 +278,10 @@ union FloatContext {
+     double fpregs[32];
+     uint32_t fpcsr;
+     uint32_t fpu_id;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++    // Reflects fpregset_t in sys/ucontext.h
++    double fpregs[32];
++    double fpscr;
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86_FAMILY
+@@ -280,6 +310,8 @@ union FloatContext {
+   static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch");
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+ // No appropriate floating point context native type for available MIPS.
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch");
+ #else
+ #error Port.
+ #endif  // ARCH_CPU_X86
+@@ -287,6 +319,26 @@ union FloatContext {
+ static_assert(std::is_standard_layout<FloatContext>::value,
+               "Not standard layout");
+ 
++//! \brief The vector registers used for an architecture family
++union VectorContext {
++  struct v32_t {} v32;
++#if defined(ARCH_CPU_PPC64_FAMILY)
++  __attribute__((__aligned__(16))) // Vector context must be doubleword aligned.
++#endif
++  struct v64_t {
++#if defined(ARCH_CPU_PPC64_FAMILY)
++    // Reflects vrregset_t in sys/ucontext.h
++    uint32_t vrregs[32][4];
++    struct {
++      uint32_t __pad[3];
++      uint32_t vscr_word;
++    } vscr;
++    uint32_t vrsave;
++    uint32_t __pad[3];
++#endif
++  } v64;
++};
++
+ //! \brief A collection of `ptrace`-able information about a thread.
+ struct ThreadInfo {
+   ThreadInfo();
+@@ -298,6 +350,9 @@ struct ThreadInfo {
+   //! \brief The floating point registers for the thread.
+   FloatContext float_context;
+ 
++  //! \brief (Optional) The vector registers used for the thread.
++  VectorContext vector_context;
++
+   //! \brief The thread-local storage address for the thread.
+   LinuxVMAddress thread_specific_data_address;
+ };
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h
+@@ -66,6 +66,7 @@ using NativeCPUContext = ucontext_t;
+ //!     macOS/Linux/Fuchsia | x86_64       | `%%rdi`
+ //!     Linux               | ARM/ARM64    | `r0`/`x0`
+ //!     Linux               | MIPS/MIPS64  | `$a0`
++//!     Linux               | PPC64        | `r3`
+ //!
+ //!     Additionally, the value `LR` on ARM/ARM64 will be the return address of
+ //!     this function.
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S
+@@ -28,7 +28,7 @@
+   .globl CAPTURECONTEXT_SYMBOL2
+ #if defined(__i386__) || defined(__x86_64__)
+   .balign 16, 0x90
+-#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__)
++#elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)
+   .balign 4, 0x0
+ #endif
+ 
+@@ -419,4 +419,214 @@ CAPTURECONTEXT_SYMBOL2:
+   jr $ra
+ 
+   .set at
++#elif defined(__powerpc64__)
++  // Store r0-r31
++  std 0, 0xe8(3)   // context->uc_mcontext.gp_regs[0]
++  std 1, 0xf0(3)   // context->uc_mcontext.gp_regs[1]
++  std 2, 0xf8(3)   // context->uc_mcontext.gp_regs[2]
++  // note that r3's original value was lost
++  std 3, 0x100(3)  // context->uc_mcontext.gp_regs[3]
++  std 4, 0x108(3)  // context->uc_mcontext.gp_regs[4]
++  std 5, 0x110(3)  // context->uc_mcontext.gp_regs[5]
++  std 6, 0x118(3)  // context->uc_mcontext.gp_regs[6]
++  std 7, 0x120(3)  // context->uc_mcontext.gp_regs[7]
++  std 8, 0x128(3)  // context->uc_mcontext.gp_regs[8]
++  std 9, 0x130(3)  // context->uc_mcontext.gp_regs[9]
++  std 10, 0x138(3) // context->uc_mcontext.gp_regs[10]
++  std 11, 0x140(3) // context->uc_mcontext.gp_regs[11]
++  std 12, 0x148(3) // context->uc_mcontext.gp_regs[12]
++  std 13, 0x150(3) // context->uc_mcontext.gp_regs[13]
++  std 14, 0x158(3) // context->uc_mcontext.gp_regs[14]
++  std 15, 0x160(3) // context->uc_mcontext.gp_regs[15]
++  std 16, 0x168(3) // context->uc_mcontext.gp_regs[16]
++  std 17, 0x170(3) // context->uc_mcontext.gp_regs[17]
++  std 18, 0x178(3) // context->uc_mcontext.gp_regs[18]
++  std 19, 0x180(3) // context->uc_mcontext.gp_regs[19]
++  std 20, 0x188(3) // context->uc_mcontext.gp_regs[20]
++  std 21, 0x190(3) // context->uc_mcontext.gp_regs[21]
++  std 22, 0x198(3) // context->uc_mcontext.gp_regs[22]
++  std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23]
++  std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24]
++  std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25]
++  std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26]
++  std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27]
++  std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28]
++  std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29]
++  std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30]
++  std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31]
++
++  // For NIP, we can use the value in the link register
++  mflr 0
++  std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP]
++
++  // CTR
++  mfctr 0
++  std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR]
++
++  // For LNK, we'll use the caller's LR save area (2 stack frames up).
++  // r4 can be used as a scratch register since it has already been saved.
++  ld 4, 0(1)
++  ld 4, 16(4)
++  std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK]
++
++  // XER
++  mfxer 0
++  std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER]
++
++  // CCR
++  mfcr 0
++  std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR]
++
++  // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR,
++  // not used or not relevant,  zero them out.
++  li 4, 0
++  std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR]
++  std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3]
++  std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ]
++  std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP]
++  std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR]
++  std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR]
++  std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT]
++  std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR]
++
++  // Update context->uc_mcontext.regs to point to gp_regs
++  addi 0, 3, 0xe8
++  std 0, 0xe0(3)
++
++  // Save floating point registers 0-31
++  stfd 0, 0x268(3)  // context->uc_mcontext.fp_regs[0]
++  stfd 1, 0x270(3)  // context->uc_mcontext.fp_regs[1]
++  stfd 2, 0x278(3)  // context->uc_mcontext.fp_regs[2]
++  stfd 3, 0x280(3)  // context->uc_mcontext.fp_regs[3]
++  stfd 4, 0x288(3)  // context->uc_mcontext.fp_regs[4]
++  stfd 5, 0x290(3)  // context->uc_mcontext.fp_regs[5]
++  stfd 6, 0x298(3)  // context->uc_mcontext.fp_regs[6]
++  stfd 7, 0x2a0(3)  // context->uc_mcontext.fp_regs[7]
++  stfd 8, 0x2a8(3)  // context->uc_mcontext.fp_regs[8]
++  stfd 9, 0x2b0(3)  // context->uc_mcontext.fp_regs[9]
++  stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10]
++  stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11]
++  stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12]
++  stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13]
++  stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14]
++  stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15]
++  stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16]
++  stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17]
++  stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18]
++  stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19]
++  stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20]
++  stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21]
++  stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22]
++  stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23]
++  stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24]
++  stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25]
++  stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26]
++  stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27]
++  stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28]
++  stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29]
++  stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30]
++  stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31]
++
++  // FPSCR
++  mffs 0
++  stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32]
++
++  // Save VMX Vector registers
++  // Update r4 to contain the base address of vmx_reserve
++  addi 4, 3, 0x378
++  // Ensure that it is quadword aligned
++  andi. 5, 4, 0xF
++  beq 1f // No alignment is necessary
++  // Address is doubleword aligned and not quadword aligned, add 8
++  addi 4, 4, 8
++
++1:
++  // Store VMX registers 0-31
++  // r4 will contain the base address
++  // r5 will contain the index
++  li 5, 0
++  stvx 0, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 0]
++  addi 5, 5, 16
++  stvx 1, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 1]
++  addi 5, 5, 16
++  stvx 2, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 2]
++  addi 5, 5, 16
++  stvx 3, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 3]
++  addi 5, 5, 16
++  stvx 4, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 4]
++  addi 5, 5, 16
++  stvx 5, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 5]
++  addi 5, 5, 16
++  stvx 6, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 6]
++  addi 5, 5, 16
++  stvx 7, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 7]
++  addi 5, 5, 16
++  stvx 8, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 8]
++  addi 5, 5, 16
++  stvx 9, 4, 5   // context->uc_mcontext.vmx_reserve[(align) + 9]
++  addi 5, 5, 16
++  stvx 10, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 10]
++  addi 5, 5, 16
++  stvx 11, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 11]
++  addi 5, 5, 16
++  stvx 12, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 12]
++  addi 5, 5, 16
++  stvx 13, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 13]
++  addi 5, 5, 16
++  stvx 14, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 14]
++  addi 5, 5, 16
++  stvx 15, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 15]
++  addi 5, 5, 16
++  stvx 16, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 16]
++  addi 5, 5, 16
++  stvx 17, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 17]
++  addi 5, 5, 16
++  stvx 18, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 18]
++  addi 5, 5, 16
++  stvx 19, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 19]
++  addi 5, 5, 16
++  stvx 20, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 20]
++  addi 5, 5, 16
++  stvx 21, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 21]
++  addi 5, 5, 16
++  stvx 22, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 22]
++  addi 5, 5, 16
++  stvx 23, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 23]
++  addi 5, 5, 16
++  stvx 24, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 24]
++  addi 5, 5, 16
++  stvx 25, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 25]
++  addi 5, 5, 16
++  stvx 26, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 26]
++  addi 5, 5, 16
++  stvx 27, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 27]
++  addi 5, 5, 16
++  stvx 28, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 28]
++  addi 5, 5, 16
++  stvx 29, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 29]
++  addi 5, 5, 16
++  stvx 30, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 30]
++  addi 5, 5, 16
++  stvx 31, 4, 5  // context->uc_mcontext.vmx_reserve[(align) + 31]
++  addi 5, 5, 16
++
++  // VSCR
++  mfvscr 0
++  stvx 0, 4, 5
++  addi 5, 5, 16
++
++  // VRSAVE
++  mfvrsave 0
++  stwx 0, 4, 5
++
++  // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment.
++  std 4, 0x370(3)
++
++  // Zero out all unused fields
++  li 4, 0
++  std 4, 0xc8(3) // context->uc_mcontext.signal
++  std 4, 0xd0(3) // context->uc_mcontext.handler
++  std 4, 0xd8(3) // context->uc_mcontext.oldmask
++
++  blr
+ #endif  // __i386__
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc
+@@ -56,7 +56,7 @@ void TestCaptureContext() {
+   uintptr_t pc = ProgramCounterFromContext(context_1);
+ 
+ #if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \
+-    !defined(MEMORY_SANITIZER)
++    !defined(MEMORY_SANITIZER) && !defined(ARCH_CPU_PPC64_FAMILY)
+   // Sanitizers can cause enough code bloat that the “nearby” check would
+   // likely fail.
+   const uintptr_t kReferencePC =
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc
+@@ -36,6 +36,8 @@ void SanityCheckContext(const NativeCPUContext& context) {
+   EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast<uintptr_t>(&context));
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast<uintptr_t>(&context));
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast<uintptr_t>(&context));
+ #endif
+ }
+ 
+@@ -50,6 +52,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) {
+   return context.uc_mcontext.pc;
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   return context.uc_mcontext.pc;
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  return context.uc_mcontext.gp_regs[PT_NIP];
+ #endif
+ }
+ 
+@@ -64,6 +68,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) {
+   return context.uc_mcontext.sp;
+ #elif defined(ARCH_CPU_MIPS_FAMILY)
+   return context.uc_mcontext.gregs[29];
++#elif defined(ARCH_CPU_PPC64_FAMILY)
++  return context.uc_mcontext.gp_regs[1];
+ #endif
+ }
+ 
+--- qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/util/posix/signals_test.cc
+@@ -46,12 +46,12 @@ bool CanCauseSignal(int sig) {
+   return sig == SIGABRT ||
+          sig == SIGALRM ||
+          sig == SIGBUS ||
+-#if !defined(ARCH_CPU_ARM64)
++#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
+          sig == SIGFPE ||
+-#endif  // !defined(ARCH_CPU_ARM64)
++#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
+ #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
+          sig == SIGILL ||
+-#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL
++#endif  // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
+          sig == SIGPIPE ||
+          sig == SIGSEGV ||
+ #if defined(OS_MACOSX)
+@@ -117,9 +117,11 @@ void CauseSignal(int sig) {
+       break;
+     }
+ 
+-#if !defined(ARCH_CPU_ARM64)
++#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
+     // ARM64 has hardware integer division instructions that don’t generate a
+     // trap for divide-by-zero, so this doesn’t produce SIGFPE.
++    //
++    // PPC64 fixed-point division by zero also doesn't produce a SIGFPE.
+     case SIGFPE: {
+       // Optimization makes this tricky, so get zero from a system call likely
+       // to succeed, and try to do something with the result.
+@@ -137,7 +139,7 @@ void CauseSignal(int sig) {
+       fstat(quotient, &stat_buf);
+       break;
+     }
+-#endif  // ARCH_CPU_ARM64
++#endif  // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64)
+ 
+ #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL)
+     case SIGILL: {
+--- qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/third_party/libpng/BUILD.gn
+@@ -93,6 +93,11 @@ source_set("libpng_sources") {
+       "mips/filter_msa_intrinsics.c",
+       "mips/mips_init.c",
+     ]
++  } else if (current_cpu == "ppc64") {
++    sources += [
++      "powerpc/filter_vsx_intrinsics.c",
++      "powerpc/powerpc_init.c",
++    ]
+   }
+ 
+   configs -= [ "//build/config/compiler:chromium_code" ]
+new file mode 100644
+--- /dev/null
++++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/filter_vsx_intrinsics.c
+@@ -0,0 +1,767 @@
++/* filter_vsx_intrinsics.c - PowerPC optimised filter functions
++ *
++ * Copyright (c) 2017 Glenn Randers-Pehrson
++ * Written by Vadim Barkov, 2017.
++ * Last changed in libpng 1.6.29 [March 16, 2017]
++ *
++ * This code is released under the libpng license.
++ * For conditions of distribution and use, see the disclaimer
++ * and license in png.h
++ */
++#include <stdio.h>
++#include <stdint.h>
++#include "../pngpriv.h"
++
++#ifdef PNG_READ_SUPPORTED
++
++/* This code requires -maltivec and -mvsx on the command line: */
++#if PNG_POWERPC_VSX_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
++
++#include <altivec.h>
++
++#if PNG_POWERPC_VSX_OPT > 0
++
++#ifndef __VSX__
++#  error "This code requires VSX support (POWER7 and later). Please provide -mvsx compiler flag."
++#endif
++
++#define vec_ld_unaligned(vec,data) vec = vec_vsx_ld(0,data)
++#define vec_st_unaligned(vec,data) vec_vsx_st(vec,0,data)
++
++
++/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
++ * They're positioned like this:
++ *    prev:  c b
++ *    row:   a d
++ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
++ * whichever of a, b, or c is closest to p=a+b-c.
++ * ( this is taken from ../intel/filter_sse2_intrinsics.c )
++ */
++
++#define vsx_declare_common_vars(row_info,row,prev_row,offset) \
++   png_byte i;\
++   png_bytep rp = row + offset;\
++   png_const_bytep pp = prev_row;\
++   png_size_t unaligned_top = 16 - (((png_size_t)rp % 16));\
++   png_size_t istop;\
++   if(unaligned_top == 16)\
++      unaligned_top = 0;\
++   istop = row_info->rowbytes;\
++   if((unaligned_top < istop))\
++      istop -= unaligned_top;\
++   else{\
++      unaligned_top = istop;\
++      istop = 0;\
++   }
++
++void png_read_filter_row_up_vsx(png_row_infop row_info, png_bytep row,
++                                png_const_bytep prev_row)
++{
++   vector unsigned char rp_vec;
++   vector unsigned char pp_vec;
++   vsx_declare_common_vars(row_info,row,prev_row,0)
++
++   /* Altivec operations require 16-byte aligned data
++    * but input can be unaligned. So we calculate
++    * unaligned part as usual.
++    */
++   for (i = 0; i < unaligned_top; i++)
++   {
++      *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
++      rp++;
++   }
++
++   /* Using SIMD while we can */
++   while( istop >= 16 )
++   {
++      rp_vec = vec_ld(0,rp);
++      vec_ld_unaligned(pp_vec,pp);
++
++      rp_vec = vec_add(rp_vec,pp_vec);
++
++      vec_st(rp_vec,0,rp);
++
++      pp += 16;
++      rp += 16;
++      istop -= 16;
++   }
++
++   if(istop > 0)
++   {
++      /* If byte count of row is not divisible by 16
++       * we will process remaining part as usual
++       */
++      for (i = 0; i < istop; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) + (int)(*pp++)) & 0xff);
++         rp++;
++      }
++}
++
++}
++
++static const vector unsigned char VSX_LEFTSHIFTED1_4 = {16,16,16,16, 0, 1, 2, 3,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_LEFTSHIFTED2_4 = {16,16,16,16,16,16,16,16, 4, 5, 6, 7,16,16,16,16};
++static const vector unsigned char VSX_LEFTSHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 8, 9,10,11};
++
++static const vector unsigned char VSX_LEFTSHIFTED1_3 = {16,16,16, 0, 1, 2,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_LEFTSHIFTED2_3 = {16,16,16,16,16,16, 3, 4, 5,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_LEFTSHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 6, 7, 8,16,16,16,16};
++static const vector unsigned char VSX_LEFTSHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 9,10,11,16};
++
++static const vector unsigned char VSX_NOT_SHIFTED1_4 = {16,16,16,16, 4, 5, 6, 7,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_NOT_SHIFTED2_4 = {16,16,16,16,16,16,16,16, 8, 9,10,11,16,16,16,16};
++static const vector unsigned char VSX_NOT_SHIFTED3_4 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,15};
++
++static const vector unsigned char VSX_NOT_SHIFTED1_3 = {16,16,16, 3, 4, 5,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_NOT_SHIFTED2_3 = {16,16,16,16,16,16, 6, 7, 8,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_NOT_SHIFTED3_3 = {16,16,16,16,16,16,16,16,16, 9,10,11,16,16,16,16};
++static const vector unsigned char VSX_NOT_SHIFTED4_3 = {16,16,16,16,16,16,16,16,16,16,16,16,12,13,14,16};
++
++static const vector unsigned char VSX_CHAR_ZERO = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
++#ifdef __LITTLE_ENDIAN__
++
++static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = { 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = { 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {12,16,13,16,14,16,15,16,16,16,16,16,16,16,16,16};
++
++static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 0, 2, 4, 6,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 0, 2, 4, 6,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4, 6};
++
++static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = { 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = { 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = { 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {12,16,13,16,14,16,16,16,16,16,16,16,16,16,16,16};
++
++static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 0, 2, 4,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 0, 2, 4,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 0, 2, 4,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 0, 2, 4,16};
++
++#elif defined(__BIG_ENDIAN__)
++
++static const vector unsigned char VSX_CHAR_TO_SHORT1_4 = {16, 4,16, 5,16, 6,16, 7,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT2_4 = {16, 8,16, 9,16,10,16,11,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT3_4 = {16,12,16,13,16,14,16,15,16,16,16,16,16,16,16,16};
++
++static const vector unsigned char VSX_SHORT_TO_CHAR1_4 = {16,16,16,16, 1, 3, 5, 7,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR2_4 = {16,16,16,16,16,16,16,16, 1, 3, 5, 7,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR3_4 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5, 7};
++
++static const vector unsigned char VSX_CHAR_TO_SHORT1_3 = {16, 3,16, 4,16, 5,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT2_3 = {16, 6,16, 7,16, 8,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT3_3 = {16, 9,16,10,16,11,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_CHAR_TO_SHORT4_3 = {16,12,16,13,16,14,16,16,16,16,16,16,16,16,16,16};
++
++static const vector unsigned char VSX_SHORT_TO_CHAR1_3 = {16,16,16, 1, 3, 5,16,16,16,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR2_3 = {16,16,16,16,16,16, 1, 3, 5,16,16,16,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR3_3 = {16,16,16,16,16,16,16,16,16, 1, 3, 5,16,16,16,16};
++static const vector unsigned char VSX_SHORT_TO_CHAR4_3 = {16,16,16,16,16,16,16,16,16,16,16,16, 1, 3, 5,16};
++
++#endif
++
++#define vsx_char_to_short(vec,offset,bpp) (vector unsigned short)vec_perm((vec),VSX_CHAR_ZERO,VSX_CHAR_TO_SHORT##offset##_##bpp)
++#define vsx_short_to_char(vec,offset,bpp) vec_perm(((vector unsigned char)(vec)),VSX_CHAR_ZERO,VSX_SHORT_TO_CHAR##offset##_##bpp)
++
++#ifdef PNG_USE_ABS
++#  define vsx_abs(number) abs(number)
++#else
++#  define vsx_abs(number) (number > 0) ? (number) : -(number)
++#endif
++
++void png_read_filter_row_sub4_vsx(png_row_infop row_info, png_bytep row,
++                                  png_const_bytep prev_row)
++{
++   const png_byte bpp = 4;
++
++   vector unsigned char rp_vec;
++   vector unsigned char part_vec;
++
++   vsx_declare_common_vars(row_info,row,prev_row,bpp)
++
++   PNG_UNUSED(pp)
++
++   /* Altivec operations require 16-byte aligned data
++    * but input can be unaligned. So we calculate
++    * unaligned part as usual.
++    */
++   for (i = 0; i < unaligned_top; i++)
++   {
++      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++      rp++;
++   }
++
++   /* Using SIMD while we can */
++   while( istop >= 16 )
++   {
++      for(i=0;i < bpp ; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++         rp++;
++      }
++      rp -= bpp;
++
++      rp_vec = vec_ld(0,rp);
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      vec_st(rp_vec,0,rp);
++
++      rp += 16;
++      istop -= 16;
++   }
++
++   if(istop > 0)
++      for (i = 0; i < istop % 16; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) + (int)(*(rp - bpp))) & 0xff);
++         rp++;
++      }
++
++}
++
++void png_read_filter_row_sub3_vsx(png_row_infop row_info, png_bytep row,
++                                  png_const_bytep prev_row)
++{
++   const png_byte bpp = 3;
++
++   vector unsigned char rp_vec;
++   vector unsigned char part_vec;
++
++   vsx_declare_common_vars(row_info,row,prev_row,bpp)
++
++   PNG_UNUSED(pp)
++
++   /* Altivec operations require 16-byte aligned data
++    * but input can be unaligned. So we calculate
++    * unaligned part as usual.
++    */
++   for (i = 0; i < unaligned_top; i++)
++   {
++      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++      rp++;
++   }
++
++   /* Using SIMD while we can */
++   while( istop >= 16 )
++   {
++      for(i=0;i < bpp ; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++         rp++;
++      }
++      rp -= bpp;
++
++      rp_vec = vec_ld(0,rp);
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
++      rp_vec = vec_add(rp_vec,part_vec);
++
++      vec_st(rp_vec,0,rp);
++      rp += 15;
++      istop -= 16;
++
++      /* Since 16 % bpp = 16 % 3 = 1, last element of array must
++       * be proceeded manually
++       */
++      *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++      rp++;
++   }
++
++   if(istop > 0)
++      for (i = 0; i < istop % 16; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) + (int)(*(rp-bpp))) & 0xff);
++         rp++;
++      }
++}
++
++void png_read_filter_row_avg4_vsx(png_row_infop row_info, png_bytep row,
++                                  png_const_bytep prev_row)
++{
++   const png_byte bpp = 4;
++
++   vector unsigned char rp_vec;
++   vector unsigned char pp_vec;
++   vector unsigned char pp_part_vec;
++   vector unsigned char rp_part_vec;
++   vector unsigned char avg_vec;
++
++   vsx_declare_common_vars(row_info,row,prev_row,bpp)
++   rp -= bpp;
++   if(istop >= bpp)
++      istop -= bpp;
++
++   for (i = 0; i < bpp; i++)
++   {
++      *rp = (png_byte)(((int)(*rp) +
++         ((int)(*pp++) / 2 )) & 0xff);
++
++      rp++;
++   }
++
++   /* Altivec operations require 16-byte aligned data
++    * but input can be unaligned. So we calculate
++    * unaligned part as usual.
++    */
++   for (i = 0; i < unaligned_top; i++)
++   {
++      *rp = (png_byte)(((int)(*rp) +
++         (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++      rp++;
++   }
++
++   /* Using SIMD while we can */
++   while( istop >= 16 )
++   {
++      for(i=0;i < bpp ; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) +
++            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++         rp++;
++      }
++      rp -= bpp;
++      pp -= bpp;
++
++      vec_ld_unaligned(pp_vec,pp);
++      rp_vec = vec_ld(0,rp);
++
++      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_4);
++      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_4);
++      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++      rp_vec = vec_add(rp_vec,avg_vec);
++
++      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_4);
++      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_4);
++      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++      rp_vec = vec_add(rp_vec,avg_vec);
++
++      rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_4);
++      pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_4);
++      avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++      avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++      rp_vec = vec_add(rp_vec,avg_vec);
++
++      vec_st(rp_vec,0,rp);
++
++      rp += 16;
++      pp += 16;
++      istop -= 16;
++   }
++
++   if(istop  > 0)
++      for (i = 0; i < istop % 16; i++)
++      {
++         *rp = (png_byte)(((int)(*rp) +
++            (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++         rp++;
++      }
++}
++
++void png_read_filter_row_avg3_vsx(png_row_infop row_info, png_bytep row,
++                                  png_const_bytep prev_row)
++{
++  const png_byte bpp = 3;
++
++  vector unsigned char rp_vec;
++  vector unsigned char pp_vec;
++  vector unsigned char pp_part_vec;
++  vector unsigned char rp_part_vec;
++  vector unsigned char avg_vec;
++
++  vsx_declare_common_vars(row_info,row,prev_row,bpp)
++  rp -= bpp;
++  if(istop >= bpp)
++     istop -= bpp;
++
++  for (i = 0; i < bpp; i++)
++  {
++     *rp = (png_byte)(((int)(*rp) +
++        ((int)(*pp++) / 2 )) & 0xff);
++
++     rp++;
++  }
++
++  /* Altivec operations require 16-byte aligned data
++   * but input can be unaligned. So we calculate
++   * unaligned part as usual.
++   */
++  for (i = 0; i < unaligned_top; i++)
++  {
++     *rp = (png_byte)(((int)(*rp) +
++        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++     rp++;
++  }
++
++  /* Using SIMD while we can */
++  while( istop >= 16 )
++  {
++     for(i=0;i < bpp ; i++)
++     {
++        *rp = (png_byte)(((int)(*rp) +
++           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++        rp++;
++     }
++     rp -= bpp;
++     pp -= bpp;
++
++     vec_ld_unaligned(pp_vec,pp);
++     rp_vec = vec_ld(0,rp);
++
++     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED1_3);
++     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED1_3);
++     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++     rp_vec = vec_add(rp_vec,avg_vec);
++
++     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED2_3);
++     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED2_3);
++     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++     rp_vec = vec_add(rp_vec,avg_vec);
++
++     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED3_3);
++     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED3_3);
++     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++     rp_vec = vec_add(rp_vec,avg_vec);
++
++     rp_part_vec = vec_perm(rp_vec,VSX_CHAR_ZERO,VSX_LEFTSHIFTED4_3);
++     pp_part_vec = vec_perm(pp_vec,VSX_CHAR_ZERO,VSX_NOT_SHIFTED4_3);
++     avg_vec = vec_avg(rp_part_vec,pp_part_vec);
++     avg_vec = vec_sub(avg_vec, vec_and(vec_xor(rp_part_vec,pp_part_vec),vec_splat_u8(1)));
++     rp_vec = vec_add(rp_vec,avg_vec);
++
++     vec_st(rp_vec,0,rp);
++
++     rp += 15;
++     pp += 15;
++     istop -= 16;
++
++     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
++      * be proceeded manually
++      */
++     *rp = (png_byte)(((int)(*rp) +
++        (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++     rp++;
++  }
++
++  if(istop  > 0)
++     for (i = 0; i < istop % 16; i++)
++     {
++        *rp = (png_byte)(((int)(*rp) +
++           (int)(*pp++ + *(rp-bpp)) / 2 ) & 0xff);
++
++        rp++;
++     }
++}
++
++/* Bytewise c ? t : e. */
++#define if_then_else(c,t,e) vec_sel(e,t,c)
++
++#define vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp) {\
++      c = *(pp - bpp);\
++      a = *(rp - bpp);\
++      b = *pp++;\
++      p = b - c;\
++      pc = a - c;\
++      pa = vsx_abs(p);\
++      pb = vsx_abs(pc);\
++      pc = vsx_abs(p + pc);\
++      if (pb < pa) pa = pb, a = b;\
++      if (pc < pa) a = c;\
++      a += *rp;\
++      *rp++ = (png_byte)a;\
++      }
++
++void png_read_filter_row_paeth4_vsx(png_row_infop row_info, png_bytep row,
++   png_const_bytep prev_row)
++{
++   const png_byte bpp = 4;
++
++   int a, b, c, pa, pb, pc, p;
++   vector unsigned char rp_vec;
++   vector unsigned char pp_vec;
++   vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
++   vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
++
++   vsx_declare_common_vars(row_info,row,prev_row,bpp)
++   rp -= bpp;
++   if(istop >= bpp)
++      istop -= bpp;
++
++   /* Process the first pixel in the row completely (this is the same as 'up'
++    * because there is only one candidate predictor for the first row).
++    */
++   for(i = 0; i < bpp ; i++)
++   {
++      *rp = (png_byte)( *rp + *pp);
++      rp++;
++      pp++;
++   }
++
++   for(i = 0; i < unaligned_top ; i++)
++   {
++      vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++   }
++
++   while( istop >= 16)
++   {
++      for(i = 0; i < bpp ; i++)
++      {
++         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++      }
++
++      rp -= bpp;
++      pp -= bpp;
++      rp_vec = vec_ld(0,rp);
++      vec_ld_unaligned(pp_vec,pp);
++
++      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
++      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_4),1,4);
++      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_4),1,4);
++      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++      pc_vec = vec_add(pa_vec,pb_vec);
++      pa_vec = vec_abs(pa_vec);
++      pb_vec = vec_abs(pb_vec);
++      pc_vec = vec_abs(pc_vec);
++      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++      nearest_vec =  if_then_else(
++            vec_cmpeq(pa_vec,smallest_vec),
++            a_vec,
++            if_then_else(
++              vec_cmpeq(pb_vec,smallest_vec),
++              b_vec,
++              c_vec
++              )
++            );
++      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,4)));
++
++      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
++      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_4),2,4);
++      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_4),2,4);
++      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++      pc_vec = vec_add(pa_vec,pb_vec);
++      pa_vec = vec_abs(pa_vec);
++      pb_vec = vec_abs(pb_vec);
++      pc_vec = vec_abs(pc_vec);
++      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++      nearest_vec =  if_then_else(
++            vec_cmpeq(pa_vec,smallest_vec),
++            a_vec,
++            if_then_else(
++              vec_cmpeq(pb_vec,smallest_vec),
++              b_vec,
++              c_vec
++              )
++            );
++      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,4)));
++
++      a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
++      b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_4),3,4);
++      c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_4),3,4);
++      pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++      pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++      pc_vec = vec_add(pa_vec,pb_vec);
++      pa_vec = vec_abs(pa_vec);
++      pb_vec = vec_abs(pb_vec);
++      pc_vec = vec_abs(pc_vec);
++      smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++      nearest_vec =  if_then_else(
++            vec_cmpeq(pa_vec,smallest_vec),
++            a_vec,
++            if_then_else(
++              vec_cmpeq(pb_vec,smallest_vec),
++              b_vec,
++              c_vec
++              )
++            );
++      rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,4)));
++
++      vec_st(rp_vec,0,rp);
++
++      rp += 16;
++      pp += 16;
++      istop -= 16;
++   }
++
++   if(istop > 0)
++      for (i = 0; i < istop % 16; i++)
++      {
++         vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++      }
++}
++
++void png_read_filter_row_paeth3_vsx(png_row_infop row_info, png_bytep row,
++   png_const_bytep prev_row)
++{
++  const png_byte bpp = 3;
++
++  int a, b, c, pa, pb, pc, p;
++  vector unsigned char rp_vec;
++  vector unsigned char pp_vec;
++  vector unsigned short a_vec,b_vec,c_vec,nearest_vec;
++  vector signed short pa_vec,pb_vec,pc_vec,smallest_vec;
++
++  vsx_declare_common_vars(row_info,row,prev_row,bpp)
++  rp -= bpp;
++  if(istop >= bpp)
++     istop -= bpp;
++
++  /* Process the first pixel in the row completely (this is the same as 'up'
++   * because there is only one candidate predictor for the first row).
++   */
++  for(i = 0; i < bpp ; i++)
++  {
++     *rp = (png_byte)( *rp + *pp);
++     rp++;
++     pp++;
++  }
++
++  for(i = 0; i < unaligned_top ; i++)
++  {
++     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++  }
++
++  while( istop >= 16)
++  {
++     for(i = 0; i < bpp ; i++)
++     {
++        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++     }
++
++     rp -= bpp;
++     pp -= bpp;
++     rp_vec = vec_ld(0,rp);
++     vec_ld_unaligned(pp_vec,pp);
++
++     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
++     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED1_3),1,3);
++     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED1_3),1,3);
++     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++     pc_vec = vec_add(pa_vec,pb_vec);
++     pa_vec = vec_abs(pa_vec);
++     pb_vec = vec_abs(pb_vec);
++     pc_vec = vec_abs(pc_vec);
++     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++     nearest_vec =  if_then_else(
++           vec_cmpeq(pa_vec,smallest_vec),
++           a_vec,
++           if_then_else(
++             vec_cmpeq(pb_vec,smallest_vec),
++             b_vec,
++             c_vec
++             )
++           );
++     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,1,3)));
++
++     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
++     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED2_3),2,3);
++     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED2_3),2,3);
++     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++     pc_vec = vec_add(pa_vec,pb_vec);
++     pa_vec = vec_abs(pa_vec);
++     pb_vec = vec_abs(pb_vec);
++     pc_vec = vec_abs(pc_vec);
++     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++     nearest_vec =  if_then_else(
++           vec_cmpeq(pa_vec,smallest_vec),
++           a_vec,
++           if_then_else(
++             vec_cmpeq(pb_vec,smallest_vec),
++             b_vec,
++             c_vec
++             )
++           );
++     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,2,3)));
++
++     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
++     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED3_3),3,3);
++     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED3_3),3,3);
++     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++     pc_vec = vec_add(pa_vec,pb_vec);
++     pa_vec = vec_abs(pa_vec);
++     pb_vec = vec_abs(pb_vec);
++     pc_vec = vec_abs(pc_vec);
++     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++     nearest_vec =  if_then_else(
++           vec_cmpeq(pa_vec,smallest_vec),
++           a_vec,
++           if_then_else(
++             vec_cmpeq(pb_vec,smallest_vec),
++             b_vec,
++             c_vec
++             )
++           );
++     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,3,3)));
++
++     a_vec = vsx_char_to_short(vec_perm(rp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
++     b_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_NOT_SHIFTED4_3),4,3);
++     c_vec = vsx_char_to_short(vec_perm(pp_vec , VSX_CHAR_ZERO , VSX_LEFTSHIFTED4_3),4,3);
++     pa_vec = (vector signed short) vec_sub(b_vec,c_vec);
++     pb_vec = (vector signed short) vec_sub(a_vec , c_vec);
++     pc_vec = vec_add(pa_vec,pb_vec);
++     pa_vec = vec_abs(pa_vec);
++     pb_vec = vec_abs(pb_vec);
++     pc_vec = vec_abs(pc_vec);
++     smallest_vec = vec_min(pc_vec, vec_min(pa_vec,pb_vec));
++     nearest_vec =  if_then_else(
++           vec_cmpeq(pa_vec,smallest_vec),
++           a_vec,
++           if_then_else(
++             vec_cmpeq(pb_vec,smallest_vec),
++             b_vec,
++             c_vec
++             )
++           );
++     rp_vec = vec_add(rp_vec,(vsx_short_to_char(nearest_vec,4,3)));
++
++     vec_st(rp_vec,0,rp);
++
++     rp += 15;
++     pp += 15;
++     istop -= 16;
++
++     /* Since 16 % bpp = 16 % 3 = 1, last element of array must
++      * be proceeded manually
++      */
++     vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++  }
++
++  if(istop > 0)
++     for (i = 0; i < istop % 16; i++)
++     {
++        vsx_paeth_process(rp,pp,a,b,c,pa,pb,pc,bpp)
++     }
++}
++
++#endif /* PNG_POWERPC_VSX_OPT > 0 */
++#endif /* PNG_POWERPC_VSX_IMPLEMENTATION == 1 (intrinsics) */
++#endif /* READ */
+new file mode 100644
+--- /dev/null
++++ qtwebengine/src/3rdparty/chromium/third_party/libpng/powerpc/powerpc_init.c
+@@ -0,0 +1,125 @@
++
++/* powerpc_init.c - POWERPC optimised filter functions
++ *
++ * Copyright (c) 2017 Glenn Randers-Pehrson
++ * Written by Vadim Barkov, 2017.
++ * Last changed in libpng 1.6.29 [March 16, 2017]
++ *
++ * This code is released under the libpng license.
++ * For conditions of distribution and use, see the disclaimer
++ * and license in png.h
++ */
++/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
++ * called.
++ */
++#define _POSIX_SOURCE 1
++
++#include <stdio.h>
++#include "../pngpriv.h"
++
++#ifdef PNG_READ_SUPPORTED
++
++#if PNG_POWERPC_VSX_OPT > 0
++#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED /* Do run-time checks */
++/* WARNING: it is strongly recommended that you do not build libpng with
++ * run-time checks for CPU features if at all possible.  In the case of the PowerPC
++ * VSX instructions there is no processor-specific way of detecting the
++ * presence of the required support, therefore run-time detection is extremely
++ * OS specific.
++ *
++ * You may set the macro PNG_POWERPC_VSX_FILE to the file name of file containing
++ * a fragment of C source code which defines the png_have_vsx function.  There
++ * are a number of implementations in contrib/powerpc-vsx, but the only one that
++ * has partial support is contrib/powerpc-vsx/linux.c - a generic Linux
++ * implementation which reads /proc/cpufino.
++ */
++#ifndef PNG_POWERPC_VSX_FILE
++#  ifdef __linux__
++#     define  PNG_POWERPC_VSX_FILE "contrib/powerpc-vsx/linux_aux.c"
++#  endif
++#endif
++
++#ifdef PNG_POWERPC_VSX_FILE
++
++#include <signal.h> /* for sig_atomic_t */
++static int png_have_vsx(png_structp png_ptr);
++#include PNG_POWERPC_VSX_FILE
++
++#else  /* PNG_POWERPC_VSX_FILE */
++#  error "PNG_POWERPC_VSX_FILE undefined: no support for run-time POWERPC VSX checks"
++#endif /* PNG_POWERPC_VSX_FILE */
++#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
++
++void
++png_init_filter_functions_vsx(png_structp pp, unsigned int bpp)
++{
++   /* The switch statement is compiled in for POWERPC_VSX_API, the call to
++    * png_have_vsx is compiled in for POWERPC_VSX_CHECK. If both are defined
++    * the check is only performed if the API has not set the PowerPC option on
++    * or off explicitly. In this case the check controls what happens.
++    */
++
++#ifdef PNG_POWERPC_VSX_API_SUPPORTED
++   switch ((pp->options >> PNG_POWERPC_VSX) & 3)
++   {
++      case PNG_OPTION_UNSET:
++         /* Allow the run-time check to execute if it has been enabled -
++          * thus both API and CHECK can be turned on.  If it isn't supported
++          * this case will fall through to the 'default' below, which just
++          * returns.
++          */
++#endif /* PNG_POWERPC_VSX_API_SUPPORTED */
++#ifdef PNG_POWERPC_VSX_CHECK_SUPPORTED
++         {
++            static volatile sig_atomic_t no_vsx = -1; /* not checked */
++
++            if (no_vsx < 0)
++               no_vsx = !png_have_vsx(pp);
++
++            if (no_vsx)
++               return;
++         }
++#ifdef PNG_POWERPC_VSX_API_SUPPORTED
++         break;
++#endif
++#endif /* PNG_POWERPC_VSX_CHECK_SUPPORTED */
++
++#ifdef PNG_POWERPC_VSX_API_SUPPORTED
++      default: /* OFF or INVALID */
++         return;
++
++      case PNG_OPTION_ON:
++         /* Option turned on */
++         break;
++   }
++#endif
++
++   /* IMPORTANT: any new internal functions used here must be declared using
++    * PNG_INTERNAL_FUNCTION in ../pngpriv.h.  This is required so that the
++    * 'prefix' option to configure works:
++    *
++    *    ./configure --with-libpng-prefix=foobar_
++    *
++    * Verify you have got this right by running the above command, doing a build
++    * and examining pngprefix.h; it must contain a #define for every external
++    * function you add.  (Notice that this happens automatically for the
++    * initialization function.)
++    */
++   pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_vsx;
++
++   if (bpp == 3)
++   {
++      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_vsx;
++      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_vsx;
++      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_vsx;
++   }
++
++   else if (bpp == 4)
++   {
++      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_vsx;
++      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_vsx;
++      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_vsx;
++   }
++}
++#endif /* PNG_POWERPC_VSX_OPT > 0 */
++#endif /* READ */
+--- qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
++++ qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h
+@@ -3914,7 +3914,7 @@ struct kernel_statfs {
+       LSS_REG(2, buf);
+       LSS_BODY(void*, mmap2, "0"(__r2));
+     }
+-#else
++#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */
+     #define __NR__mmap2 __NR_mmap2
+     LSS_INLINE _syscall6(void*, _mmap2,            void*, s,
+                          size_t,                   l, int,               p,
+@@ -4045,7 +4045,7 @@ struct kernel_statfs {
+   #if defined(__i386__) ||                                                    \
+       defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) ||                     \
+      (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) ||                   \
+-      defined(__PPC__) ||                                                     \
++     (defined(__PPC__) && !defined(__powerpc64__)) ||                                                     \
+      (defined(__s390__) && !defined(__s390x__))
+     /* On these architectures, implement mmap() with mmap2(). */
+     LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
+--- qtwebengine/src/3rdparty/chromium/third_party/node/node.py
++++ qtwebengine/src/3rdparty/chromium/third_party/node/node.py
+@@ -10,11 +10,12 @@ import sys
+ 
+ 
+ def GetBinaryPath():
+-  return os_path.join(os_path.dirname(__file__), *{
+-    'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
+-    'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
+-    'Windows': ('win', 'node.exe'),
+-  }[platform.system()])
++  return "/usr/bin/node"
++  #return os_path.join(os_path.dirname(__file__), *{
++  #  'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
++  #  'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
++  #  'Windows': ('win', 'node.exe'),
++  #}[platform.system()])
+ 
+ 
+ def RunNode(cmd_parts, stdout=None):
+--- qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
++++ qtwebengine/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
+@@ -11,7 +11,7 @@
+ 
+ namespace pdfium {
+ namespace base {
+-#if defined(OS_WIN)
++#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
+ static constexpr size_t kPageAllocationGranularityShift = 16;  // 64KB
+ #elif defined(_MIPS_ARCH_LOONGSON)
+ static constexpr size_t kPageAllocationGranularityShift = 14;  // 16KB
+@@ -27,6 +27,10 @@ static constexpr size_t kPageAllocationGranularityBaseMask =
+ 
+ #if defined(_MIPS_ARCH_LOONGSON)
+ static constexpr size_t kSystemPageSize = 16384;
++#elif defined(ARCH_CPU_PPC64)
++// TODO: modern ppc64 can do 4k and 64k page sizes
++// for now, 64k is assumed
++static constexpr size_t kSystemPageSize = 65536;
+ #else
+ static constexpr size_t kSystemPageSize = 4096;
+ #endif
+--- qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
++++ qtwebengine/src/3rdparty/chromium/third_party/sqlite/amalgamation/sqlite3.c
+@@ -13937,7 +13937,8 @@ typedef INT16_TYPE LogEst;
+ # if defined(i386)     || defined(__i386__)   || defined(_M_IX86) ||    \
+      defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)  ||    \
+      defined(_M_AMD64) || defined(_M_ARM)     || defined(__x86)   ||    \
+-     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)
++     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \
++     defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
+ #   define SQLITE_BYTEORDER    1234
+ # elif defined(sparc)    || defined(__ppc__) || \
+        defined(__ARMEB__) || defined(__AARCH64EB__)
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/modules/desktop_capture/differ_block.cc
+@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
+   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
+ 
+   if (!diff_proc) {
+-#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
+-    // For ARM and MIPS processors, always use C version.
+-    // TODO(hclam): Implement a NEON version.
+-    diff_proc = &VectorDifference_C;
+-#else
++#if defined(WEBRTC_ARCH_X86_FAMILY)
+     bool have_sse2 = WebRtc_GetCPUInfo(kSSE2) != 0;
+     // For x86 processors, check if SSE2 is supported.
+     if (have_sse2 && kBlockSize == 32) {
+@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
+     } else {
+       diff_proc = &VectorDifference_C;
+     }
++#else
++    // For other processors, always use C version.
++    // TODO(hclam): Implement a NEON version.
++    diff_proc = &VectorDifference_C;
+ #endif
+   }
+ 
+--- qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
++++ qtwebengine/src/3rdparty/chromium/third_party/webrtc/rtc_base/system/arch.h
+@@ -47,6 +47,18 @@
+ #elif defined(__pnacl__)
+ #define WEBRTC_ARCH_32_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
++#elif defined(__PPC__)
++#define WEBRTC_ARCH_PPC_FAMILY
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
++#define WEBRTC_ARCH_LITTLE_ENDIAN
++#else
++#define WEBRTC_ARCH_BIG_ENDIAN
++#endif
++#if defined(__LP64__)
++#define WEBRTC_ARCH_64_BITS
++#else
++#define WEBRTC_ARCH_32_BITS
++#endif
+ #else
+ #error Please add support for your architecture in typedefs.h
+ #endif
+--- qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/v8/BUILD.gn
+@@ -544,6 +544,12 @@ config("toolchain") {
+     }
+     if (host_byteorder == "little") {
+       defines += [ "V8_TARGET_ARCH_PPC_LE" ]
++        cflags += [
++        # Enable usage of AltiVec, VSX, and other POWER8 and higher features
++        "-mcpu=power8",
++        "-maltivec",
++        "-mvsx",
++      ]
+     } else if (host_byteorder == "big") {
+       defines += [ "V8_TARGET_ARCH_PPC_BE" ]
+       if (current_os == "aix") {
+--- qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
++++ qtwebengine/src/3rdparty/chromium/v8/test/BUILD.gn
+@@ -17,7 +17,7 @@ group("gn_all") {
+    "mozilla:v8_mozilla",
+    "preparser:v8_preparser",
+    "test262:v8_test262",
+    "wasm-js:v8_wasm_js",
+-   "wasm-spec-tests:v8_wasm_spec_tests",
++   #"wasm-spec-tests:v8_wasm_spec_tests",
+    "webkit:v8_webkit",
+  ]
+@@ -80,9 +80,9 @@ group("v8_bot_default") {
+     "mjsunit:v8_mjsunit",
+     "mkgrokdump:mkgrokdump",
+     "preparser:v8_preparser",
+-    "unittests:unittests",
++    #"unittests:unittests",
+     "wasm-api-tests:wasm_api_tests",
+     "wasm-js:v8_wasm_js",
+-    "wasm-spec-tests:v8_wasm_spec_tests",
++    #"wasm-spec-tests:v8_wasm_spec_tests",
+     "webkit:v8_webkit",
+   ]
+@@ -104,9 +104,9 @@ group("v8_default") {
+     "mkgrokdump:mkgrokdump",
+     "preparser:v8_preparser",
+-    "unittests:unittests",
+-    "wasm-api-tests:wasm_api_tests",
+-    "wasm-js:v8_wasm_js",
+-    "wasm-spec-tests:v8_wasm_spec_tests",
++    #"unittests:unittests",
++    #"wasm-api-tests:wasm_api_tests",
++    #"wasm-js:v8_wasm_js",
++    #"wasm-spec-tests:v8_wasm_spec_tests",
+   ]
+ }
+ 
diff --git a/srcpkgs/qt5-webengine/template b/srcpkgs/qt5-webengine/template
new file mode 100644
index 00000000000..3faa5fb2bc1
--- /dev/null
+++ b/srcpkgs/qt5-webengine/template
@@ -0,0 +1,160 @@
+# Template file for 'qt5-webengine'
+pkgname=qt5-webengine
+version=5.14.2
+revision=1
+wrksrc="qtwebengine-everywhere-src-${version}"
+archs="x86_64* i686* armv[67]* ppc64* aarch64*"
+build_style=qmake
+configure_args="--
+ -webengine-icu -webengine-ffmpeg -webengine-opus -webengine-webp
+ -webengine-pepper-plugins -webengine-printing-and-pdf -webengine-proprietary-codecs
+ -webengine-pulseaudio -webengine-spellchecker -webengine-webrtc -webengine-geolocation
+ $(vopt_if snapshot '' '-no')-webengine-v8-snapshot -webengine-kerberos"
+# Rely on auto detection (fails if forced for cross builds) -webengine-alsa
+hostmakedepends="qt5-qmake gperf ninja qt5-host-tools flex pkg-config
+ which perl python protobuf"
+makedepends="qt5-webchannel-devel qt5-location-devel qt5-tools-devel
+ qt5-declarative-devel libevent-devel snappy-devel icu-devel ffmpeg-devel
+ libwebp-devel opus-devel cups-devel nss-devel minizip-devel libxslt-devel
+ libvpx-devel re2-devel libXtst-devel libXcursor-devel libXcomposite-devel
+ jsoncpp-devel harfbuzz-devel lcms2-devel protobuf-devel pulseaudio-devel
+ libXrandr-devel MesaLib-devel mit-krb5-devel"
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebengine-everywhere-src-${version}.tar.xz"
+checksum=e169d6a75d8c397e04f843bc1b9585950fb9a001255cd18d6293f66fa8a6c947
+patch_args="-Np1"
+
+build_options="snapshot"
+build_options_default="snapshot"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" nss-devel libevent-devel qt5-location-devel
+	 qt5-declarative-devel"
+fi
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	makedepends+=" musl-legacy-compat"
+fi
+
+if [ "$XBPS_LIBC" = "musl" ]; then
+	hostmakedepends+=" musl-legacy-compat"
+fi
+
+if [ "$XBPS_WORDSIZE" -eq 32 ]; then
+	nodebug=yes  # prevent OOM
+fi
+
+if [ ! "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
+	broken="webengine can be built only if word size matches"
+fi
+
+if [ "$XBPS_NO_ATOMIC8" ]; then
+	hostmakedepends+=" libatomic-devel"
+fi
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+case "$XBPS_TARGET_MACHINE" in
+	armv7l*) broken="ERROR at //skia/BUILD.gn:707:11: Undefined identifier.";;
+        #  configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+	armv6l*) broken="ERROR at //build/toolchain/gcc_toolchain.gni:102:3: Duplicate definition.";;
+esac
+
+_bootstrap_gn() {
+	# Bootstrap gn (generate ninja)
+	echo "Bootstrapping 'gn'"
+	cd ${wrksrc}/src/3rdparty/gn
+	CFLAGS="$CFLAGS_host" CXXFLAGS="$CXXFLAGS_host" LDFLAGS="$LDFLAGS_host" \
+	PKGCONFIG=/usr/bin/pkgconfig PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig" \
+		python2 build/gen.py --no-last-commit-position --out-path \
+			${wrksrc}/src/3rdparty/gn/out/Release --cc "$CC_host" \
+                        --cxx "$CXX_host" --ld "$CXX_host" --ar "$AR_host"
+	ninja -C out/Release gn
+	cd ${wrksrc}
+}
+
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		vsed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		vsed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+pre_configure() {
+	export PATH=${PATH/\/builddir\/.xbps-qt5-webengine\/wrappers:/}
+	cp ${FILESDIR}/resolv_compat.h ${wrksrc}/src/3rdparty/chromium/net/dns
+	case "$XBPS_TARGET_MACHINE" in
+		armv5*|armv6*)  # Disable "yield" assembler instruction
+			vsed -i src/3rdparty/chromium/base/allocator/partition_allocator/spin_lock.cc \
+				src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/spin_lock.cc \
+				-e 's;"yield";"nop";'
+			;;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		*-musl) export CXXFLAGS+=" -D_POSIX_THREAD_ATTR_STACKSIZE=2097152";;
+	esac
+	case "$XBPS_TARGET_MACHINE" in
+		mips*)  # sgidefs.h is in /usr/include/asm
+			for f in \
+				qtwebengine/src/3rdparty/chromium/third_party/lss/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/fpregdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/regdef.h \
+				qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/common/android/include/asm-mips/asm.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/vendor/src/base/linux_syscall_support.h \
+				qtwebengine/src/3rdparty/chromium/third_party/tcmalloc/chromium/src/base/linux_syscall_support.h \
+				qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h; do
+					vsed -i $f -e "s;<sgidefs.h>;<asm/sgidefs.h>;"
+			done
+			# Assume that RGBA order is correct for big endian CPUs
+			vsed -i qtwebengine/src/3rdparty/chromium/skia/config/SkUserConfig.h \
+				-e '/#error Read the comment at this location/d'
+			;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		_bootstrap_gn
+	fi
+}
+
+pre_build() {
+	export NINJAJOBS=${makejobs}
+}
+
+qt5-webengine-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		#TODO: FIX!!!
+		if [ -z "$CROSS_BUILD" ]; then
+			vmove usr/lib/qt5/plugins/designer
+		fi
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		vmove "usr/lib/*.la"
+		_cleanup_wrksrc_leak
+	}
+}

From 796f72b16fe3d81f7c4a54ec2479d24a105c07a3 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 11 Nov 2019 20:22:43 +0100
Subject: [PATCH 04/17] common/qmake.sh: reorder args

[ci skip]
---
 common/build-style/qmake.sh | 98 ++++++++++++++++++++++++++++++++-----
 1 file changed, 87 insertions(+), 11 deletions(-)

diff --git a/common/build-style/qmake.sh b/common/build-style/qmake.sh
index 63be5a3a568..33762e2324d 100644
--- a/common/build-style/qmake.sh
+++ b/common/build-style/qmake.sh
@@ -16,10 +16,76 @@ do_configure() {
 		msg_error "${pkgver}: Could not find qmake - missing in hostdepends?\n"
 	fi
 	if [ "$CROSS_BUILD" ] && [ "$qmake" == "/usr/lib/qt5/bin/qmake" ]; then
+		case $XBPS_TARGET_MACHINE in
+			i686*) _qt_arch=i386;;
+			x86_64*) _qt_arch=x86_64;;
+			aarch64*) _qt_arch=arm64;;
+			arm*) _qt_arch=arm;;
+			mips*) _qt_arch=mips;;
+		esac
+		mkdir -p "${wrksrc}/.target-spec/linux-g++"
+		cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC}
+QMAKE_CXX               = ${CXX}
+QMAKE_LINK              = ${CXX}
+QMAKE_LINK_C            = ${CC}
+QMAKE_LINK_SHLIB        = ${CXX}
+
+QMAKE_AR                = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY}
+QMAKE_NM                = ${NM} -P
+QMAKE_STRIP             = ${STRIP}
+
+QMAKE_CFLAGS            = ${CFLAGS}
+QMAKE_CXXFLAGS          = ${CXXFLAGS}
+QMAKE_LFLAGS            = ${LDFLAGS}
+load(qt_config)
+_EOF
+		echo "#include \"${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
+
+		mkdir -p "${wrksrc}/.host-spec/linux-g++"
+		cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                 += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(/usr/lib/qt5/mkspecs/common/linux.conf)
+include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
+include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
+
+QMAKE_TARGET_CONFIG     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
+QMAKE_TARGET_MODULE     = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
+QMAKE_CC                = ${CC_host}
+QMAKE_CXX               = ${CXX_host}
+QMAKE_LINK              = ${CXX_host}
+QMAKE_LINK_C            = ${CC_host}
+QMAKE_LINK_SHLIB        = ${CXX_host}
+
+QMAKE_AR                = gcc-ar cqs
+QMAKE_OBJCOPY           = ${OBJCOPY_host}
+QMAKE_NM                = ${NM_host} -P
+QMAKE_STRIP             = ${STRIP_host}
+
+QMAKE_CFLAGS            = ${CFLAGS_host}
+QMAKE_CXXFLAGS          = ${CXXFLAGS_host}
+QMAKE_LFLAGS            = ${LDFLAGS_host}
+load(qt_config)
+_EOF
+echo '#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
 		cat > "${wrksrc}/qt.conf" <<_EOF
 [Paths]
 Sysroot=${XBPS_CROSS_BASE}
-Prefix=${XBPS_CROSS_BASE}/usr
+Prefix=/usr
 ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5
 Data=${XBPS_CROSS_BASE}/usr/share/qt5
 Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5
@@ -38,18 +104,28 @@ HostPrefix=/usr
 HostData=/usr/lib/qt5
 HostBinaries=/usr/lib/qt5/bin
 HostLibraries=/usr/lib
-Spec=linux-g++
-TargetSpec=linux-g++
+Spec=${wrksrc}/.host-spec/linux-g++
+TargetSpec=${wrksrc}/.target-spec/linux-g++
 _EOF
-		qmake_args="-qtconf ${wrksrc}/qt.conf"
+		qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/pkg-config"
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QT_TARGET_ARCH=$_qt_arch \
+			${configure_args}
+	else
+		${qmake} ${qmake_args} \
+			PREFIX=/usr \
+			QT_INSTALL_PREFIX=/usr \
+			LIB=/usr/lib \
+			QMAKE_CC=$CC QMAKE_CXX=$CXX \
+			QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
+			QMAKE_CFLAGS="${CFLAGS}" \
+			QMAKE_CXXFLAGS="${CXXFLAGS}" \
+			QMAKE_LFLAGS="${LDFLAGS}" \
+			${configure_args}
 	fi
-	${qmake} ${qmake_args} ${configure_args} \
-		PREFIX=/usr \
-		LIB=/usr/lib \
-		QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX QMAKE_LINK_C=$CC \
-		QMAKE_CFLAGS="${CFLAGS}" \
-		QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LFLAGS="${LDFLAGS}"
 }
 
 do_build() {

From c4b43ea82d5ab95df0bd9fdf6401803ede5c8dea Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 11 Oct 2019 01:15:48 +0200
Subject: [PATCH 05/17] telegram-desktop: rebuild for qt5.14.2

[ci skip]
---
 srcpkgs/telegram-desktop/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/telegram-desktop/template b/srcpkgs/telegram-desktop/template
index 082d3520822..6f855edcdc1 100644
--- a/srcpkgs/telegram-desktop/template
+++ b/srcpkgs/telegram-desktop/template
@@ -1,7 +1,7 @@
 # Template file for 'telegram-desktop'
 pkgname=telegram-desktop
 version=2.0.1
-revision=1
+revision=2
 wrksrc="tdesktop-${version}-full"
 build_style=cmake
 build_helper="qemu"
@@ -21,7 +21,7 @@ makedepends="alsa-lib-devel ffmpeg-devel libdbusmenu-glib-devel libopenal-devel
  minizip-devel opus-devel xxHash-devel pulseaudio-devel qt5-devel range-v3
  libva-devel rapidjson liblz4-devel liblzma-devel rlottie-devel
  MesaLib-devel libdbusmenu-qt5-devel $(vopt_if spellcheck hunspell-devel)"
-depends="qt5-imageformats qt5>=5.13.2<5.13.3"
+depends="qt5-imageformats qt5-core>=5.14.2<5.14.3"
 short_desc="Telegram Desktop messaging app"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later WITH OpenSSL"
@@ -52,7 +52,7 @@ fi
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 36ebae1e572677f7da47652247a427f78e27c156 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:05:28 +0100
Subject: [PATCH 06/17] qt5-styleplugins: rebuild against qt5.14

---
 srcpkgs/qt5-styleplugins/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/qt5-styleplugins/template b/srcpkgs/qt5-styleplugins/template
index f6c511cad4c..fdb0d74ec86 100644
--- a/srcpkgs/qt5-styleplugins/template
+++ b/srcpkgs/qt5-styleplugins/template
@@ -1,13 +1,13 @@
 # Template file for 'qt5-styleplugins'
 pkgname=qt5-styleplugins
 version=5.0.0
-revision=11
+revision=12
 _gitrev=335dbece103e2cbf6c7cf819ab6672c2956b17b3
 wrksrc="qtstyleplugins-${_gitrev}"
 build_style=qmake
 hostmakedepends="pkg-config qt5-host-tools qt5-devel"
 makedepends="libxcb-devel libxkbcommon-devel libinput-devel tslib-devel gtk+-devel qt5-devel"
-depends="qt5>=5.13.2<5.13.3"
+depends="qt5-core>=5.14.2<5.14.3"
 short_desc="Additional style plugins for Qt5"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
 license="LGPL-2.1-only, LGPL-3.0-only"
@@ -21,7 +21,7 @@ LDFLAGS="-Wl,-fuse-ld=bfd"
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 5cb1e77a86d961e1eaad911860cbfb24a63fc9f2 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 18 Nov 2019 03:27:31 +0100
Subject: [PATCH 07/17] qt5dxcb-plugin: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5dxcb-plugin/template | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/qt5dxcb-plugin/template b/srcpkgs/qt5dxcb-plugin/template
index b5408ed89fb..a294b01309a 100644
--- a/srcpkgs/qt5dxcb-plugin/template
+++ b/srcpkgs/qt5dxcb-plugin/template
@@ -1,14 +1,14 @@
 # Template file for 'qt5dxcb-plugin'
 pkgname=qt5dxcb-plugin
 version=5.0.1
-revision=3
+revision=4
 build_style=qmake
 make_build_args="VERSION=${version}"
 hostmakedepends="pkg-config qt5-qmake"
 makedepends="cairo-devel libSM-devel libXi-devel libxkbcommon-devel
  qt5-x11extras-devel xcb-util-image-devel xcb-util-keysyms-devel
- xcb-util-renderutil-devel xcb-util-wm-devel"
-depends="qt5>=5.13.2<5.13.3"
+ xcb-util-renderutil-devel xcb-util-wm-devel qt5-xcb-private-headers"
+depends="qt5-core>=5.14.2<5.14.3"
 short_desc="Qt platform plugins for DDE"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later"
@@ -16,12 +16,11 @@ homepage="https://github.com/linuxdeepin/qt5dxcb-plugin/"
 changelog="https://github.com/linuxdeepin/qt5dxcb-plugin/blob/master/CHANGELOG.md"
 distfiles="https://github.com/linuxdeepin/qt5dxcb-plugin/archive/${version}.tar.gz"
 checksum=b19253f9f577b2a9d86774ba95d252318f3d692ab92d2e62fbf0578d56db453d
-patch_args="-Np1"
 
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo
@@ -29,11 +28,7 @@ pre_configure() {
 		msg_red "${_qt5_version%_*} does not match ${_qt5_dep_ver}\\n"
 		exit 1
 	fi
-
-	# no headers for 5.13.1 yet; 5.13.0 headers are the same for this
-	# remove on next version upgrade (after upstream has added them)
-	ln -s ${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.0 \
-		${wrksrc}/platformplugin/libqt5xcbqpa-dev/5.13.2
+	sed -i "s|error(Not support Qt Version: .*)|INCLUDEPATH += ${XBPS_CROSS_BASE}/usr/include/qt5xcb-private|" platformplugin/linux.pri
 }
 
 if [ "$CROSS_BUILD" ]; then

From ca1857b26cc336064ab71715f3afe82dcfb7ec1a Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Thu, 5 Dec 2019 08:42:41 +0100
Subject: [PATCH 08/17] kwin: rebuild against qt5.14.2

[ci skip]
---
 srcpkgs/kwin/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/kwin/template b/srcpkgs/kwin/template
index 1d901a933be..6d6636a8145 100644
--- a/srcpkgs/kwin/template
+++ b/srcpkgs/kwin/template
@@ -1,7 +1,7 @@
 # Template file for 'kwin'
 pkgname=kwin
 version=5.18.4.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules gettext breeze pkg-config"
@@ -9,7 +9,7 @@ makedepends="plasma-framework-devel kcmutils-devel knewstuff-devel
  kscreenlocker-devel kinit-devel xcb-util-cursor-devel qt5-multimedia-devel
  kdecoration-devel libxkbcommon-devel libinput-devel libSM-devel
  libICE-devel xcb-util-wm-devel qt5-sensors-devel libcap-devel"
-depends="breeze hicolor-icon-theme kinit qt5>=5.13.2<5.13.3"
+depends="breeze hicolor-icon-theme kinit qt5-core>=5.14.2<5.14.3"
 short_desc="KDE Window manager"
 maintainer="John <johnz@posteo.net>"
 license="GPL-2.0-or-later"
@@ -29,7 +29,7 @@ fi
 post_extract() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From e536183208df7bc6320b85172773dda7502bc26e Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 14 Dec 2019 15:13:35 +0100
Subject: [PATCH 09/17] qt5-webkit: rebuild against qt5.14

[ci skip]
---
 srcpkgs/qt5-webkit/patches/qt5.14.patch      | 93 ++++++++++++++++++++
 srcpkgs/qt5-webkit/patches/qt5.14.patch.args |  1 +
 srcpkgs/qt5-webkit/template                  |  2 +-
 3 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch
 create mode 100644 srcpkgs/qt5-webkit/patches/qt5.14.patch.args

diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch b/srcpkgs/qt5-webkit/patches/qt5.14.patch
new file mode 100644
index 00000000000..799d53f1f55
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch
@@ -0,0 +1,93 @@
+From c344187a099f8fd749dc84ffcc125c0925103819 Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Tue, 10 Sep 2019 03:51:42 +0300
+Subject: Fix compilation of HTTP2 settings with Qt >= 5.14
+
+Public API QHttp2Configuration was added, so we use it now instead of
+ugly hack required for previous versions. Workaround for QTBUG-77308 is
+no loger needed in 5.14, so we only enable server push.
+
+Change-Id: I3e6817d8fa274c3a849f09b23ca58f93318be6c4
+---
+ .../network/qt/QNetworkReplyHandler.cpp       |  6 +++---
+ .../platform/network/qt/ResourceRequestQt.cpp | 20 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+index 0da45fbc79a5..7924595582ac 100644
+--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
++++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+@@ -41,7 +41,7 @@
+ 
+ #include <QCoreApplication>
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ #include <private/http2protocol_p.h>
+ #include <cstdlib>
+@@ -62,7 +62,7 @@ ProtocolParameters::ProtocolParameters()
+ 
+ QT_END_NAMESPACE
+ 
+-#endif // USE(HTTP2)
++#endif // USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ 
+ static const int gMaxRedirections = 10;
+ 
+@@ -797,7 +797,7 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
+     if (!manager)
+         return 0;
+ 
+-#if USE(HTTP2)
++#if USE(HTTP2) && QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+     static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
+     if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
+         Http2::ProtocolParameters params;
+diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+index 2cf2e7750dde..310738449b75 100644
+--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
++++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+@@ -29,7 +29,10 @@
+ 
+ #if USE(HTTP2)
+ #include <QSslSocket>
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++#include <QHttp2Configuration>
+ #endif
++#endif // USE(HTTP2)
+ 
+ namespace WebCore {
+ 
+@@ -65,6 +68,16 @@ bool ResourceRequest::alpnIsSupported()
+     return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
+         QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
+ }
++
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++static QHttp2Configuration createHttp2Configuration()
++{
++    QHttp2Configuration params;
++    params.setServerPushEnabled(true);
++    return params;
++}
++#endif
++
+ #endif
+ 
+ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
+@@ -76,8 +89,13 @@ QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) co
+ 
+ #if USE(HTTP2)
+     static const bool NegotiateHttp2ForHttps = alpnIsSupported();
+-    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps)
++    if (originalUrl.protocolIs("https") && NegotiateHttp2ForHttps) {
++#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
++        static const auto params = createHttp2Configuration();
++        request.setHttp2Configuration(params);
++#endif
+         request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
++    }
+ #endif // USE(HTTP2)
+ 
+     const HTTPHeaderMap &headers = httpHeaderFields();
diff --git a/srcpkgs/qt5-webkit/patches/qt5.14.patch.args b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
new file mode 100644
index 00000000000..2eba1cb3c5c
--- /dev/null
+++ b/srcpkgs/qt5-webkit/patches/qt5.14.patch.args
@@ -0,0 +1 @@
+-Np1
diff --git a/srcpkgs/qt5-webkit/template b/srcpkgs/qt5-webkit/template
index bd750433d5d..0eeb4caa61e 100644
--- a/srcpkgs/qt5-webkit/template
+++ b/srcpkgs/qt5-webkit/template
@@ -1,7 +1,7 @@
 # Template file for 'qt5-webkit'
 pkgname=qt5-webkit
 version=5.212.0
-revision=6
+revision=7
 _snap=1565895469
 _v=${version%.*}
 wrksrc="qtwebkit-everywhere-src-${_v}"

From a5878ebc34eb16566662a2e92ad4e626e599509a Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Tue, 28 Jan 2020 09:40:25 +0100
Subject: [PATCH 10/17] plasma-integration: rebuild for qt5-5.14.2

---
 srcpkgs/plasma-integration/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/plasma-integration/template b/srcpkgs/plasma-integration/template
index d1998f39e47..5d7612d7494 100644
--- a/srcpkgs/plasma-integration/template
+++ b/srcpkgs/plasma-integration/template
@@ -1,7 +1,7 @@
 # Template file for 'plasma-integration'
 pkgname=plasma-integration
 version=5.18.4.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules pkg-config qt5-qmake qt5-host-tools

From 9e832c4da83f29b87c022beee5e50c46f4d8e629 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Fri, 7 Feb 2020 10:28:25 +0100
Subject: [PATCH 11/17] qt5integration: rebuild for qt5-5.14.2

---
 srcpkgs/qt5integration/patches/qt5.14.patch | 46 +++++++++++++++++++++
 srcpkgs/qt5integration/template             |  6 +--
 2 files changed, 49 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/qt5integration/patches/qt5.14.patch

diff --git a/srcpkgs/qt5integration/patches/qt5.14.patch b/srcpkgs/qt5integration/patches/qt5.14.patch
new file mode 100644
index 00000000000..abe90b78c9c
--- /dev/null
+++ b/srcpkgs/qt5integration/patches/qt5.14.patch
@@ -0,0 +1,46 @@
+diff --git a/platformthemeplugin/qdeepintheme.cpp b/platformthemeplugin/qdeepintheme.cpp
+index e98487b..45e90bc 100644
+--- platformthemeplugin/qdeepintheme.cpp
++++ platformthemeplugin/qdeepintheme.cpp
+@@ -571,10 +571,18 @@ static bool updateScreenScaleFactors(DThemeSettings *s, const QByteArray &value,
+     }
+ 
+     QHighDpiScaling::updateHighDpiScaling();
++#if QT_VERSION < QT_VERSION_CHECK(5,14,0)
+     qDebug() << QHighDpiScaling::logicalDpi();
++#else
++    qDebug() << QHighDpiScaling::logicalDpi(QGuiApplication::primaryScreen());
++#endif
+     updateScaleLogcailDpi(s->scaleLogicalDpi());
+ 
++#if QT_VERSION < QT_VERSION_CHECK(5,14,0)
+     qDebug() << QHighDpiScaling::logicalDpi();
++#else
++    qDebug() << QHighDpiScaling::logicalDpi(QGuiApplication::primaryScreen());
++#endif
+ 
+     return true;
+ }
+--- platformthemeplugin/qdeepintheme.cpp	2019-12-19 17:45:47.396894045 +0800
++++ platformthemeplugin/qdeepintheme.cpp	2019-12-19 17:46:28.436136243 +0800
+@@ -516,19 +516,7 @@
+ static bool updateScaleLogcailDpi(const QPair<qreal, qreal> &dpi)
+ {
+     bool ok = dpi.first >= 0 && dpi.second >= 0;
+-
+-    if (dpi.first > 0) {
+-        QHighDpiScaling::m_logicalDpi.first = dpi.first;
+-    } else if (qIsNull(dpi.first)) {
+-        QHighDpiScaling::m_logicalDpi.first = qGuiApp->primaryScreen()->handle()->logicalDpi().first;
+-    }
+-
+-    if (dpi.second > 0) {
+-        QHighDpiScaling::m_logicalDpi.second = dpi.second;
+-    } else if (qIsNull(dpi.second)) {
+-        QHighDpiScaling::m_logicalDpi.second = qGuiApp->primaryScreen()->handle()->logicalDpi().second;
+-    }
+-
++    QHighDpiScaling::m_usePixelDensity = false;
+     return ok;
+ }
+ 
diff --git a/srcpkgs/qt5integration/template b/srcpkgs/qt5integration/template
index 87cdb911915..3366a15e15f 100644
--- a/srcpkgs/qt5integration/template
+++ b/srcpkgs/qt5integration/template
@@ -1,12 +1,12 @@
 # Template file for 'qt5integration'
 pkgname=qt5integration
 version=5.0.0
-revision=3
+revision=4
 build_style=qmake
 hostmakedepends="qt5-qmake pkg-config"
 makedepends="libqtxdg-devel dtkwm-devel dtkwidget-devel mtdev-devel
  qt5-svg-devel qt5-x11extras-devel qt5-multimedia-devel"
-depends="qt5dxcb-plugin qt5-styleplugins qt5>=5.13.2<5.13.3"
+depends="qt5dxcb-plugin qt5-styleplugins qt5-core>=5.14.2<5.14.3"
 short_desc="Qt platform theme integration plugins for Deepin Desktop Environment"
 maintainer="John <johnz@posteo.net>"
 license="GPL-3.0-or-later"
@@ -18,7 +18,7 @@ checksum=59eff73ea16ded0a54fe91a08168d53b96f6e7fe9a53b599ba37346b283d6a7c
 pre_configure() {
 	_qt5_dep_ver="${depends#*>=}"
 	_qt5_dep_ver="${_qt5_dep_ver%<*}"
-	_qt5_version="$(xbps-uhelper version qt5)"
+	_qt5_version="$(xbps-uhelper version qt5-core)"
 
 	if [[ "${_qt5_version%_*}" != "${_qt5_dep_ver}" ]]; then
 		echo

From 801c2db388b72e7445a196be29d99f279f57b83d Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sat, 8 Feb 2020 17:50:18 +0100
Subject: [PATCH 12/17] qt5-doc: update to 5.14.2.

[ci skip]
---
 srcpkgs/qt5-doc/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qt5-doc/template b/srcpkgs/qt5-doc/template
index 22b92e9de25..6419cc07947 100644
--- a/srcpkgs/qt5-doc/template
+++ b/srcpkgs/qt5-doc/template
@@ -1,6 +1,6 @@
 # Template file for 'qt5-doc'
 pkgname=qt5-doc
-version=5.13.2
+version=5.14.2
 revision=1
 wrksrc="qt-everywhere-src-${version}"
 hostmakedepends="clang perl pkg-config qt5-devel qt5-plugin-sqlite qt5-tools which"
@@ -11,7 +11,7 @@ short_desc="A cross-platform application and UI framework (QT5) - Documentation"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3, LGPL-2.1"
 distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/single/qt-everywhere-src-${version}.tar.xz"
-checksum=55e8273536be41f4f63064a79e552a22133848bb419400b6fa8e9fc0dc05de08
+checksum=c6fcd53c744df89e7d3223c02838a33309bd1c291fcb6f9341505fe99f7f19fa
 
 post_extract() {
 	rm -rf qttools/{bin,plugins}

From 66f862bcee68f58320ce06490c81a0d0732ed572 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Sun, 9 Feb 2020 23:55:08 +0100
Subject: [PATCH 13/17] New package: qt5-webview-5.14.2

[ci skip]
---
 srcpkgs/qt5-webview          |  1 -
 srcpkgs/qt5-webview-devel    |  2 +-
 srcpkgs/qt5-webview/template | 57 ++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 2 deletions(-)
 delete mode 120000 srcpkgs/qt5-webview
 create mode 100644 srcpkgs/qt5-webview/template

diff --git a/srcpkgs/qt5-webview b/srcpkgs/qt5-webview
deleted file mode 120000
index 75793eb6664..00000000000
--- a/srcpkgs/qt5-webview
+++ /dev/null
@@ -1 +0,0 @@
-qt5
\ No newline at end of file
diff --git a/srcpkgs/qt5-webview-devel b/srcpkgs/qt5-webview-devel
index 75793eb6664..116d0164984 120000
--- a/srcpkgs/qt5-webview-devel
+++ b/srcpkgs/qt5-webview-devel
@@ -1 +1 @@
-qt5
\ No newline at end of file
+qt5-webview
\ No newline at end of file
diff --git a/srcpkgs/qt5-webview/template b/srcpkgs/qt5-webview/template
new file mode 100644
index 00000000000..8e96aeebbe8
--- /dev/null
+++ b/srcpkgs/qt5-webview/template
@@ -0,0 +1,57 @@
+# Template file for 'qt5-webview'
+pkgname=qt5-webview
+version=5.14.2
+revision=1
+wrksrc="qtwebview-everywhere-src-${version}"
+build_style=qmake
+hostmakedepends="qt5-qmake perl qt5-declarative-devel"
+makedepends="qt5-location-devel qt5-webchannel-devel qt5-tools-devel qt5-declarative-devel
+ $(vopt_if webengine qt5-webengine-devel)"
+short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
+maintainer="John <johnz@posteo.net>"
+license="GPL-3.0-or-later, LGPL-3.0-or-later"
+homepage="https://qt.io/"
+distfiles="http://download.qt.io/official_releases/qt/${version%.*}/${version}/submodules/qtwebview-everywhere-src-${version}.tar.xz"
+checksum=c61f9213ee84fd7408898c0194468208ffb51af9d257e87e6b53daf24f65ff4b
+
+build_option="webengine"
+if [ "$XBPS_TARGET_ENDIAN" = "le" ] && [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
+	build_option_default="webengine"
+fi
+
+_cleanup_wrksrc_leak() {
+	if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
+		# Replace references to ${wrksrc} in cmake files
+		sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
+		# Replace references to ${wrksrc} in pkgconfig files
+		sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
+			-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
+			-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
+	fi
+	# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
+	# and replace references to ${wrksrc}
+	find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
+		-e "/^QMAKE_PRL_BUILD_DIR/d" \
+		-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
+	# Replace ${wrksrc} in project include files
+	find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
+		-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
+}
+
+qt5-webview-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove usr/lib/qt5/mkspecs
+		vmove "usr/lib/*.so"
+		vmove "usr/lib/*.prl"
+		_cleanup_wrksrc_leak
+	}
+}

From 1843dc361e216f4779b90f6be55e5af77c1c5f96 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Mon, 30 Mar 2020 14:07:13 +0200
Subject: [PATCH 14/17] qmltermwidget: nocross

---
 srcpkgs/qmltermwidget/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/qmltermwidget/template b/srcpkgs/qmltermwidget/template
index 60de10dfef8..734f812435f 100644
--- a/srcpkgs/qmltermwidget/template
+++ b/srcpkgs/qmltermwidget/template
@@ -11,3 +11,5 @@ license="GPL-2.0-or-later"
 homepage="https://github.com/Swordfish90/qmltermwidget"
 distfiles="${homepage}/archive/${version}.tar.gz"
 checksum=23e19eedb59d6fe3e37ecc06872f54befd94384946926e009c42c4b39914cfe2
+nocross=yes
+# some things do get wrongly installed into $DESTDOR/$XBPS_CROSS_BASE

From 15f8a92649b8546c1f52ee569526a3c38c3dba7c Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Mon, 30 Mar 2020 16:13:25 +0200
Subject: [PATCH 15/17] qml-box2d: nocross

---
 srcpkgs/qml-box2d/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/qml-box2d/template b/srcpkgs/qml-box2d/template
index 307decd3c27..99d599a1b35 100644
--- a/srcpkgs/qml-box2d/template
+++ b/srcpkgs/qml-box2d/template
@@ -12,6 +12,7 @@ license="Zlib"
 homepage="https://github.com/qml-box2d/qml-box2d"
 distfiles="https://github.com/qml-box2d/qml-box2d/archive/${_commit}.tar.gz"
 checksum=a9071d2a85aafe74cb431e12888cfb92bd19cb91f4f577edd73cd9692d5e152f
+nocross='some things do get wrongly installed into $DESTDIR/$XBPS_CROSS_BASE'
 
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" qt5-declarative-devel"

From 5475152ee17d87427400419034f0348a5163c458 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Mon, 30 Mar 2020 16:40:45 +0200
Subject: [PATCH 16/17] texstudio: nocross

---
 srcpkgs/texstudio/template | 1 +
 1 file changed, 1 insertion(+)

diff --git a/srcpkgs/texstudio/template b/srcpkgs/texstudio/template
index 88df5425e15..7560a768558 100644
--- a/srcpkgs/texstudio/template
+++ b/srcpkgs/texstudio/template
@@ -16,6 +16,7 @@ license="GPL-2.0-or-later"
 homepage="https://texstudio.org/"
 distfiles="https://github.com/texstudio-org/texstudio/archive/${version}.tar.gz"
 checksum=a14b8912bfd15d982cfbe5f00deed37ca85fb6e38d3aa0c2dac23b4ecaab0984
+nocross="/usr/lib/libphonon4qt5.so: error adding symbols: file in wrong format"
 
 build_options="phonon poppler"
 desc_option_phonon="build with phonon support"

From 26551ca757ede26c0a21d18a2b083c56be8c94b0 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Mon, 30 Mar 2020 13:04:44 +0200
Subject: [PATCH 17/17] gsettings-qt: set nocross

[ci skip]
---
 srcpkgs/gsettings-qt/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/gsettings-qt/template b/srcpkgs/gsettings-qt/template
index 1d65853fc18..b9e726b372b 100644
--- a/srcpkgs/gsettings-qt/template
+++ b/srcpkgs/gsettings-qt/template
@@ -11,6 +11,8 @@ license="LGPL-3.0-only"
 homepage="https://launchpad.net/gsettings-qt"
 distfiles="$DEBIAN_SITE/main/g/gsettings-qt/gsettings-qt_${version}.orig.tar.gz"
 checksum=a3d1020d526ece2319f1e8f05876e456e85279741653008e05c5d7e8b019c9b9
+nocross=yes
+# some things do get wrongly installed into $DESTDOR/$XBPS_CROSS_BASE
 
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" qt5-devel qt5-declarative-devel"

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

* Re: [PR PATCH] [Merged]: [WIP] qt5 update to 5.14.0
  2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
                   ` (32 preceding siblings ...)
  2020-04-03 15:00 ` [PR PATCH] [Updated] " Johnnynator
@ 2020-04-03 16:19 ` Johnnynator
  33 siblings, 0 replies; 35+ messages in thread
From: Johnnynator @ 2020-04-03 16:19 UTC (permalink / raw)
  To: ml

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

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

[WIP] qt5 update to 5.14.0
https://github.com/void-linux/void-packages/pull/15310

Description:
# Tested on
- [x] x86_64 (compiled and runtime)
- [x] x86_64-musl (compiled and runtime)
- [ ] i686 ()
- [ ] armv7l-musl
- [ ] armv7l 
- [ ] armv6l-musl
- [ ] armv6l (compiled without webengine)
- [ ] aarch64-musl (compiled)
- [ ] aarch64
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
# TODO:

- fix cross (for some qmake packages)
- rebase webengine ppc patches @q66 
- `-no-feature-qdoc` instead of custom `qttools/src/src.pro` ?
- fix webengine loading resources from `/share` instead of `/usr/share`

# Bugs

- webengine currently tries to fetch resources from `/share` instead of `/usr/share
- Plasmashell wayland on musl crashes regulary 

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

end of thread, other threads:[~2020-04-03 16:19 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 23:27 [PR PATCH] [WIP] qt5 uptade to 5.14.0 voidlinux-github
2019-10-15 11:21 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-15 11:21 ` voidlinux-github
2019-11-11 19:23 ` [PR PATCH] [Updated] [WIP] qt5 update " voidlinux-github
2019-11-12  0:23 ` voidlinux-github
2020-01-03 10:46 ` voidlinux-github
2020-01-28 17:04 ` voidlinux-github
2020-02-02 16:03 ` voidlinux-github
2020-03-18 18:37 ` streaksu
2020-03-18 18:45 ` Johnnynator
2020-03-18 21:27 ` travankor
2020-03-18 22:31 ` Johnnynator
2020-03-19 22:48 ` mintsuki
2020-03-19 23:52 ` q66
2020-03-19 23:54 ` Johnnynator
2020-03-20  6:25 ` travankor
2020-03-20 13:00 ` pullmoll
2020-03-20 13:17 ` xtraeme
2020-03-20 13:19 ` xtraeme
2020-03-20 13:29 ` Johnnynator
2020-03-20 13:31 ` Johnnynator
2020-03-20 15:03 ` pullmoll
2020-03-20 15:53 ` q66
2020-03-20 17:48 ` Chocimier
2020-03-22 23:43 ` mintsuki
2020-03-23  0:11 ` travankor
2020-03-23  0:57 ` q66
2020-03-23  7:55 ` travankor
2020-03-23  7:55 ` travankor
2020-03-23  7:58 ` travankor
2020-03-23  8:57 ` Johnnynator
2020-03-23  8:57 ` Johnnynator
2020-03-23 13:35 ` q66
2020-04-03 15:00 ` [PR PATCH] [Updated] " Johnnynator
2020-04-03 16:19 ` [PR PATCH] [Merged]: " Johnnynator

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).