extra/qt5-webengine: update patches

This commit is contained in:
Kevin Mihelich 2023-12-23 18:18:43 +00:00
parent bab65784e9
commit b9bf3f4dc8
6 changed files with 21 additions and 479 deletions

View file

@ -1,7 +1,7 @@
From 831eeefaebc489ecb64f945cfa62f79771be3bf5 Mon Sep 17 00:00:00 2001 From 8a4c8026b4ccd039c22f19377ebeb1fa3a652665 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 4 Jul 2017 11:54:39 -0600 Date: Tue, 4 Jul 2017 11:54:39 -0600
Subject: [PATCH 1/5] ARM toolchain fixes Subject: [PATCH 1/4] ARM toolchain fixes
--- ---
chromium/build/toolchain/linux/BUILD.gn | 24 ++++++++++-------------- chromium/build/toolchain/linux/BUILD.gn | 24 ++++++++++--------------
@ -54,5 +54,5 @@ index fa8b17e9db3..7398b7556ec 100644
toolchain_args = { toolchain_args = {
current_cpu = "arm" current_cpu = "arm"
-- --
2.37.0 2.42.0

View file

@ -1,7 +1,7 @@
From 895dec8c2d626f176cb85af81c09c7bf30e2ad43 Mon Sep 17 00:00:00 2001 From 3fb651a0a4f306f44c21673dbc3dd9ff7eeedc8d Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 1 Jul 2019 07:10:36 -0600 Date: Mon, 1 Jul 2019 07:10:36 -0600
Subject: [PATCH 2/5] Fix ARM skia ICE Subject: [PATCH 2/4] Fix ARM skia ICE
--- ---
chromium/third_party/skia/third_party/skcms/src/Transform_inl.h | 2 +- chromium/third_party/skia/third_party/skcms/src/Transform_inl.h | 2 +-
@ -21,5 +21,5 @@ index 2dcf717f3b7..8e1acb01fee 100644
#else #else
#define MAYBE_NOINLINE #define MAYBE_NOINLINE
-- --
2.37.0 2.42.0

View file

@ -1,7 +1,7 @@
From a3a795afdd386242fa115309c5fd349b0095bfdd Mon Sep 17 00:00:00 2001 From 910fba76abad8af9b472885c24259d2cd948be8a Mon Sep 17 00:00:00 2001
From: Yuki Shiino <yukishiino@chromium.org> From: Yuki Shiino <yukishiino@chromium.org>
Date: Mon, 5 Oct 2020 11:01:57 +0000 Date: Mon, 5 Oct 2020 11:01:57 +0000
Subject: [PATCH 3/5] bind-gen: Support --single_process flag in Subject: [PATCH 3/4] bind-gen: Support --single_process flag in
generate_bindings.py generate_bindings.py
Error messages of generate_bindings.py are often hard to read Error messages of generate_bindings.py are often hard to read
@ -15,97 +15,14 @@ Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813675} Cr-Commit-Position: refs/heads/master@{#813675}
--- ---
.../bindings/scripts/bind_gen/task_queue.py | 74 +++++++++++-------- .../bindings/scripts/bind_gen/task_queue.py | 17 -----------------
.../bindings/scripts/generate_bindings.py | 8 +- 1 file changed, 17 deletions(-)
2 files changed, 49 insertions(+), 33 deletions(-)
diff --git a/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py diff --git a/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
index e666a9b668e..42b96d41688 100644 index e666a9b668e..848d259b412 100644
--- a/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py --- a/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
+++ b/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +++ b/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py
@@ -14,10 +14,23 @@ class TaskQueue(object): @@ -70,20 +70,3 @@ class TaskQueue(object):
tasks will be executed in parallel.
"""
- def __init__(self):
- self._pool_size = multiprocessing.cpu_count()
- self._pool = multiprocessing.Pool(self._pool_size,
- package_initializer().init)
+ def __init__(self, single_process=False):
+ """
+ Args:
+ single_process: True makes the instance will not create nor use a
+ child process so that error messages will be easier to read.
+ This is useful for debugging.
+ """
+ assert isinstance(single_process, bool)
+ if single_process:
+ self._single_process = True
+ self._pool_size = 1
+ self._pool = None
+ else:
+ self._single_process = False
+ self._pool_size = multiprocessing.cpu_count()
+ self._pool = multiprocessing.Pool(self._pool_size,
+ package_initializer().init)
self._requested_tasks = [] # List of (func, args, kwargs)
self._worker_tasks = [] # List of multiprocessing.pool.AsyncResult
self._did_run = False
@@ -37,28 +50,42 @@ class TaskQueue(object):
Args:
report_progress: A callable that takes two arguments, total number
of worker tasks and number of completed worker tasks.
- Scheduled tasks are reorganized into worker tasks, so the
- number of worker tasks may be different from the number of
- scheduled tasks.
"""
assert report_progress is None or callable(report_progress)
assert not self._did_run
assert not self._worker_tasks
self._did_run = True
- num_of_requested_tasks = len(self._requested_tasks)
- chunk_size = 1
- i = 0
- while i < num_of_requested_tasks:
- tasks = self._requested_tasks[i:i + chunk_size]
- i += chunk_size
+ if self._single_process:
+ self._run_in_sequence(report_progress)
+ else:
+ self._run_in_parallel(report_progress)
+
+ def _run_in_sequence(self, report_progress):
+ for index, task in enumerate(self._requested_tasks):
+ func, args, kwargs = task
+ report_progress(len(self._requested_tasks), index)
+ func(*args, **kwargs)
+ report_progress(len(self._requested_tasks), len(self._requested_tasks))
+
+ def _run_in_parallel(self, report_progress):
+ for task in self._requested_tasks:
+ func, args, kwargs = task
self._worker_tasks.append(
- self._pool.apply_async(_task_queue_run_tasks, [tasks]))
+ self._pool.apply_async(func, args, kwargs))
self._pool.close()
+ def report_worker_task_progress():
+ if not report_progress:
+ return
+ done_count = functools.reduce(
+ lambda count, worker_task: count + bool(worker_task.ready()),
+ self._worker_tasks, 0)
+ report_progress(len(self._worker_tasks), done_count)
+
timeout_in_sec = 1
while True:
- self._report_worker_task_progress(report_progress)
+ report_worker_task_progress()
for worker_task in self._worker_tasks:
if not worker_task.ready():
worker_task.wait(timeout_in_sec)
@@ -70,20 +97,3 @@ class TaskQueue(object):
break break
self._pool.join() self._pool.join()
@ -126,32 +43,6 @@ index e666a9b668e..42b96d41688 100644
- for task in tasks: - for task in tasks:
- func, args, kwargs = task - func, args, kwargs = task
- func(*args, **kwargs) - func(*args, **kwargs)
diff --git a/chromium/third_party/blink/renderer/bindings/scripts/generate_bindings.py b/chromium/third_party/blink/renderer/bindings/scripts/generate_bindings.py
index 96a9ebccdbf..528d1b2f61d 100644
--- a/chromium/third_party/blink/renderer/bindings/scripts/generate_bindings.py
+++ b/chromium/third_party/blink/renderer/bindings/scripts/generate_bindings.py
@@ -37,6 +37,12 @@ def parse_options():
type="string",
help='output directory for "modules" component relative '
'to root_gen_dir')
+ parser.add_option(
+ '--single_process',
+ action="store_true",
+ default=False,
+ help=('run everything in a single process, which makes debugging '
+ 'easier'))
options, args = parser.parse_args()
required_option_names = ("web_idl_database", "root_src_dir",
@@ -76,7 +82,7 @@ def main():
root_gen_dir=options.root_gen_dir,
component_reldirs=component_reldirs)
- task_queue = bind_gen.TaskQueue()
+ task_queue = bind_gen.TaskQueue(single_process=options.single_process)
for task in tasks:
dispatch_table[task](task_queue)
-- --
2.37.0 2.42.0

View file

@ -1,7 +1,7 @@
From 67b6ede8c7b82dfddc53b945945a5d4c9e2ad9c3 Mon Sep 17 00:00:00 2001 From 0e4263acca545d92b194c264c63552fdce91d841 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org> From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Tue, 2 Feb 2021 13:58:59 -0700 Date: Tue, 2 Feb 2021 13:58:59 -0700
Subject: [PATCH 4/5] Run blink bindings generation single threaded Subject: [PATCH 4/4] Run blink bindings generation single threaded
When not single threaded this process will eat all the RAM. When not single threaded this process will eat all the RAM.
--- ---
@ -21,5 +21,5 @@ index 6a457ced15a..09f1250d173 100644
rebase_path(web_idl_database, root_build_dir), rebase_path(web_idl_database, root_build_dir),
"--root_src_dir", "--root_src_dir",
-- --
2.37.0 2.42.0

View file

@ -1,345 +0,0 @@
From 0908105c5a7fb5d3f0b644b37811f82934cccf60 Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Tue, 19 Jul 2022 23:58:46 -0400
Subject: [PATCH 5/5] Backport of 16k page support on aarch64
---
.../address_space_randomization.h | 15 ++++++
.../page_allocator_constants.h | 51 +++++++++++++++++-
.../partition_address_space.cc | 6 +++
.../partition_allocator/partition_alloc.cc | 2 +-
.../partition_alloc_constants.h | 5 +-
.../address_space_randomization.h | 15 ++++++
.../partition_allocator/page_allocator.cc | 8 +++
.../page_allocator_constants.h | 52 ++++++++++++++++++-
.../partition_allocator/partition_alloc.cc | 2 +-
.../partition_alloc_constants.h | 5 +-
10 files changed, 153 insertions(+), 8 deletions(-)
diff --git a/chromium/base/allocator/partition_allocator/address_space_randomization.h b/chromium/base/allocator/partition_allocator/address_space_randomization.h
index e77003eab25..31ac05b86f5 100644
--- a/chromium/base/allocator/partition_allocator/address_space_randomization.h
+++ b/chromium/base/allocator/partition_allocator/address_space_randomization.h
@@ -119,6 +119,21 @@ AslrMask(uintptr_t bits) {
return AslrAddress(0x20000000ULL);
}
+ #elif defined(OS_LINUX)
+
+ // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on
+ // page size and number of levels of translation pages used. We use
+ // 39-bit as base as all setups should support this, lowered to 38-bit
+ // as ASLROffset() could cause a carry.
+ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE uintptr_t
+ ASLRMask() {
+ return AslrMask(38);
+ }
+ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE uintptr_t
+ ASLROffset() {
+ return AslrAddress(0x1000000000ULL);
+ }
+
#else
// ARM64 on Linux has 39-bit user space. Use 38 bits since ASLROffset()
diff --git a/chromium/base/allocator/partition_allocator/page_allocator_constants.h b/chromium/base/allocator/partition_allocator/page_allocator_constants.h
index c42fe2835ff..dc7486608b9 100644
--- a/chromium/base/allocator/partition_allocator/page_allocator_constants.h
+++ b/chromium/base/allocator/partition_allocator/page_allocator_constants.h
@@ -24,6 +24,31 @@
// elimination.
#define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+// This should work for all POSIX (if needed), but currently all other
+// supported OS/architecture combinations use either hard-coded values
+// (such as x86) or have means to determine these values without needing
+// atomics (such as macOS on arm64).
+
+// Page allocator constants are run-time constant
+#define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+
+#include <unistd.h>
+#include <atomic>
+
+namespace base::internal {
+
+// Holds the current page size and shift, where size = 1 << shift
+// Use PageAllocationGranularity(), PageAllocationGranularityShift()
+// to initialize and retrieve these values safely.
+struct PageCharacteristics {
+ std::atomic<int> size;
+ std::atomic<int> shift;
+};
+extern PageCharacteristics page_characteristics;
+
+} // namespace base::internal
+
#else
// When defined, page size constants are fixed at compile time. When not
@@ -36,11 +61,17 @@
#endif
+namespace base {
+// Forward declaration, implementation below
+PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
+PageAllocationGranularity();
+}
+
namespace {
#if !defined(OS_APPLE)
-constexpr ALWAYS_INLINE int PageAllocationGranularityShift() {
+PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int PageAllocationGranularityShift() {
#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
// Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
// sizes. Since 64kB is the de facto standard on the platform and binaries
@@ -49,6 +80,15 @@ constexpr ALWAYS_INLINE int PageAllocationGranularityShift() {
return 16; // 64kB
#elif defined(_MIPS_ARCH_LOONGSON)
return 14; // 16kB
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb (shift = 12), 16kb (shift = 14), and 64kb (shift = 16)
+ // page sizes. Retrieve from or initialize cache.
+ int shift = base::internal::page_characteristics.shift.load(std::memory_order_relaxed);
+ if (UNLIKELY(shift == 0)) {
+ shift = __builtin_ctz((int)base::PageAllocationGranularity());
+ base::internal::page_characteristics.shift.store(shift, std::memory_order_relaxed);
+ }
+ return shift;
#else
return 12; // 4kB
#endif
@@ -64,6 +104,15 @@ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
PageAllocationGranularity() {
#if defined(OS_APPLE)
return vm_page_size;
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb, 16kb, and 64kb page sizes. Retrieve from or
+ // initialize cache.
+ int size = internal::page_characteristics.size.load(std::memory_order_relaxed);
+ if (UNLIKELY(size == 0)) {
+ size = getpagesize();
+ internal::page_characteristics.size.store(size, std::memory_order_relaxed);
+ }
+ return size;
#else
return 1ULL << PageAllocationGranularityShift();
#endif
diff --git a/chromium/base/allocator/partition_allocator/partition_address_space.cc b/chromium/base/allocator/partition_allocator/partition_address_space.cc
index 03883bcb113..90efc51c838 100644
--- a/chromium/base/allocator/partition_allocator/partition_address_space.cc
+++ b/chromium/base/allocator/partition_allocator/partition_address_space.cc
@@ -75,6 +75,12 @@ void PartitionAddressSpace::UninitForTesting() {
internal::AddressPoolManager::GetInstance()->ResetForTesting();
}
+#if defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+
+PageCharacteristics page_characteristics;
+
+#endif // defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+
#endif // defined(PA_HAS_64_BITS_POINTERS)
} // namespace internal
diff --git a/chromium/base/allocator/partition_allocator/partition_alloc.cc b/chromium/base/allocator/partition_allocator/partition_alloc.cc
index daeb6d5cb17..7c434b5e697 100644
--- a/chromium/base/allocator/partition_allocator/partition_alloc.cc
+++ b/chromium/base/allocator/partition_allocator/partition_alloc.cc
@@ -522,7 +522,7 @@ static size_t PartitionPurgePage(internal::PartitionPage<thread_safe>* page,
#if defined(PAGE_ALLOCATOR_CONSTANTS_ARE_CONSTEXPR)
constexpr size_t kMaxSlotCount =
(PartitionPageSize() * kMaxPartitionPagesPerSlotSpan) / SystemPageSize();
-#elif defined(OS_APPLE)
+#elif defined(OS_APPLE) || (defined(OS_LINUX) && defined(ARCH_CPU_ARM64))
// It's better for slot_usage to be stack-allocated and fixed-size, which
// demands that its size be constexpr. On OS_APPLE, PartitionPageSize() is
// always SystemPageSize() << 2, so regardless of what the run time page size
diff --git a/chromium/base/allocator/partition_allocator/partition_alloc_constants.h b/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
index c8268ec30a0..f03ba1e4ab4 100644
--- a/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
+++ b/chromium/base/allocator/partition_allocator/partition_alloc_constants.h
@@ -57,10 +57,11 @@ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
PartitionPageShift() {
return 18; // 256 KiB
}
-#elif defined(OS_APPLE)
+#elif defined(OS_APPLE) || \
+ (defined(OS_LINUX) && defined(ARCH_CPU_ARM64))
PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
PartitionPageShift() {
- return vm_page_shift + 2;
+ return PageAllocationGranularityShift() + 2;
}
#else
PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
diff --git a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization.h b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization.h
index 28c8271fd68..3957e0cdf76 100644
--- a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization.h
+++ b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization.h
@@ -120,6 +120,21 @@ AslrMask(uintptr_t bits) {
return AslrAddress(0x20000000ULL);
}
+ #elif defined(OS_LINUX)
+
+ // Linux on arm64 can use 39, 42, 48, or 52-bit user space, depending on
+ // page size and number of levels of translation pages used. We use
+ // 39-bit as base as all setups should support this, lowered to 38-bit
+ // as ASLROffset() could cause a carry.
+ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE uintptr_t
+ ASLRMask() {
+ return AslrMask(38);
+ }
+ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE uintptr_t
+ ASLROffset() {
+ return AslrAddress(0x1000000000ULL);
+ }
+
#else
// ARM64 on Linux has 39-bit user space. Use 38 bits since kASLROffset
diff --git a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator.cc b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator.cc
index 91d00d2fbca..597d5f84cb1 100644
--- a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator.cc
+++ b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator.cc
@@ -255,5 +255,13 @@ uint32_t GetAllocPageErrorCode() {
return s_allocPageErrorCode;
}
+#if defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+
+namespace internal {
+PageCharacteristics page_characteristics;
+}
+
+#endif // defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+
} // namespace base
} // namespace pdfium
diff --git a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
index fdc65ac47b7..f826308839d 100644
--- a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
+++ b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h
@@ -24,6 +24,31 @@
// elimination.
#define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+// This should work for all POSIX (if needed), but currently all other
+// supported OS/architecture combinations use either hard-coded values
+// (such as x86) or have means to determine these values without needing
+// atomics (such as macOS on arm64).
+
+// Page allocator constants are run-time constant
+#define PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR __attribute__((const))
+
+#include <unistd.h>
+#include <atomic>
+
+namespace pdfium::base::internal {
+
+// Holds the current page size and shift, where size = 1 << shift
+// Use PageAllocationGranularity(), PageAllocationGranularityShift()
+// to initialize and retrieve these values safely.
+struct PageCharacteristics {
+ std::atomic<int> size;
+ std::atomic<int> shift;
+};
+extern PageCharacteristics page_characteristics;
+
+} // namespace base::internal
+
#else
// When defined, page size constants are fixed at compile time. When not
@@ -37,11 +62,18 @@
#endif
namespace pdfium {
+
+namespace base {
+// Forward declaration, implementation below
+PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
+PageAllocationGranularity();
+}
+
namespace {
#if !defined(OS_APPLE)
-constexpr ALWAYS_INLINE int PageAllocationGranularityShift() {
+PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int PageAllocationGranularityShift() {
#if defined(OS_WIN) || defined(ARCH_CPU_PPC64)
// Modern ppc64 systems support 4kB (shift = 12) and 64kB (shift = 16) page
// sizes. Since 64kB is the de facto standard on the platform and binaries
@@ -50,6 +82,15 @@ constexpr ALWAYS_INLINE int PageAllocationGranularityShift() {
return 16; // 64kB
#elif defined(_MIPS_ARCH_LOONGSON)
return 14; // 16kB
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb (shift = 12), 16kb (shift = 14), and 64kb (shift = 16)
+ // page sizes. Retrieve from or initialize cache.
+ int shift = base::internal::page_characteristics.shift.load(std::memory_order_relaxed);
+ if (UNLIKELY(shift == 0)) {
+ shift = __builtin_ctz((int)base::PageAllocationGranularity());
+ base::internal::page_characteristics.shift.store(shift, std::memory_order_relaxed);
+ }
+ return shift;
#else
return 12; // 4kB
#endif
@@ -65,6 +106,15 @@ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE size_t
PageAllocationGranularity() {
#if defined(OS_APPLE)
return vm_page_size;
+#elif defined(OS_LINUX) && defined(ARCH_CPU_ARM64)
+ // arm64 supports 4kb, 16kb, and 64kb page sizes. Retrieve from or
+ // initialize cache.
+ int size = internal::page_characteristics.size.load(std::memory_order_relaxed);
+ if (UNLIKELY(size == 0)) {
+ size = getpagesize();
+ internal::page_characteristics.size.store(size, std::memory_order_relaxed);
+ }
+ return size;
#else
return 1ULL << PageAllocationGranularityShift();
#endif
diff --git a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc
index 2e5e87fa7e6..89b9f6217a6 100644
--- a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc
+++ b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc
@@ -486,7 +486,7 @@ static size_t PartitionPurgePage(internal::PartitionPage* page, bool discard) {
#if defined(PAGE_ALLOCATOR_CONSTANTS_ARE_CONSTEXPR)
constexpr size_t kMaxSlotCount =
(PartitionPageSize() * kMaxPartitionPagesPerSlotSpan) / SystemPageSize();
-#elif defined(OS_APPLE)
+#elif defined(OS_APPLE) || (defined(OS_LINUX) && defined(ARCH_CPU_ARM64))
// It's better for slot_usage to be stack-allocated and fixed-size, which
// demands that its size be constexpr. On OS_APPLE, PartitionPageSize() is
// always SystemPageSize() << 2, so regardless of what the run time page size
diff --git a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
index 71d63ba4146..a6d83626741 100644
--- a/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
+++ b/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h
@@ -50,10 +50,11 @@ PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
PartitionPageShift() {
return 18; // 256 KiB
}
-#elif defined(OS_APPLE)
+#elif defined(OS_APPLE) || \
+ (defined(OS_LINUX) && defined(ARCH_CPU_ARM64))
PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
PartitionPageShift() {
- return vm_page_shift + 2;
+ return PageAllocationGranularityShift() + 2;
}
#else
PAGE_ALLOCATOR_CONSTANTS_DECLARE_CONSTEXPR ALWAYS_INLINE int
--
2.37.0

View file

@ -5,7 +5,6 @@
# - patch for chromium GN # - patch for chromium GN
# - patch for chromium skia # - patch for chromium skia
# - patch for chromium to run blink bindings generation single threaded # - patch for chromium to run blink bindings generation single threaded
# - patch for chromium to backport 16k page support
# - build v7 with -j4 # - build v7 with -j4
highmem=1 highmem=1
@ -35,8 +34,7 @@ source=(git+https://code.qt.io/qt/qtwebengine.git#tag=v${pkgver}-lts
0001-ARM-toolchain-fixes.patch 0001-ARM-toolchain-fixes.patch
0002-Fix-ARM-skia-ICE.patch 0002-Fix-ARM-skia-ICE.patch
0003-bind-gen-Support-single_process-flag-in-generate_bin.patch 0003-bind-gen-Support-single_process-flag-in-generate_bin.patch
0004-Run-blink-bindings-generation-single-threaded.patch 0004-Run-blink-bindings-generation-single-threaded.patch)
0005-Backport-of-16k-page-support-on-aarch64.patch)
sha256sums=('SKIP' sha256sums=('SKIP'
'SKIP' 'SKIP'
'0ad5d1660886f7bbf5108b071bf5d7bbbabf1cd1258ce9d4587a01dec4a1aa89' '0ad5d1660886f7bbf5108b071bf5d7bbbabf1cd1258ce9d4587a01dec4a1aa89'
@ -45,11 +43,10 @@ sha256sums=('SKIP'
'5e3a3c4711d964d5152a04059a2b5c1d14bb13dd29bce370120f60e85b476b6f' '5e3a3c4711d964d5152a04059a2b5c1d14bb13dd29bce370120f60e85b476b6f'
'bfae9e773edfd0ddbc617777fdd4c0609cba2b048be7afe40f97768e4eb6117e' 'bfae9e773edfd0ddbc617777fdd4c0609cba2b048be7afe40f97768e4eb6117e'
'547e092f6a20ebd15e486b31111145bc94b8709ec230da89c591963001378845' '547e092f6a20ebd15e486b31111145bc94b8709ec230da89c591963001378845'
'888dcb27b6cc9ac6e926a59707cc298a0d4ff24b5461a14d8c5dd4ab70e8b759' 'abccb5349ec341fd912be93d055f0cdf6becfdb5fa3312769777f750cfd4351a'
'4d09377b181a1bd9d84c0e45e8edae7b43c5af92b9375ef8cdbb1be06ec75436' 'cad41451dffb5cc67c57882526c6c19795e6e49e7b704f92ec76dd3499486654'
'a2dda475d7064e627f4b60bde3539a25f9b520881628b62192bfa8d705dd965e' '71274861c5323ea4c77057ac1477bcc0d7ec76e01d38b417c6a18d8261feea29'
'1ee30297739637763e1e36ac65a9b504e161ef2c2cd9ac8bc01d071ff3b284bf' 'da530a518090f23bef77ad7cfffb29f01ea41b8ef6b6567e26548b0b49961f67')
'fcf7ff60b2a78dc1ae1e93f8d15744b6d90e64eeebc5979385b92b85e4e3f079')
prepare() { prepare() {
mkdir -p build mkdir -p build
@ -74,7 +71,6 @@ prepare() {
patch -p1 -i ${srcdir}/0002-Fix-ARM-skia-ICE.patch patch -p1 -i ${srcdir}/0002-Fix-ARM-skia-ICE.patch
patch -p1 -i ${srcdir}/0003-bind-gen-Support-single_process-flag-in-generate_bin.patch patch -p1 -i ${srcdir}/0003-bind-gen-Support-single_process-flag-in-generate_bin.patch
patch -p1 -i ${srcdir}/0004-Run-blink-bindings-generation-single-threaded.patch patch -p1 -i ${srcdir}/0004-Run-blink-bindings-generation-single-threaded.patch
patch -p1 -i ${srcdir}/0005-Backport-of-16k-page-support-on-aarch64.patch
} }
build() { build() {