Compare commits

...

No commits in common. 'epel9' and 'i9-gost' have entirely different histories.

@ -0,0 +1,3 @@
9e4b3a30e852aa2add27115df620a113f7b9d921 SOURCES/chromium-115.0.5790.170.tar.xz
a6033325fb1c8501bf1b4821acfebc076bca3ba1 SOURCES/chromium-gost-d4a3d8f7603c0e2dfa3642cca00c169d070e043e.tar.gz
7f2dae4d92fd16ba75b35408e1c0a9003d27eb38 SOURCES/msspi-dddd947089110165db71fdc660157f102bab3660.tar.gz

43
.gitignore vendored

@ -1,40 +1,3 @@
/chromium-52.0.2743.75-clean.tar.xz SOURCES/chromium-115.0.5790.170.tar.xz
/depot_tools.git-master.tar.gz SOURCES/chromium-gost-eff0aba6091bcf9ca9b8a6d31402dfe55ddaf8ce.tar.gz
/policy_templates.zip SOURCES/msspi-dddd947089110165db71fdc660157f102bab3660.tar.gz
/chromium-*.tar.xz
/gelasio.zip
/MuktiNarrow-0.94.tar.bz2
/NotoSansCJKjp-hinted.zip
/lohit-gurmukhi-ttf-2.91.2.tar.gz
/Arimo-BoldItalic.ttf
/Arimo-Bold.ttf
/Arimo-Italic.ttf
/Arimo-Regular.ttf
/Cousine-BoldItalic.ttf
/Cousine-Bold.ttf
/Cousine-Italic.ttf
/Cousine-Regular.ttf
/Tinos-BoldItalic.ttf
/Tinos-Bold.ttf
/Tinos-Italic.ttf
/Tinos-Regular.ttf
/Ahem.ttf
/node-v8.9.1-linux-x64.tar.gz
/node-v10.15.3-linux-x64.tar.gz
/xcb-proto-1.14.tar.xz
/NotoSansSymbols2-Regular.ttf
/NotoSansTibetan-Regular.ttf
/node-v12.22.6-linux-arm64.tar.xz
/node-v12.22.6-linux-x64.tar.xz
/node-v16.17.0-linux-x64.tar.xz
/node-v16.17.0-linux-arm64.tar.xz
/testupload
/node-v19.8.1-linux-arm64.tar.xz
/node-v19.8.1-linux-x64.tar.xz
/node-v20.6.1-linux-arm64.tar.xz
/node-v20.6.1-linux-x64.tar.xz
/linux-arm64-0.19.2.tgz
/linux-x64-0.19.2.tgz
/v0.69.4.tar.gz
/bindgen-cli-aarch64.tar.xz
/bindgen-cli-x86_64.tar.xz

File diff suppressed because it is too large Load Diff

@ -1,57 +0,0 @@
From 40309fb53e39477490fd6928ebe67c4fb78de380 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@gmail.com>
Date: Sun, 10 Mar 2019 21:01:37 -0500
Subject: [PATCH] Add ppc64 target to libaom
---
third_party/libaom/BUILD.gn | 12 ++++++++++++
third_party/libaom/cmake_update.sh | 3 +++
2 files changed, 15 insertions(+)
Index: chromium-128.0.6613.113/third_party/libaom/BUILD.gn
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libaom/BUILD.gn
+++ chromium-128.0.6613.113/third_party/libaom/BUILD.gn
@@ -275,6 +275,18 @@ if (current_cpu == "arm64") {
}
}
+if (current_cpu == "ppc64") {
+ source_set("libaom_intrinsics_vsx") {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":libaom_config" ]
+ sources = [
+ "//third_party/libaom/source/libaom/aom_ports/ppc_cpudetect.c",
+ ]
+ sources += aom_av1_common_intrin_vsx
+ }
+}
+
static_library("libaom") {
check_includes = false
if (!is_debug && is_win) {
@@ -338,6 +350,9 @@ static_library("libaom") {
# This is needed by all arm boards due to aom_arm_cpu_caps()
sources += [ "source/libaom/aom_ports/aarch32_cpudetect.c" ]
}
+ if (current_cpu == "ppc64") {
+ deps += [ ":libaom_intrinsics_vsx" ]
+ }
if (is_android) {
deps += [ "//third_party/cpu_features:ndk_compat" ]
}
Index: chromium-128.0.6613.113/third_party/libaom/cmake_update.sh
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libaom/cmake_update.sh
+++ chromium-128.0.6613.113/third_party/libaom/cmake_update.sh
@@ -190,6 +190,9 @@ reset_dirs linux/arm64-cpu-detect
gen_config_files linux/arm64-cpu-detect \
"${toolchain}/arm64-linux-gcc.cmake ${all_platforms}"
+reset_dirs linux/ppc64
+gen_config_files linux/ppc64 "${toolchain}/ppc-linux-gcc.cmake ${all_platforms}"
+
# Copy linux configurations and modify for Windows.
reset_dirs win/arm64-cpu-detect
cp "${CFG}/linux/arm64-cpu-detect/config"/* \

File diff suppressed because it is too large Load Diff

@ -1,30 +0,0 @@
From ea104a841fca1ff4d5430915f1b7c52c6a642f13 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <tpearson@raptorengineering.com>
Date: Fri, 21 Sep 2018 21:44:17 -0500
Subject: [PATCH] Force baseline POWER8 / AltiVec / VSX CPU features when on a
PPC64 platform in LE mode
---
BUILD.gn | 6 ++++++
1 file changed, 6 insertions(+)
Index: chromium-130.0.6723.44/v8/BUILD.gn
===================================================================
--- chromium-130.0.6723.44.orig/v8/BUILD.gn
+++ chromium-130.0.6723.44/v8/BUILD.gn
@@ -1431,7 +1431,14 @@ config("toolchain") {
if (v8_current_cpu == "ppc64") {
defines += [ "V8_TARGET_ARCH_PPC64" ]
cflags += [ "-ffp-contract=off" ]
- if (current_os == "aix") {
+ if (current_os == "linux") {
+ cflags += [
+ # Enable usage of AltiVec, VSX, and other POWER8 and higher features
+ "-mcpu=power8",
+ "-maltivec",
+ "-mvsx",
+ ]
+ } else if (current_os == "aix") {
cflags += [
# Work around AIX ceil, trunc and round oddities.
"-mcpu=power5+",

File diff suppressed because it is too large Load Diff

@ -1,773 +0,0 @@
From cda9400739dfa064907d822f00578bb51b24a404 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Fri, 17 Aug 2018 14:18:33 -0500
Subject: [PATCH] Implement support for ppc64 on Linux
This patch implements support for the ppc64 architecture on Linux systems.
Notable changes include:
* Modification of tests to support non-4K page sizes
* minidump_writer: Determine size of stack to capture based on page size
* dump_writer_common: Introduce member function GetVectorRegisters to
ThreadInfo on ppc64 systems. This allows Altivec/VMX registers to be
dumped like they are on OS X. linux_ptrace_dumper has been updated
to utilize this function along with the ptrace mode NT_PPC_VMX.
* processor/exploitability_unittest.cc: Tests were disabled on
non-x86 systems. They assume the system objdump is capable of
disassembling x86 binaries which is not the case on other
architectures.
To-do:
* tools/linux/md2core has been updated as well, but functionality
has not been confirmed and restoration of Altivec/VMX registers
has not been implemented
Note that proper functionality depends on updates to third_party/LSS
that introduce PPC64 support. An in-progress patch that allows
breakpad to build and run successfully is available at:
https://wiki.raptorcs.com/wiki/Porting/Chromium
---
.../dump_writer_common/raw_context_cpu.h | 2 +
.../linux/dump_writer_common/thread_info.cc | 56 ++++++++++++++++++-
.../linux/dump_writer_common/thread_info.h | 9 +++
.../dump_writer_common/ucontext_reader.cc | 42 ++++++++++++++
.../dump_writer_common/ucontext_reader.h | 3 +
src/client/linux/handler/exception_handler.cc | 22 +++++++-
src/client/linux/handler/exception_handler.h | 6 +-
.../handler/exception_handler_unittest.cc | 8 ++-
.../microdump_writer/microdump_writer.cc | 14 ++++-
.../microdump_writer_unittest.cc | 15 ++++-
.../minidump_writer/linux_core_dumper.cc | 8 ++-
.../linux/minidump_writer/linux_dumper.cc | 4 +-
.../linux/minidump_writer/linux_dumper.h | 3 +-
.../linux_dumper_unittest_helper.cc | 2 +
.../minidump_writer/linux_ptrace_dumper.cc | 19 +++++--
.../linux_ptrace_dumper_unittest.cc | 5 ++
.../linux/minidump_writer/minidump_writer.cc | 18 ++++--
.../linux/minidump_writer/minidump_writer.h | 2 +
.../minidump_writer_unittest.cc | 3 +
src/common/linux/memory_mapped_file.cc | 3 +-
.../linux/memory_mapped_file_unittest.cc | 7 ++-
src/common/memory_allocator_unittest.cc | 3 +-
src/processor/exploitability_linux.cc | 2 +
src/processor/exploitability_unittest.cc | 15 +++--
src/tools/linux/md2core/minidump-2-core.cc | 45 +++++++++++++++
25 files changed, 281 insertions(+), 35 deletions(-)
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
@@ -51,6 +51,8 @@ typedef MDRawContextRISCV64 RawContextCP
# else
# error "Unexpected __riscv_xlen"
# endif
+#elif defined(__powerpc64__)
+typedef MDRawContextPPC64 RawContextCPU;
#else
#error "This code has not been ported to your platform yet."
#endif
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc
@@ -336,7 +336,42 @@ void ThreadInfo::FillCPUContext(RawConte
#error "Unexpected __riscv_xlen"
#endif
}
-#endif // __riscv
+
+#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);
@@ -350,6 +385,11 @@ void ThreadInfo::GetGeneralPurposeRegist
*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;
@@ -384,6 +424,11 @@ void ThreadInfo::GetFloatingPointRegiste
# else
# error "Unexpected __riscv_flen"
# endif
+#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;
@@ -392,4 +437,13 @@ void ThreadInfo::GetFloatingPointRegiste
#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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h
@@ -67,6 +67,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;
+ struct _libc_vrstate vregs;
#elif defined(__mips__) || defined(__riscv)
// Use the structure defined in <sys/ucontext.h>.
mcontext_t mcontext;
@@ -83,6 +87,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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
@@ -324,6 +324,48 @@ void UContextReader::FillCPUContext(RawC
#error "Unexpected __riscv_xlen"
#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 struct _libc_vrstate* 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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+++ chromium-130.0.6723.44/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 struct _libc_vrstate* vregs);
#else
static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc);
#endif
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
@@ -464,6 +464,13 @@ bool ExceptionHandler::HandleSignal(int
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 GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
ucontext_t* uc_ptr = (ucontext_t*)uc;
if (uc_ptr->uc_mcontext.fpregs) {
@@ -701,10 +708,18 @@ bool ExceptionHandler::WriteMinidump() {
}
#endif
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__)
+#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__) \
+ && !defined(__powerpc64__)
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.
@@ -725,6 +740,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]);
#elif defined(__riscv)
context.siginfo.si_addr =
reinterpret_cast<void*>(context.context.uc_mcontext.__gregs[REG_PC]);
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h
@@ -200,7 +200,11 @@ class ExceptionHandler {
siginfo_t siginfo;
pid_t tid; // the crashing thread.
ucontext_t context;
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#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 GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
fpstate_t float_state;
#endif
};
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc
@@ -321,7 +321,7 @@ TEST(ExceptionHandlerTest, ParallelChild
ASSERT_EQ(SIGSEGV, WTERMSIG(status));
return;
} else {
- usleep(100000);
+ usleep(200000);
}
}
@@ -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, InstructionPo
// 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();
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc
@@ -141,7 +141,9 @@ class MicrodumpWriter {
const MicrodumpExtraInfo& microdump_extra_info,
LinuxDumper* dumper)
: ucontext_(context ? &context->context : NULL),
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ vector_state_(context ? &context->vector_state : NULL),
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
float_state_(context ? &context->float_state : NULL),
#endif
dumper_(dumper),
@@ -348,6 +350,8 @@ class MicrodumpWriter {
# else
# error "Unexpected __riscv_xlen"
# endif
+#elif defined(__powerpc64__)
+ const char kArch[] = "ppc64";
#else
# error "This code has not been ported to your platform yet"
#endif
@@ -420,7 +424,9 @@ class MicrodumpWriter {
void DumpCPUState() {
RawContextCPU cpu;
my_memset(&cpu, 0, sizeof(RawContextCPU));
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
#else
UContextReader::FillCPUContext(&cpu, ucontext_);
@@ -616,7 +622,9 @@ class MicrodumpWriter {
void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
const ucontext_t* const ucontext_;
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ const google_breakpad::vstate_t* const vector_state_;
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
const google_breakpad::fpstate_t* const float_state_;
#endif
LinuxDumper* dumper_;
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
@@ -282,10 +282,19 @@ TEST(MicrodumpWriterTest, BasicWithMappi
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 "
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
@@ -118,6 +118,9 @@ bool LinuxCoreDumper::GetThreadInfoByInd
#elif defined(__riscv)
stack_pointer = reinterpret_cast<uint8_t*>(
info->mcontext.__gregs[MD_CONTEXT_RISCV_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
@@ -213,7 +216,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];
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc
@@ -770,7 +770,9 @@ bool LinuxDumper::GetStackInfo(const voi
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)
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h
@@ -64,7 +64,8 @@ namespace google_breakpad {
typedef Elf32_auxv_t elf_aux_entry;
#elif defined(__x86_64) || defined(__aarch64__) || \
(defined(__mips__) && _MIPS_SIM != _ABIO32) || \
- (defined(__riscv) && __riscv_xlen == 64)
+ (defined(__riscv) && __riscv_xlen == 64) || \
+ defined(__powerpc64__)
typedef Elf64_auxv_t elf_aux_entry;
#endif
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -56,6 +56,8 @@
#define TID_PTR_REGISTER "$1"
#elif defined(__riscv)
#define TID_PTR_REGISTER "x4"
+#elif defined(__powerpc64__)
+#define TID_PTR_REGISTER "r8"
#else
#error This test has not been ported to this platform.
#endif
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -208,12 +208,12 @@ bool LinuxPtraceDumper::ReadRegisterSet(
#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) {
// We are going to check if we can read VFP registers on ARM32.
// Currently breakpad does not support VFP registers to be a part of minidump,
// so this is only to confirm that we can actually read FP registers.
@@ -233,6 +233,15 @@ bool LinuxPtraceDumper::ReadRegisterSet(
}
#endif // defined(__arm__)
}
+
+#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;
@@ -397,6 +406,9 @@ bool LinuxPtraceDumper::GetThreadInfoByI
#elif defined(__riscv)
stack_pointer = reinterpret_cast<uint8_t*>(
info->mcontext.__gregs[MD_CONTEXT_RISCV_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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
@@ -470,6 +470,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackR
#elif defined(__riscv)
pid_t* process_tid_location =
reinterpret_cast<pid_t*>(one_thread.mcontext.__gregs[4]);
+#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
@@ -569,6 +572,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeSt
uintptr_t heap_addr = thread_info.mcontext.gregs[1];
#elif defined(__riscv)
uintptr_t heap_addr = thread_info.mcontext.__gregs[4];
+#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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc
@@ -144,7 +144,9 @@ class MinidumpWriter {
: fd_(minidump_fd),
path_(minidump_path),
ucontext_(context ? &context->context : NULL),
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ vector_state_(context ? &context->vector_state : NULL),
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
float_state_(context ? &context->float_state : NULL),
#endif
dumper_(dumper),
@@ -476,7 +478,9 @@ class MinidumpWriter {
if (!cpu.Allocate())
return false;
my_memset(cpu.get(), 0, sizeof(RawContextCPU));
-#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
#else
UContextReader::FillCPUContext(cpu.get(), ucontext_);
@@ -953,7 +957,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";
@@ -973,7 +977,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
@@ -1440,7 +1446,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 GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
+#if defined(__powerpc64__)
+ const google_breakpad::vstate_t* const vector_state_;
+#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE
const google_breakpad::fpstate_t* const float_state_; // ditto
#endif
LinuxDumper* dumper_;
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+++ chromium-130.0.6723.44/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 struct _libc_vrstate vstate_t;
#elif !defined(__ARM_EABI__) && !defined(__mips__)
typedef std::remove_pointer<fpregset_t>::type fpstate_t;
#endif
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
@@ -723,6 +723,9 @@ TEST(MinidumpWriterTest, InvalidStackPoi
#elif defined(__riscv)
context.context.uc_mcontext.__gregs[MD_CONTEXT_RISCV_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
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc
@@ -72,8 +72,7 @@ bool MemoryMappedFile::Map(const char* p
#if defined(__x86_64__) || defined(__aarch64__) || \
(defined(__mips__) && _MIPS_SIM == _ABI64) || \
- (defined(__riscv) && __riscv_xlen == 64)
-
+ (defined(__riscv) && __riscv_xlen == 64) || defined(__powerpc64__)
struct kernel_stat st;
if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
#else
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc
@@ -179,9 +179,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterM
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;
}
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc
@@ -60,8 +60,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);
Index: chromium-130.0.6723.44/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
===================================================================
--- chromium-130.0.6723.44.orig/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
+++ chromium-130.0.6723.44/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc
@@ -82,6 +82,8 @@
#define ELF_ARCH EM_AARCH64
#elif defined(__riscv)
#define ELF_ARCH EM_RISCV
+#elif defined(__powerpc64__)
+ #define ELF_ARCH EM_PPC64
#endif
#if defined(__arm__)
@@ -92,6 +94,8 @@ typedef user_regs user_regs_struct;
#elif defined (__mips__) || defined(__riscv)
// 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;
@@ -324,6 +328,9 @@ struct CrashedProcess {
#if defined(__aarch64__)
user_fpsimd_struct fpregs;
#endif
+#if defined(__powerpc64__)
+ mcontext_t mcontext;
+#endif
uintptr_t stack_addr;
const uint8_t* stack;
size_t stack_length;
@@ -627,6 +634,38 @@ ParseThreadRegisters(CrashedProcess::Thr
#error "Unexpected __riscv_xlen"
#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
@@ -732,6 +771,12 @@ ParseSystemInfo(const Options& options,
# else
# error "Unexpected __riscv_xlen"
# 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

@ -1,37 +0,0 @@
From b3a14db7637232d30c878cc1f1ad6d8037e81379 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawn@anastas.io>
Date: Tue, 15 Jan 2019 22:42:21 -0600
Subject: [PATCH] linux/seccomp-bpf: ppc64+glibc workaround in SIGSYS handler
Workaround for an apparent issue with glibc negating syscall
parameters. Observed on a ppc64le machine with glibc.
More investigation required.
---
sandbox/linux/seccomp-bpf/trap.cc | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: chromium-128.0.6613.113/sandbox/linux/seccomp-bpf/trap.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/seccomp-bpf/trap.cc
+++ chromium-128.0.6613.113/sandbox/linux/seccomp-bpf/trap.cc
@@ -236,6 +236,20 @@ void Trap::SigSys(int nr, LinuxSigInfo*
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.

@ -1,23 +0,0 @@
From 0c65e40ae578b743b5f06956597ebc9700768d18 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 22:45:47 -0500
Subject: [PATCH 1/1] sandbox: Enable seccomp_bpf for ppc64
---
sandbox/features.gni | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: chromium-128.0.6613.113/sandbox/features.gni
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/features.gni
+++ chromium-128.0.6613.113/sandbox/features.gni
@@ -9,7 +9,8 @@
use_seccomp_bpf = (is_linux || is_chromeos || is_android) &&
(current_cpu == "x86" || current_cpu == "x64" ||
current_cpu == "arm" || current_cpu == "arm64" ||
- current_cpu == "mipsel" || current_cpu == "mips64el")
+ current_cpu == "mipsel" || current_cpu == "mips64el" ||
+ current_cpu == "ppc64")
# SSBD (Speculative Store Bypass Disable) is a mitigation of Spectre Variant 4.
# As Spectre Variant 4 can be mitigated by site isolation, opt-out SSBD on site

@ -1,80 +0,0 @@
From 036d209a3f1a771de9aed31dfbe804aaf91d1c27 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 23:35:21 -0500
Subject: [PATCH] sandbox/linux: Implement partial support for ppc64 syscalls
and ucontext
Unlike other architectures, the ppc64 files currently rely on applicable
headers being provided by the system. It is sufficient for standard
GNU/Linux environments, but may require expansion elsewhere.
---
sandbox/linux/BUILD.gn | 2 ++
sandbox/linux/system_headers/linux_syscalls.h | 4 ++++
sandbox/linux/system_headers/linux_ucontext.h | 2 ++
sandbox/linux/system_headers/ppc64_linux_syscalls.h | 12 ++++++++++++
sandbox/linux/system_headers/ppc64_linux_ucontext.h | 12 ++++++++++++
5 files changed, 32 insertions(+)
create mode 100644 sandbox/linux/system_headers/ppc64_linux_syscalls.h
create mode 100644 sandbox/linux/system_headers/ppc64_linux_ucontext.h
Index: chromium-128.0.6613.113/sandbox/linux/BUILD.gn
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/BUILD.gn
+++ chromium-128.0.6613.113/sandbox/linux/BUILD.gn
@@ -383,6 +383,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",
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/linux_syscalls.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/system_headers/linux_syscalls.h
+++ chromium-128.0.6613.113/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_
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/ppc64_linux_syscalls.h
===================================================================
--- /dev/null
+++ chromium-128.0.6613.113/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_
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/ppc64_linux_ucontext.h
===================================================================
--- /dev/null
+++ chromium-128.0.6613.113/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_

@ -1,22 +0,0 @@
From c41cd6ac927f592b161abc04468d3c7a4be91995 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Tue, 23 Oct 2018 15:49:31 -0500
Subject: [PATCH] sandbox/linux: Update IsSyscallAllowed in broker_process.cc
---
sandbox/linux/syscall_broker/broker_process.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: chromium-128.0.6613.113/sandbox/linux/syscall_broker/broker_process.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/syscall_broker/broker_process.cc
+++ chromium-128.0.6613.113/sandbox/linux/syscall_broker/broker_process.cc
@@ -169,7 +169,7 @@ bool BrokerProcess::IsSyscallBrokerable(
#if defined(__NR_fstatat64)
case __NR_fstatat64:
#endif
-#if defined(__x86_64__) || defined(__aarch64__)
+#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
case __NR_newfstatat:
#endif
return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT);

@ -1,638 +0,0 @@
From da52663deec77f705d7d58b18484c3e28e563f10 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Tue, 18 Sep 2018 18:39:28 -0500
Subject: [PATCH] sandbox/linux: Update syscall helpers/lists for ppc64
---
.../seccomp-bpf-helpers/baseline_policy.cc | 8 +-
.../syscall_parameters_restrictions.cc | 2 +-
.../syscall_parameters_restrictions.h | 2 +-
.../linux/seccomp-bpf-helpers/syscall_sets.cc | 108 ++++++++++--------
.../linux/seccomp-bpf-helpers/syscall_sets.h | 6 +-
sandbox/linux/services/syscall_wrappers.cc | 2 +-
6 files changed, 73 insertions(+), 55 deletions(-)
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -90,7 +90,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__)
@@ -255,7 +256,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
}
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
- defined(__aarch64__)
+ defined(__aarch64__) || defined(__powerpc64__)
if (sysno == __NR_mmap)
return RestrictMmapFlags();
#endif
@@ -276,7 +277,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
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,
@@ -340,7 +341,8 @@ ResultExpr EvaluateSyscallImpl(int fs_de
}
#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
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
@@ -36,7 +36,7 @@
#include "sandbox/linux/system_headers/linux_time.h"
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
- !defined(__arm__) && !defined(__aarch64__) && \
+ !defined(__arm__) && !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.
@@ -45,6 +45,11 @@
#include <asm/ptrace-abi.h>
#endif
+// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h
+#ifdef __powerpc64__
+#include <termios.h>
+#endif
+
#if BUILDFLAG(IS_ANDROID)
#if !defined(F_DUPFD_CLOEXEC)
@@ -102,6 +107,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
@@ -269,9 +283,11 @@ 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);
const Arg<long> long_arg(2);
@@ -294,8 +310,17 @@ ResultExpr RestrictFcntlCommands() {
F_SETLKW,
F_GETLK,
F_DUPFD,
- F_DUPFD_CLOEXEC},
- Allow())
+ F_DUPFD_CLOEXEC
+#if defined(__powerpc64__)
+// On PPC64, F_SETLK, F_GETLK, F_SETLKW are defined as the 64-bit variants
+// but glibc will sometimes still use the 32-bit versions. Allow both.
+ ,
+ 5, /* F_GETLK (32) */
+ 6, /* F_SETLK (32) */
+ 7 /* F_SETLKW (32) */
+#endif
+ },
+ Allow())
.Case(F_SETFL,
If((long_arg & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS()))
.Case(F_ADD_SEALS,
@@ -304,7 +329,7 @@ ResultExpr RestrictFcntlCommands() {
// clang-format on
}
-#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
@@ -463,7 +488,7 @@ ResultExpr RestrictPtrace() {
#endif
return Switch(request)
.Cases({
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(__powerpc64__)
PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA,
PTRACE_GETREGSET,
#endif
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h
@@ -52,7 +52,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Restr
// 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();
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int s
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;
@@ -52,12 +53,14 @@ bool SyscallSets::IsAllowedGettime(int s
case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID().
#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_ftime: // Obsolete.
#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:
@@ -136,7 +139,7 @@ bool SyscallSets::IsFileSystem(int sysno
case __NR_faccessat2:
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))
@@ -155,7 +158,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
@@ -169,7 +172,8 @@ bool SyscallSets::IsFileSystem(int sysno
#endif
case __NR_statfs: // EPERM not a valid errno.
#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_statfs64:
#endif
case __NR_statx: // EPERM not a valid errno.
@@ -180,7 +184,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.
@@ -220,7 +225,8 @@ bool SyscallSets::IsAllowedFileSystemAcc
#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__)
@@ -233,11 +239,12 @@ bool SyscallSets::IsAllowedFileSystemAcc
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.
-#if defined(__i386__)
+#if defined(__i386__) || defined(__powerpc64__)
case __NR_oldfstat:
#endif
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
@@ -245,6 +252,8 @@ bool SyscallSets::IsAllowedFileSystemAcc
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;
@@ -265,7 +274,8 @@ bool SyscallSets::IsDeniedFileSystemAcce
#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;
@@ -306,7 +316,7 @@ bool SyscallSets::IsGetSimpleId(int sysn
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
@@ -362,7 +372,8 @@ bool SyscallSets::IsAllowedSignalHandlin
// overflow.
case __NR_sigaltstack:
#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_rt_sigtimedwait_time64:
case __NR_sigaction:
case __NR_sigprocmask:
@@ -378,7 +389,8 @@ bool SyscallSets::IsAllowedSignalHandlin
#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
@@ -402,7 +414,7 @@ bool SyscallSets::IsAllowedOperationOnFd
#endif
case __NR_dup3:
#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
- defined(__aarch64__)
+ defined(__aarch64__) || defined(__powerpc64__)
case __NR_shutdown:
#endif
return true;
@@ -435,7 +447,7 @@ bool SyscallSets::IsAllowedProcessStartO
case __NR_exit_group:
case __NR_wait4:
case __NR_waitid:
-#if defined(__i386__)
+#if defined(__i386__) || defined(__powerpc64__)
case __NR_waitpid:
#endif
return true;
@@ -452,7 +464,7 @@ bool SyscallSets::IsAllowedProcessStartO
#endif
case __NR_set_tid_address:
case __NR_unshare:
-#if !defined(__mips__) && !defined(__aarch64__)
+#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__)
case __NR_vfork:
#endif
default:
@@ -499,7 +511,7 @@ bool SyscallSets::IsAllowedEpoll(int sys
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:
@@ -514,7 +526,8 @@ bool SyscallSets::IsDeniedGetOrModifySoc
}
#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) {
@@ -528,7 +541,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:
@@ -554,7 +568,7 @@ bool SyscallSets::IsAllowedAddressSpaceA
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__) || \
@@ -584,7 +598,8 @@ bool SyscallSets::IsAllowedGeneralIo(int
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__)
@@ -604,26 +619,28 @@ bool SyscallSets::IsAllowedGeneralIo(int
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
@@ -679,7 +696,8 @@ bool SyscallSets::IsAllowedBasicSchedule
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:
@@ -691,7 +709,8 @@ bool SyscallSets::IsAllowedBasicSchedule
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:
@@ -707,7 +726,8 @@ bool SyscallSets::IsAdminOperation(int s
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:
@@ -740,7 +760,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:
@@ -756,7 +777,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:
@@ -791,14 +812,15 @@ bool SyscallSets::IsGlobalProcessEnviron
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:
@@ -832,7 +854,7 @@ bool SyscallSets::IsGlobalSystemStatus(i
#endif
case __NR_sysinfo:
case __NR_uname:
-#if defined(__i386__)
+#if defined(__i386__) || defined(__powerpc64__)
case __NR_olduname:
case __NR_oldolduname:
#endif
@@ -916,7 +938,8 @@ bool SyscallSets::IsSystemVSemaphores(in
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
defined(__aarch64__) || \
- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \
+ defined(__powerpc64__)
// These give a lot of ambient authority and bypass the setuid sandbox.
bool SyscallSets::IsSystemVSharedMemory(int sysno) {
switch (sysno) {
@@ -947,7 +970,8 @@ bool SyscallSets::IsSystemVMessageQueue(
#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) {
@@ -967,7 +991,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
}
@@ -1024,7 +1049,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:
@@ -1103,18 +1129,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:
@@ -1122,20 +1152,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;
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
@@ -46,13 +46,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
@@ -84,7 +85,8 @@ class SANDBOX_EXPORT SyscallSets {
#endif
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
defined(__aarch64__) || \
- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \
+ defined(__powerpc64__)
// These give a lot of ambient authority and bypass the setuid sandbox.
static bool IsSystemVSharedMemory(int sysno);
#endif
@@ -95,7 +97,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
Index: chromium-130.0.6723.44/sandbox/linux/services/syscall_wrappers.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/services/syscall_wrappers.cc
+++ chromium-130.0.6723.44/sandbox/linux/services/syscall_wrappers.cc
@@ -61,7 +61,7 @@ long sys_clone(unsigned long flags,
#if defined(ARCH_CPU_X86_64)
return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls);
#elif defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARM_FAMILY) || \
- defined(ARCH_CPU_MIPS_FAMILY)
+ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY)
// CONFIG_CLONE_BACKWARDS defined.
return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid);
#endif

@ -1,27 +0,0 @@
From c9043a422fb4a5a6c72aaa1b907cea5f6a3061dd Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 19:10:24 -0500
Subject: [PATCH 1/4] sandbox/linux/bpf_dsl: Update syscall ranges for ppc64
---
sandbox/linux/bpf_dsl/linux_syscall_ranges.h | 7 +++++++
1 file changed, 7 insertions(+)
Index: chromium-128.0.6613.113/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+++ chromium-128.0.6613.113/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
@@ -56,6 +56,13 @@
#define MAX_PUBLIC_SYSCALL __NR_syscalls
#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

@ -1,26 +0,0 @@
From 7468b266532bd607eb1f5292d758256d800b2eee Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Fri, 10 Aug 2018 00:23:50 -0500
Subject: [PATCH] services/service_manager/sandbox/linux: Fix TCGETS
declaration on PPC64
---
.../sandbox/linux/bpf_renderer_policy_linux.cc | 5 +++++
1 file changed, 5 insertions(+)
Index: chromium-128.0.6613.113/sandbox/policy/linux/bpf_renderer_policy_linux.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/policy/linux/bpf_renderer_policy_linux.cc
+++ chromium-128.0.6613.113/sandbox/policy/linux/bpf_renderer_policy_linux.cc
@@ -15,6 +15,11 @@
#include "sandbox/linux/system_headers/linux_syscalls.h"
#include "sandbox/policy/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>

@ -1,11 +0,0 @@
--- a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn
+++ b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn
@@ -1258,6 +1258,8 @@
"llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp",
"llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp",
"llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp",
+ "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp",
+ "llvm/lib/MC/MCAsmInfoXCOFF.cpp",
]
}

@ -1,12 +0,0 @@
Index: chromium-128.0.6613.113/third_party/angle/src/libANGLE/Constants.h
===================================================================
--- chromium-128.0.6613.113.orig/third_party/angle/src/libANGLE/Constants.h
+++ chromium-128.0.6613.113/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"
#include <stddef.h>

@ -1,23 +0,0 @@
From cc613c2e3bac8d4d1ff153700b819f964435923a Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Tue, 4 Sep 2018 18:16:07 -0500
Subject: [PATCH] third_party/libvpx: Properly generate gni on ppc64
---
third_party/libvpx/BUILD.gn | 2 ++
third_party/libvpx/generate_gni.sh | 10 ++++++++++
2 files changed, 12 insertions(+)
Index: chromium-128.0.6613.113/third_party/libvpx/BUILD.gn
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libvpx/BUILD.gn
+++ chromium-128.0.6613.113/third_party/libvpx/BUILD.gn
@@ -320,6 +320,8 @@ if (current_cpu == "x86" || (current_cpu
} else if (current_cpu == "x64") {
deps = [ ":libvpx_x86_64_headers" ]
sources = libvpx_srcs_x86_64_avx512
+ } else if (current_cpu == "ppc64") {
+ sources = libvpx_srcs_ppc64
}
}
}

@ -1,22 +0,0 @@
Index: chromium-128.0.6613.113/third_party/lss/linux_syscall_support.h
===================================================================
--- chromium-128.0.6613.113.orig/third_party/lss/linux_syscall_support.h
+++ chromium-128.0.6613.113/third_party/lss/linux_syscall_support.h
@@ -4638,7 +4638,7 @@ struct kernel_statx {
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,
@@ -4749,7 +4749,7 @@ struct kernel_statx {
#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,

@ -1,22 +0,0 @@
From 63e63a70766f3059ce5f1d06a95988ecf909b298 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawn@anastas.io>
Date: Wed, 24 Apr 2019 21:17:23 -0500
Subject: [PATCH] third_party/pffft: Include altivec.h on ppc64 with SIMD
enabled
---
third_party/pffft/src/pffft.c | 1 +
1 file changed, 1 insertion(+)
Index: chromium-128.0.6613.113/third_party/pffft/src/pffft.c
===================================================================
--- chromium-128.0.6613.113.orig/third_party/pffft/src/pffft.c
+++ chromium-128.0.6613.113/third_party/pffft/src/pffft.c
@@ -100,6 +100,7 @@
Altivec support macros
*/
#if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__))
+#include <altivec.h>
typedef vector float v4sf;
# define SIMD_SZ 4
# define VZERO() ((vector float) vec_splat_u8(0))

File diff suppressed because it is too large Load Diff

@ -1,18 +0,0 @@
Index: chromium-128.0.6613.113/v8/src/base/immediate-crash.h
===================================================================
--- chromium-128.0.6613.113.orig/v8/src/base/immediate-crash.h
+++ chromium-128.0.6613.113/v8/src/base/immediate-crash.h
@@ -98,6 +98,13 @@
#define TRAP_SEQUENCE1_() asm volatile(".2byte 0x0001");
#define TRAP_SEQUENCE2_() asm volatile("")
+#elif V8_HOST_ARCH_PPC64
+
+#define TRAP_SEQUENCE1_() asm volatile("trap")
+// Intentionally empty: __builtin_unreachable() is always part of the sequence
+// (see IMMEDIATE_CRASH below)
+#define TRAP_SEQUENCE2_() asm volatile("")
+
#else
// Crash report accuracy will not be guaranteed on other architectures, but at

@ -1,21 +0,0 @@
From 82922bf486e9926a171152f61030dfcd53f017b8 Mon Sep 17 00:00:00 2001
From: Timothy Pearson <tpearson@raptorengineering.com>
Date: Thu, 30 Aug 2018 17:32:05 -0500
Subject: [PATCH] Include cstddef to fix build
size_t is not defined unless cstddef is included.
---
third_party/crashpad/crashpad/compat/linux/sys/user.h | 1 +
Index: chromium-127.0.6533.72/third_party/crashpad/crashpad/compat/linux/sys/user.h
===================================================================
--- chromium-127.0.6533.72.orig/third_party/crashpad/crashpad/compat/linux/sys/user.h
+++ chromium-127.0.6533.72/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>

@ -1,76 +0,0 @@
From 3c4705bfdda45feb860a1f121631773e5fe8e53f Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 19:11:26 -0500
Subject: [PATCH 1/4] sandbox/linux/bpf_dsl: Modify seccomp_macros to add
support for ppc64
---
sandbox/linux/bpf_dsl/seccomp_macros.h | 43 ++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
Index: chromium-128.0.6613.113/sandbox/linux/bpf_dsl/seccomp_macros.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/bpf_dsl/seccomp_macros.h
+++ chromium-128.0.6613.113/sandbox/linux/bpf_dsl/seccomp_macros.h
@@ -14,6 +14,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
@@ -343,6 +346,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

File diff suppressed because it is too large Load Diff

@ -1,168 +0,0 @@
Index: chromium-128.0.6613.113/third_party/lss/linux_syscall_support.h
===================================================================
--- chromium-128.0.6613.113.orig/third_party/lss/linux_syscall_support.h
+++ chromium-128.0.6613.113/third_party/lss/linux_syscall_support.h
@@ -87,7 +87,7 @@
* Porting to other related platforms should not be difficult.
*/
#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \
- defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__) || \
+ defined(__mips__) || defined(__PPC__) || defined(__powerpc64__) || defined(__ARM_EABI__) || \
defined(__aarch64__) || defined(__s390__) || defined(__e2k__) || \
(defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch_lp64)) \
&& (defined(__linux) || defined(__ANDROID__))
@@ -399,7 +399,7 @@ struct kernel_stat64 {
unsigned __pad2;
unsigned long long st_blocks;
};
-#elif defined __PPC__
+#elif defined __PPC__ && !defined(__powerpc64__)
struct kernel_stat64 {
unsigned long long st_dev;
unsigned long long st_ino;
@@ -421,6 +421,28 @@ struct kernel_stat64 {
unsigned long __unused4;
unsigned long __unused5;
};
+#elif defined(__powerpc64__)
+struct kernel_stat64 {
+ unsigned long int st_dev;
+ unsigned long int st_ino;
+ unsigned int st_mode;
+ unsigned long int st_nlink;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned long int st_rdev;
+ unsigned short int __pad2;
+ long int st_size;
+ long int st_blksize;
+ long int st_blocks;
+ long int st_atime_;
+ unsigned long int st_atime_nsec_;
+ long int st_mtime_;
+ unsigned long int st_mtime_nsec_;
+ long int st_ctime_;
+ unsigned long int st_ctime_nsec_;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+};
#elif defined(__e2k__)
struct kernel_stat64 {
unsigned long long st_dev;
@@ -537,7 +559,7 @@ struct kernel_stat {
uint64_t st_ctime_nsec_;
int64_t __unused4[3];
};
-#elif defined(__PPC__)
+#elif defined(__PPC__) && !defined(__powerpc64__)
typedef unsigned long kernel_blkcnt_t;
typedef unsigned long kernel_blksize_t;
typedef unsigned kernel_dev_t;
@@ -568,6 +590,37 @@ struct kernel_stat {
unsigned long __unused4;
unsigned long __unused5;
};
+#elif defined(__powerpc64__)
+typedef long int kernel_blkcnt_t;
+typedef long int kernel_blksize_t;
+typedef unsigned long int kernel_dev_t;
+typedef unsigned int kernel_gid_t;
+typedef unsigned long int kernel_ino_t;
+typedef unsigned int kernel_mode_t;
+typedef unsigned long int kernel_nlink_t;
+typedef long int kernel_off_t;
+typedef long int kernel_time_t;
+typedef unsigned int kernel_uid_t;
+struct kernel_stat {
+ kernel_dev_t st_dev;
+ kernel_ino_t st_ino;
+ kernel_mode_t st_mode;
+ kernel_nlink_t st_nlink;
+ kernel_uid_t st_uid;
+ kernel_gid_t st_gid;
+ kernel_dev_t st_rdev;
+ kernel_off_t st_size;
+ kernel_blksize_t st_blksize;
+ kernel_blkcnt_t st_blocks;
+ kernel_time_t st_atime_;
+ unsigned long int st_atime_nsec_;
+ kernel_time_t st_mtime_;
+ unsigned long int st_mtime_nsec_;
+ kernel_time_t st_ctime_;
+ unsigned long int st_ctime_nsec_;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+};
#elif (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64)
typedef int kernel_blkcnt_t;
typedef int kernel_blksize_t;
@@ -1824,6 +1877,28 @@ struct kernel_statx {
#ifndef __NR_getcpu
#define __NR_getcpu 302
#endif
+
+/* Linux commit 86250b9d12caa1a3dee12a7cf638b7dd70eaadb6 (2010) adds
+ * direct socket system calls to PPC */
+#ifndef __NR_socket
+#define __NR_socket 326
+#endif
+#ifndef __NR_socketpair
+#define __NR_socketpair 333
+#endif
+#ifndef __NR_sendto
+#define __NR_sendto 335
+#endif
+#ifndef __NR_shutdown
+#define __NR_shutdown 338
+#endif
+#ifndef __NR_sendmsg
+#define __NR_sendmsg 341
+#endif
+#ifndef __NR_recvmsg
+#define __NR_recvmsg 342
+#endif
+
/* End of powerpc defininitions */
#elif defined(__s390__)
#ifndef __NR_quotactl
@@ -3363,6 +3438,11 @@ struct kernel_statx {
/* TODO(csilvers): consider wrapping some args up in a struct, like we
* do for i386's _syscall6, so we can compile successfully on gcc 2.95
*/
+ #ifdef __powerpc64__
+ /* TODO: implement clone() for ppc64.
+ * until then, use system libc */
+ #define sys_clone clone
+ #else
LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
int flags, void *arg, int *parent_tidptr,
void *newtls, int *child_tidptr) {
@@ -3433,6 +3513,7 @@ struct kernel_statx {
}
LSS_RETURN(int, __ret, __err);
}
+ #endif
#elif defined(__s390__)
#undef LSS_REG
#define LSS_REG(r, a) register unsigned long __r##r __asm__("r"#r) = (unsigned long) a
@@ -4783,7 +4864,7 @@ struct kernel_statx {
LSS_INLINE _syscall6(void*, mmap, void*, addr, size_t, length, int, prot,
int, flags, int, fd, int64_t, offset)
#endif
- #if defined(__PPC__)
+ #if defined(__PPC__) && !defined(__powerpc64__)
#undef LSS_SC_LOADARGS_0
#define LSS_SC_LOADARGS_0(dummy...)
#undef LSS_SC_LOADARGS_1
@@ -5173,7 +5254,11 @@ struct kernel_statx {
#endif
#if !defined(__NR_pipe)
+#if defined(__powerpc64__)
+ LSS_INLINE pid_t LSS_NAME(pipe)(int *pipefd) {
+#else
LSS_INLINE int LSS_NAME(pipe)(int *pipefd) {
+#endif
return LSS_NAME(pipe2)(pipefd, 0);
}
#endif

@ -1,37 +0,0 @@
From cca78240860abb63bbcfe94d1e5f04a1f23c527d Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 19:11:56 -0500
Subject: [PATCH 3/4] sandbox/linux/system_headers: Update linux seccomp header
for ppc64
---
sandbox/linux/system_headers/linux_seccomp.h | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/linux_seccomp.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/system_headers/linux_seccomp.h
+++ chromium-128.0.6613.113/sandbox/linux/system_headers/linux_seccomp.h
@@ -38,6 +38,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
@@ -70,6 +73,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

File diff suppressed because it is too large Load Diff

@ -1,23 +0,0 @@
From 298df3dc44f7121cd8cb9a06b29fa3b16c959b8d Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 19:13:25 -0500
Subject: [PATCH 4/4] sandbox/linux/system_headers: Update linux signal header
for ppc64
---
sandbox/linux/system_headers/linux_signal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/linux_signal.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/system_headers/linux_signal.h
+++ chromium-128.0.6613.113/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

@ -1,17 +0,0 @@
Index: chromium-128.0.6613.113/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc
===================================================================
--- chromium-128.0.6613.113.orig/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc
+++ chromium-128.0.6613.113/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc
@@ -239,6 +239,12 @@ std::string UserAgent() {
#endif
#elif defined (ARCH_CPU_RISCV64)
static constexpr char arch[] = "riscv64";
+#elif defined(__powerpc64__)
+#if defined(ARCH_CPU_LITTLE_ENDIAN)
+ static constexpr char arch[] = "ppc64";
+#elif defined(ARCH_CPU_BIG_ENDIAN)
+ static constexpr char arch[] = "ppc64_be";
+#endif
#else
#error Port
#endif

@ -1,376 +0,0 @@
Index: chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vp9/encoder/ppc/vp9_quantize_vsx.c
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libvpx/source/libvpx/vp9/encoder/ppc/vp9_quantize_vsx.c
+++ chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vp9/encoder/ppc/vp9_quantize_vsx.c
@@ -38,6 +38,28 @@ static INLINE int16x8_t vec_max_across(i
return vec_max(a, vec_perm(a, a, vec_perm16));
}
+static INLINE void
+vec_u64_store(vector unsigned long long vecu64, unsigned long offset, void *ptr)
+{
+#ifndef WORDS_BIGENDIAN
+ __asm__ ("xxswapd %x0, %x1"
+ : "=wa" (vecu64)
+ : "wa" (vecu64));
+#endif
+#if __GNUC__ >= 4
+ if (__builtin_constant_p (offset) && offset == 0)
+ __asm__ ("stxvd2x %x0,0,%1\n\t"
+ :
+ : "wa" (vecu64), "r" ((uintptr_t)ptr)
+ : "memory");
+ else
+#endif
+ __asm__ ("stxvd2x %x0,%1,%2\n\t"
+ :
+ : "wa" (vecu64), "r" (offset), "r" ((uintptr_t)ptr)
+ : "memory", "r0");
+}
+
void vp9_quantize_fp_vsx(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const int16_t *round_ptr, const int16_t *quant_ptr,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
@@ -60,10 +82,10 @@ void vp9_quantize_fp_vsx(const tran_low_
qcoeff0 = vec_mulhi(vec_vaddshs(vec_abs(coeff0), round), quant);
zero_coeff0 = vec_cmpeq(qcoeff0, vec_zeros_s16);
qcoeff0 = vec_sign(qcoeff0, coeff0);
- vec_vsx_st(qcoeff0, 0, qcoeff_ptr);
+ vec_u64_store(qcoeff0, 0, qcoeff_ptr);
dqcoeff0 = vec_mladd(qcoeff0, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff0, 0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, 0, dqcoeff_ptr);
// Remove DC value from round and quant
round = vec_splat(round, 1);
@@ -76,10 +98,10 @@ void vp9_quantize_fp_vsx(const tran_low_
qcoeff1 = vec_mulhi(vec_vaddshs(vec_abs(coeff1), round), quant);
zero_coeff1 = vec_cmpeq(qcoeff1, vec_zeros_s16);
qcoeff1 = vec_sign(qcoeff1, coeff1);
- vec_vsx_st(qcoeff1, 16, qcoeff_ptr);
+ vec_u64_store(qcoeff1, 16, qcoeff_ptr);
dqcoeff1 = vec_mladd(qcoeff1, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff1, 16, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, 16, dqcoeff_ptr);
eob = vec_max(vec_or(scan0, zero_coeff0), vec_or(scan1, zero_coeff1));
@@ -107,23 +129,23 @@ void vp9_quantize_fp_vsx(const tran_low_
qcoeff0 = vec_mulhi(vec_vaddshs(vec_abs(coeff0), round), quant);
zero_coeff0 = vec_cmpeq(qcoeff0, vec_zeros_s16);
qcoeff0 = vec_sign(qcoeff0, coeff0);
- vec_vsx_st(qcoeff0, off0, qcoeff_ptr);
+ vec_u64_store(qcoeff0, off0, qcoeff_ptr);
dqcoeff0 = vec_mladd(qcoeff0, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff0, off0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, off0, dqcoeff_ptr);
qcoeff1 = vec_mulhi(vec_vaddshs(vec_abs(coeff1), round), quant);
zero_coeff1 = vec_cmpeq(qcoeff1, vec_zeros_s16);
qcoeff1 = vec_sign(qcoeff1, coeff1);
- vec_vsx_st(qcoeff1, off1, qcoeff_ptr);
+ vec_u64_store(qcoeff1, off1, qcoeff_ptr);
dqcoeff1 = vec_mladd(qcoeff1, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff1, off1, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, off1, dqcoeff_ptr);
qcoeff2 = vec_mulhi(vec_vaddshs(vec_abs(coeff2), round), quant);
zero_coeff2 = vec_cmpeq(qcoeff2, vec_zeros_s16);
qcoeff2 = vec_sign(qcoeff2, coeff2);
- vec_vsx_st(qcoeff2, off2, qcoeff_ptr);
+ vec_u64_store(qcoeff2, off2, qcoeff_ptr);
dqcoeff2 = vec_mladd(qcoeff2, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff2, off2, dqcoeff_ptr);
+ vec_u64_store(dqcoeff2, off2, dqcoeff_ptr);
eob = vec_max(eob, vec_or(scan0, zero_coeff0));
eob2 = vec_max(vec_or(scan1, zero_coeff1), vec_or(scan2, zero_coeff2));
@@ -200,10 +222,10 @@ void vp9_quantize_fp_32x32_vsx(const tra
qcoeff0 = vec_and(qcoeff0, mask0);
zero_coeff0 = vec_cmpeq(qcoeff0, vec_zeros_s16);
qcoeff0 = vec_sign(qcoeff0, coeff0);
- vec_vsx_st(qcoeff0, 0, qcoeff_ptr);
+ vec_u64_store(qcoeff0, 0, qcoeff_ptr);
dqcoeff0 = dequantize_coeff_32(qcoeff0, dequant);
- vec_vsx_st(dqcoeff0, 0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, 0, dqcoeff_ptr);
// Remove DC value from thres, round, quant and dequant
thres = vec_splat(thres, 1);
@@ -219,10 +241,10 @@ void vp9_quantize_fp_32x32_vsx(const tra
qcoeff1 = vec_and(qcoeff1, mask1);
zero_coeff1 = vec_cmpeq(qcoeff1, vec_zeros_s16);
qcoeff1 = vec_sign(qcoeff1, coeff1);
- vec_vsx_st(qcoeff1, 16, qcoeff_ptr);
+ vec_u64_store(qcoeff1, 16, qcoeff_ptr);
dqcoeff1 = dequantize_coeff_32(qcoeff1, dequant);
- vec_vsx_st(dqcoeff1, 16, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, 16, dqcoeff_ptr);
eob = vec_max(vec_or(scan0, zero_coeff0), vec_or(scan1, zero_coeff1));
@@ -260,17 +282,17 @@ void vp9_quantize_fp_32x32_vsx(const tra
qcoeff1 = vec_sign(qcoeff1, coeff1);
qcoeff2 = vec_sign(qcoeff2, coeff2);
- vec_vsx_st(qcoeff0, off0, qcoeff_ptr);
- vec_vsx_st(qcoeff1, off1, qcoeff_ptr);
- vec_vsx_st(qcoeff2, off2, qcoeff_ptr);
+ vec_u64_store(qcoeff0, off0, qcoeff_ptr);
+ vec_u64_store(qcoeff1, off1, qcoeff_ptr);
+ vec_u64_store(qcoeff2, off2, qcoeff_ptr);
dqcoeff0 = dequantize_coeff_32(qcoeff0, dequant);
dqcoeff1 = dequantize_coeff_32(qcoeff1, dequant);
dqcoeff2 = dequantize_coeff_32(qcoeff2, dequant);
- vec_vsx_st(dqcoeff0, off0, dqcoeff_ptr);
- vec_vsx_st(dqcoeff1, off1, dqcoeff_ptr);
- vec_vsx_st(dqcoeff2, off2, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, off0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, off1, dqcoeff_ptr);
+ vec_u64_store(dqcoeff2, off2, dqcoeff_ptr);
eob = vec_max(eob, vec_or(scan0, zero_coeff0));
eob2 = vec_max(vec_or(scan1, zero_coeff1), vec_or(scan2, zero_coeff2));
Index: chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vpx_dsp/ppc/fdct32x32_vsx.c
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libvpx/source/libvpx/vpx_dsp/ppc/fdct32x32_vsx.c
+++ chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vpx_dsp/ppc/fdct32x32_vsx.c
@@ -15,6 +15,28 @@
#include "vpx_dsp/ppc/txfm_common_vsx.h"
#include "vpx_dsp/ppc/types_vsx.h"
+static INLINE void
+vec_u64_store(vector unsigned long long vecu64, unsigned long offset, void *ptr)
+{
+#ifndef WORDS_BIGENDIAN
+ __asm__ ("xxswapd %x0, %x1"
+ : "=wa" (vecu64)
+ : "wa" (vecu64));
+#endif
+#if __GNUC__ >= 4
+ if (__builtin_constant_p (offset) && offset == 0)
+ __asm__ ("stxvd2x %x0,0,%1\n\t"
+ :
+ : "wa" (vecu64), "r" ((uintptr_t)ptr)
+ : "memory");
+ else
+#endif
+ __asm__ ("stxvd2x %x0,%1,%2\n\t"
+ :
+ : "wa" (vecu64), "r" (offset), "r" ((uintptr_t)ptr)
+ : "memory", "r0");
+}
+
// Returns ((a +/- b) * cospi16 + (2 << 13)) >> 14.
static INLINE void single_butterfly(int16x8_t a, int16x8_t b, int16x8_t *add,
int16x8_t *sub) {
@@ -164,45 +186,45 @@ static INLINE void load(const int16_t *a
}
static INLINE void store(tran_low_t *a, const int16x8_t *b) {
- vec_vsx_st(b[0], 0, a);
- vec_vsx_st(b[8], 0, a + 8);
- vec_vsx_st(b[16], 0, a + 16);
- vec_vsx_st(b[24], 0, a + 24);
-
- vec_vsx_st(b[1], 0, a + 32);
- vec_vsx_st(b[9], 0, a + 40);
- vec_vsx_st(b[17], 0, a + 48);
- vec_vsx_st(b[25], 0, a + 56);
-
- vec_vsx_st(b[2], 0, a + 64);
- vec_vsx_st(b[10], 0, a + 72);
- vec_vsx_st(b[18], 0, a + 80);
- vec_vsx_st(b[26], 0, a + 88);
-
- vec_vsx_st(b[3], 0, a + 96);
- vec_vsx_st(b[11], 0, a + 104);
- vec_vsx_st(b[19], 0, a + 112);
- vec_vsx_st(b[27], 0, a + 120);
-
- vec_vsx_st(b[4], 0, a + 128);
- vec_vsx_st(b[12], 0, a + 136);
- vec_vsx_st(b[20], 0, a + 144);
- vec_vsx_st(b[28], 0, a + 152);
-
- vec_vsx_st(b[5], 0, a + 160);
- vec_vsx_st(b[13], 0, a + 168);
- vec_vsx_st(b[21], 0, a + 176);
- vec_vsx_st(b[29], 0, a + 184);
-
- vec_vsx_st(b[6], 0, a + 192);
- vec_vsx_st(b[14], 0, a + 200);
- vec_vsx_st(b[22], 0, a + 208);
- vec_vsx_st(b[30], 0, a + 216);
-
- vec_vsx_st(b[7], 0, a + 224);
- vec_vsx_st(b[15], 0, a + 232);
- vec_vsx_st(b[23], 0, a + 240);
- vec_vsx_st(b[31], 0, a + 248);
+ vec_u64_store(b[0], 0, a);
+ vec_u64_store(b[8], 0, a + 8);
+ vec_u64_store(b[16], 0, a + 16);
+ vec_u64_store(b[24], 0, a + 24);
+
+ vec_u64_store(b[1], 0, a + 32);
+ vec_u64_store(b[9], 0, a + 40);
+ vec_u64_store(b[17], 0, a + 48);
+ vec_u64_store(b[25], 0, a + 56);
+
+ vec_u64_store(b[2], 0, a + 64);
+ vec_u64_store(b[10], 0, a + 72);
+ vec_u64_store(b[18], 0, a + 80);
+ vec_u64_store(b[26], 0, a + 88);
+
+ vec_u64_store(b[3], 0, a + 96);
+ vec_u64_store(b[11], 0, a + 104);
+ vec_u64_store(b[19], 0, a + 112);
+ vec_u64_store(b[27], 0, a + 120);
+
+ vec_u64_store(b[4], 0, a + 128);
+ vec_u64_store(b[12], 0, a + 136);
+ vec_u64_store(b[20], 0, a + 144);
+ vec_u64_store(b[28], 0, a + 152);
+
+ vec_u64_store(b[5], 0, a + 160);
+ vec_u64_store(b[13], 0, a + 168);
+ vec_u64_store(b[21], 0, a + 176);
+ vec_u64_store(b[29], 0, a + 184);
+
+ vec_u64_store(b[6], 0, a + 192);
+ vec_u64_store(b[14], 0, a + 200);
+ vec_u64_store(b[22], 0, a + 208);
+ vec_u64_store(b[30], 0, a + 216);
+
+ vec_u64_store(b[7], 0, a + 224);
+ vec_u64_store(b[15], 0, a + 232);
+ vec_u64_store(b[23], 0, a + 240);
+ vec_u64_store(b[31], 0, a + 248);
}
// Returns 1 if negative 0 if positive
Index: chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vpx_dsp/ppc/quantize_vsx.c
===================================================================
--- chromium-128.0.6613.113.orig/third_party/libvpx/source/libvpx/vpx_dsp/ppc/quantize_vsx.c
+++ chromium-128.0.6613.113/third_party/libvpx/source/libvpx/vpx_dsp/ppc/quantize_vsx.c
@@ -13,6 +13,28 @@
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/ppc/types_vsx.h"
+static INLINE void
+vec_u64_store(vector unsigned long long vecu64, unsigned long offset, void *ptr)
+{
+#ifndef WORDS_BIGENDIAN
+ __asm__ ("xxswapd %x0, %x1"
+ : "=wa" (vecu64)
+ : "wa" (vecu64));
+#endif
+#if __GNUC__ >= 4
+ if (__builtin_constant_p (offset) && offset == 0)
+ __asm__ ("stxvd2x %x0,0,%1\n\t"
+ :
+ : "wa" (vecu64), "r" ((uintptr_t)ptr)
+ : "memory");
+ else
+#endif
+ __asm__ ("stxvd2x %x0,%1,%2\n\t"
+ :
+ : "wa" (vecu64), "r" (offset), "r" ((uintptr_t)ptr)
+ : "memory", "r0");
+}
+
// Negate 16-bit integers in a when the corresponding signed 16-bit
// integer in b is negative.
static INLINE int16x8_t vec_sign(int16x8_t a, int16x8_t b) {
@@ -124,19 +146,19 @@ void vpx_quantize_b_vsx(const tran_low_t
qcoeff0 =
quantize_coeff(coeff0, coeff0_abs, round, quant, quant_shift, zero_mask0);
- vec_vsx_st(qcoeff0, 0, qcoeff_ptr);
+ vec_u64_store(qcoeff0, 0, qcoeff_ptr);
round = vec_splat(round, 1);
quant = vec_splat(quant, 1);
quant_shift = vec_splat(quant_shift, 1);
qcoeff1 =
quantize_coeff(coeff1, coeff1_abs, round, quant, quant_shift, zero_mask1);
- vec_vsx_st(qcoeff1, 16, qcoeff_ptr);
+ vec_u64_store(qcoeff1, 16, qcoeff_ptr);
dqcoeff0 = vec_mladd(qcoeff0, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff0, 0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, 0, dqcoeff_ptr);
dequant = vec_splat(dequant, 1);
dqcoeff1 = vec_mladd(qcoeff1, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff1, 16, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, 16, dqcoeff_ptr);
eob = vec_max(nonzero_scanindex(qcoeff0, iscan_ptr, 0),
nonzero_scanindex(qcoeff1, iscan_ptr, 16));
@@ -164,17 +186,17 @@ void vpx_quantize_b_vsx(const tran_low_t
zero_mask1);
qcoeff2 = quantize_coeff(coeff2, coeff2_abs, round, quant, quant_shift,
zero_mask2);
- vec_vsx_st(qcoeff0, off0, qcoeff_ptr);
- vec_vsx_st(qcoeff1, off1, qcoeff_ptr);
- vec_vsx_st(qcoeff2, off2, qcoeff_ptr);
+ vec_u64_store(qcoeff0, off0, qcoeff_ptr);
+ vec_u64_store(qcoeff1, off1, qcoeff_ptr);
+ vec_u64_store(qcoeff2, off2, qcoeff_ptr);
dqcoeff0 = vec_mladd(qcoeff0, dequant, vec_zeros_s16);
dqcoeff1 = vec_mladd(qcoeff1, dequant, vec_zeros_s16);
dqcoeff2 = vec_mladd(qcoeff2, dequant, vec_zeros_s16);
- vec_vsx_st(dqcoeff0, off0, dqcoeff_ptr);
- vec_vsx_st(dqcoeff1, off1, dqcoeff_ptr);
- vec_vsx_st(dqcoeff2, off2, dqcoeff_ptr);
+ vec_u64_store(dqcoeff0, off0, dqcoeff_ptr);
+ vec_u64_store(dqcoeff1, off1, dqcoeff_ptr);
+ vec_u64_store(dqcoeff2, off2, dqcoeff_ptr);
eob = vec_max(eob, nonzero_scanindex(qcoeff0, iscan_ptr, off0));
eob2 = vec_max(nonzero_scanindex(qcoeff1, iscan_ptr, off1),
@@ -243,12 +265,12 @@ void vpx_quantize_b_32x32_vsx(const tran
qcoeff1 = quantize_coeff_32(coeff1, coeff1_abs, round, quant, quant_shift,
zero_mask1);
- vec_vsx_st(qcoeff0, 0, qcoeff_ptr);
- vec_vsx_st(qcoeff1, 16, qcoeff_ptr);
+ vec_u64_store(qcoeff0, 0, qcoeff_ptr);
+ vec_u64_store(qcoeff1, 16, qcoeff_ptr);
- vec_vsx_st(dequantize_coeff_32(qcoeff0, dequant), 0, dqcoeff_ptr);
+ vec_u64_store(dequantize_coeff_32(qcoeff0, dequant), 0, dqcoeff_ptr);
dequant = vec_splat(dequant, 1); // remove DC from dequant
- vec_vsx_st(dequantize_coeff_32(qcoeff1, dequant), 16, dqcoeff_ptr);
+ vec_u64_store(dequantize_coeff_32(qcoeff1, dequant), 16, dqcoeff_ptr);
eob = vec_max(nonzero_scanindex(qcoeff0, iscan_ptr, 0),
nonzero_scanindex(qcoeff1, iscan_ptr, 16));
@@ -276,13 +298,13 @@ void vpx_quantize_b_32x32_vsx(const tran
qcoeff2 = quantize_coeff_32(coeff2, coeff2_abs, round, quant, quant_shift,
zero_mask2);
- vec_vsx_st(qcoeff0, off0, qcoeff_ptr);
- vec_vsx_st(qcoeff1, off1, qcoeff_ptr);
- vec_vsx_st(qcoeff2, off2, qcoeff_ptr);
-
- vec_vsx_st(dequantize_coeff_32(qcoeff0, dequant), off0, dqcoeff_ptr);
- vec_vsx_st(dequantize_coeff_32(qcoeff1, dequant), off1, dqcoeff_ptr);
- vec_vsx_st(dequantize_coeff_32(qcoeff2, dequant), off2, dqcoeff_ptr);
+ vec_u64_store(qcoeff0, off0, qcoeff_ptr);
+ vec_u64_store(qcoeff1, off1, qcoeff_ptr);
+ vec_u64_store(qcoeff2, off2, qcoeff_ptr);
+
+ vec_u64_store(dequantize_coeff_32(qcoeff0, dequant), off0, dqcoeff_ptr);
+ vec_u64_store(dequantize_coeff_32(qcoeff1, dequant), off1, dqcoeff_ptr);
+ vec_u64_store(dequantize_coeff_32(qcoeff2, dequant), off2, dqcoeff_ptr);
eob = vec_max(eob, nonzero_scanindex(qcoeff0, iscan_ptr, off0));
eob2 = vec_max(nonzero_scanindex(qcoeff1, iscan_ptr, off1),

@ -1,107 +0,0 @@
From 1d44643a7c7cf650efd1093d22cd5bf859fdcb51 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 9 Aug 2018 20:52:13 -0500
Subject: [PATCH] sandbox/linux/seccomp-bpf: Add ppc64 syscall stub
---
sandbox/linux/seccomp-bpf/syscall.cc | 53 ++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)
Index: chromium-128.0.6613.113/sandbox/linux/seccomp-bpf/syscall.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/seccomp-bpf/syscall.cc
+++ chromium-128.0.6613.113/sandbox/linux/seccomp-bpf/syscall.cc
@@ -23,7 +23,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
@@ -313,10 +313,54 @@ asm(// We need to be able to tell the ke
"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]);
}
@@ -430,6 +474,8 @@ intptr_t Syscall::Call(int nr,
ret = inout;
}
+#elif defined(__powerpc64__)
+ intptr_t ret = SyscallAsm(nr, args);
#else
#error "Unimplemented architecture"
#endif
@@ -446,8 +492,18 @@ void Syscall::PutValueInUcontext(intptr_
// 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);
}

@ -1,24 +0,0 @@
From 6a852c4135864ba87b3cbdd0880d7cfecf7cd654 Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Thu, 13 Sep 2018 15:12:22 -0500
Subject: [PATCH 5/6] sandbox/linux: update unit test for ppc64
---
sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: chromium-128.0.6613.113/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
+++ chromium-128.0.6613.113/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
@@ -350,8 +350,10 @@ TEST_BASELINE_SIGSYS(__NR_timer_create)
#if !defined(__aarch64__)
TEST_BASELINE_SIGSYS(__NR_inotify_init)
+#if !defined(__powerpc64__)
TEST_BASELINE_SIGSYS(__NR_vserver)
#endif
+#endif
#if defined(LIBC_GLIBC) && !BUILDFLAG(IS_CHROMEOS_ASH)
BPF_TEST_C(BaselinePolicy, FutexEINVAL, BaselinePolicy) {

@ -1,14 +0,0 @@
Index: chromium-128.0.6613.113/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+++ chromium-128.0.6613.113/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
@@ -374,7 +374,9 @@ bool SyscallSets::IsAllowedSignalHandlin
#if defined(__i386__) || defined(__arm__) || \
(defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \
defined(__powerpc64__)
+#if !defined(__powerpc64__)
case __NR_rt_sigtimedwait_time64:
+#endif
case __NR_sigaction:
case __NR_sigprocmask:
case __NR_sigreturn:

@ -1,33 +0,0 @@
Index: chromium-128.0.6613.113/sandbox/linux/system_headers/linux_stat.h
===================================================================
--- chromium-128.0.6613.113.orig/sandbox/linux/system_headers/linux_stat.h
+++ chromium-128.0.6613.113/sandbox/linux/system_headers/linux_stat.h
@@ -173,6 +173,28 @@ struct kernel_stat {
unsigned int __unused4;
unsigned int __unused5;
};
+#elif defined(__powerpc64__)
+struct kernel_stat {
+ unsigned long st_dev;
+ ino_t st_ino;
+ unsigned long st_nlink;
+ mode_t st_mode;
+ uid_t st_uid;
+ gid_t st_gid;
+ unsigned long st_rdev;
+ long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ // unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ //unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ //unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
+ unsigned long __unused6;
+};
#endif
#if !defined(AT_EMPTY_PATH)

@ -1,90 +0,0 @@
Index: chromium-130.0.6723.44/sandbox/policy/linux/bpf_utility_policy_linux.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/policy/linux/bpf_utility_policy_linux.cc
+++ chromium-130.0.6723.44/sandbox/policy/linux/bpf_utility_policy_linux.cc
@@ -34,7 +34,7 @@ ResultExpr UtilityProcessPolicy::Evaluat
case __NR_fdatasync:
case __NR_fsync:
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
- defined(__aarch64__)
+ defined(__aarch64__) || defined(__powerpc64__)
case __NR_getrlimit:
#endif
#if defined(__i386__) || defined(__arm__)
Index: chromium-130.0.6723.44/sandbox/policy/linux/bpf_renderer_policy_linux.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/policy/linux/bpf_renderer_policy_linux.cc
+++ chromium-130.0.6723.44/sandbox/policy/linux/bpf_renderer_policy_linux.cc
@@ -87,7 +87,7 @@ ResultExpr RendererProcessPolicy::Evalua
case __NR_ftruncate64:
#endif
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
- defined(__aarch64__)
+ defined(__aarch64__) || defined(__powerpc64__)
case __NR_getrlimit:
case __NR_setrlimit:
// We allow setrlimit to dynamically adjust the address space limit as
Index: chromium-130.0.6723.44/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+++ chromium-130.0.6723.44/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
@@ -58,9 +58,9 @@
#elif defined(__powerpc64__)
-#include <asm/unistd.h>
+#include <asm-generic/unistd.h>
#define MIN_SYSCALL 0u
-#define MAX_PUBLIC_SYSCALL 386u
+#define MAX_PUBLIC_SYSCALL __NR_syscalls
#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
#else
Index: chromium-130.0.6723.44/sandbox/linux/services/credentials.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/services/credentials.cc
+++ chromium-130.0.6723.44/sandbox/linux/services/credentials.cc
@@ -96,7 +96,8 @@ bool ChrootToSafeEmptyDir() {
int clone_flags = CLONE_FS | LINUX_SIGCHLD;
void* tls = nullptr;
-#if (defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARM_FAMILY)) && \
+#if (defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARM_FAMILY) || \
+ defined(ARCH_CPU_PPC64_FAMILY)) && \
!defined(MEMORY_SANITIZER)
// Use CLONE_VM | CLONE_VFORK as an optimization to avoid copying page tables.
// Since clone writes to the new child's TLS before returning, we must set a
@@ -104,6 +105,11 @@ bool ChrootToSafeEmptyDir() {
// glibc performs syscalls by calling a function pointer in TLS, so we do not
// attempt this optimization.
// TODO(crbug.com/40196869) Broken in MSan builds after LLVM f1bb30a4956f.
+ //
+ // NOTE: Without CLONE_VM, fontconfig will attempt to reload configuration
+ // in every thread. Since the rendered threads are sandboxed without
+ // filesystem access (e.g. to /etc/fonts/fonts.conf) this will cause font
+ // configuration loading failures and no fonts will be displayed!
clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
char tls_buf[PTHREAD_STACK_MIN_CONST] = {0};
Index: chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
===================================================================
--- chromium-130.0.6723.44.orig/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+++ chromium-130.0.6723.44/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
@@ -362,7 +362,16 @@ intptr_t SIGSYSFstatatHandler(const stru
if (args.nr == __NR_fstatat_default) {
if (*reinterpret_cast<const char*>(args.args[1]) == '\0' &&
args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
- return syscall(__NR_fstat_default, static_cast<int>(args.args[0]),
+ int fd = static_cast<int>(args.args[0]);
+#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: Investigate the root cause and fix in glibc
+ if (fd < 0)
+ fd = -fd;
+#endif
+ return syscall(__NR_fstat_default, fd,
reinterpret_cast<default_stat_struct*>(args.args[2]));
}
return -reinterpret_cast<intptr_t>(fs_denied_errno);

@ -1,24 +0,0 @@
diff -up chromium-131.0.6778.69/base/compiler_specific.h.me chromium-131.0.6778.69/base/compiler_specific.h
--- chromium-131.0.6778.69/base/compiler_specific.h.me 2024-11-19 20:44:12.404060581 +0100
+++ chromium-131.0.6778.69/base/compiler_specific.h 2024-11-19 20:44:54.434121935 +0100
@@ -152,7 +152,7 @@
// MUSTTAIL return Func1(d + 1); // `Func1()` will be tail-called.
// }
// ```
-#if __has_cpp_attribute(clang::musttail)
+#if __has_cpp_attribute(clang::musttail) && !defined(__powerpc64__)
#define MUSTTAIL [[clang::musttail]]
#else
#define MUSTTAIL
diff -up chromium-131.0.6778.85/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/compiler_specific.h.me chromium-131.0.6778.85/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/compiler_specific.h
--- chromium-131.0.6778.85/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/compiler_specific.h.me 2024-11-20 18:50:28.690761262 +0100
+++ chromium-131.0.6778.85/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/compiler_specific.h 2024-11-20 18:54:49.374711202 +0100
@@ -138,7 +138,7 @@
// PA_MUSTTAIL return Func1(d + 1); // `Func1()` will be tail-called.
// }
// ```
-#if PA_HAS_CPP_ATTRIBUTE(clang::musttail)
+#if PA_HAS_CPP_ATTRIBUTE(clang::musttail) && !defined(__powerpc64__)
#define PA_MUSTTAIL [[clang::musttail]]
#else
#define PA_MUSTTAIL

@ -1,13 +0,0 @@
Index: chromium-130.0.6723.44/third_party/skia/src/core/SkRasterPipeline.h
===================================================================
--- chromium-130.0.6723.44.orig/third_party/skia/src/core/SkRasterPipeline.h
+++ chromium-130.0.6723.44/third_party/skia/src/core/SkRasterPipeline.h
@@ -27,7 +27,7 @@ struct SkImageInfo;
struct skcms_TransferFunction;
#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && \
- !defined(SK_CPU_LOONGARCH) && !(defined(_WIN32) && defined(SK_BUILD_FOR_ANDROID_FRAMEWORK))
+ !defined(SK_CPU_LOONGARCH) && !(defined(_WIN32) && defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)) && !defined(__powerpc64__)
// [[clang::musttail]] is disabled for the Android version of Skia running on Windows as it
// causes crashes (This is probably related to http://crbug.com/1505442).
#define SK_HAS_MUSTTAIL 1

@ -1,48 +0,0 @@
Index: chromium-130.0.6723.44/third_party/libvpx/generate_gni.sh
===================================================================
--- chromium-130.0.6723.44.orig/third_party/libvpx/generate_gni.sh
+++ chromium-130.0.6723.44/third_party/libvpx/generate_gni.sh
@@ -433,7 +433,7 @@ gen_config_files linux/mipsel "--target=
gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}"
gen_config_files linux/loongarch \
"--target=loongarch64-linux-gcc ${all_platforms}"
-gen_config_files linux/ppc64 "--target=ppc64le-linux-gcc ${all_platforms}"
+gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}"
gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}"
gen_config_files win/arm64-highbd \
"--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD} ${disable_sve}"
Index: chromium-130.0.6723.44/third_party/libvpx/source/libvpx/build/make/rtcd.pl
===================================================================
--- chromium-130.0.6723.44.orig/third_party/libvpx/source/libvpx/build/make/rtcd.pl
+++ chromium-130.0.6723.44/third_party/libvpx/source/libvpx/build/make/rtcd.pl
@@ -509,8 +509,9 @@ if ($opts{arch} eq 'x86') {
&require(@REQUIRES);
arm;
} elsif ($opts{arch} =~ /^ppc/ ) {
- @ALL_ARCHS = filter(qw/vsx/);
- ppc;
+ #@ALL_ARCHS = filter(qw/vsx/);
+ #ppc;
+ unoptimized;
} elsif ($opts{arch} =~ /loongarch/ ) {
@ALL_ARCHS = filter(qw/lsx lasx/);
loongarch;
Index: chromium-130.0.6723.44/third_party/libvpx/BUILD.gn
===================================================================
--- chromium-130.0.6723.44.orig/third_party/libvpx/BUILD.gn
+++ chromium-130.0.6723.44/third_party/libvpx/BUILD.gn
@@ -102,6 +102,14 @@ config("libvpx_config") {
"-Wno-sign-compare",
]
}
+
+ if (current_cpu == "ppc64") {
+ cflags += [
+ "-mcpu=power8",
+ "-maltivec",
+ "-mvsx",
+ ]
+ }
}
# This config is applied to targets that depend on libvpx.

@ -1,23 +0,0 @@
Index: chromium-128.0.6613.113/third_party/webrtc/rtc_base/system/arch.h
===================================================================
--- chromium-128.0.6613.113.orig/third_party/webrtc/rtc_base/system/arch.h
+++ chromium-128.0.6613.113/third_party/webrtc/rtc_base/system/arch.h
@@ -46,6 +46,18 @@
#endif
#if defined(__MIPSEL__)
#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
#define WEBRTC_ARCH_BIG_ENDIAN
#endif

@ -0,0 +1,40 @@
From 851e3ceb1021d1824557c7132ec6236c6232ccce Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere.ru>
Date: Fri, 11 Aug 2023 16:03:17 +0300
Subject: [PATCH] Added Russian description and summary for gnome-software
---
.../chromium-browser.appdata.xml | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml b/chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml
index e46c2624f..62e60cd3c 100644
--- a/chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml
+++ b/chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml
@@ -17,9 +17,20 @@
new generation of web applications.
</p>
<p>
- Chromium supports Vorbis, Theora, WebM and HTML5 audio and video standards, but
- does not include the non-free AAC, H.264, MP3 or Adobe Flash code that is found
- in Chrome.
+ Chromium supports Vorbis, Theora, WebM and HTML5 audio and video standards,
+ including AAC, H.264, MP3 and Wideine.
+ </p>
+ <p xml:lang="ru">
+ Chromium - это проект браузера с открытым исходным кодом, целью которого является
+ создание более безопасного, быстрого и стабильного способа работы в Интернете.
+ </p>
+ <p xml:lang="ru">
+ Мы приглашаем вас присоединиться к нашим усилиям по созданию мощной платформы для
+ разработки веб-приложений нового поколения.
+ </p>
+ <p xml:lang="ru">
+ Chromium поддерживает стандарты аудио и видео Vorbis, Theora, WebM и HTML5, включая
+ AAC, H.264, MP3 и Widevine.
</p>
</description>
<url type="homepage">https://www.chromium.org/Home</url>
--
2.41.0

@ -0,0 +1,139 @@
commit f6f27ebf8f82990da4c5fdff103eb62586ee12d9
Author: tigro <arkadiy.sheyn@softline.com>
Date: Sun Jul 23 09:57:21 2023 +0300
Set Yandex as default search engine
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index e672076a3..1ef0e7504 100644
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -560,7 +560,7 @@
"suggest_url": "https://suggest.yandex.by/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.by/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.by/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -573,6 +573,7 @@
"suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}&uil=en&v=3&sn=5",
"image_url": "https://yandex.com/images/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -586,7 +587,7 @@
"suggest_url": "https://suggest.yandex.kz/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.kz/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.kz/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -600,7 +601,7 @@
"suggest_url": "https://suggest.yandex.ru/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ru/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.ru/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -613,7 +614,7 @@
"suggest_url": "https://suggest.yandex.com.tr/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.com.tr/gorsel/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.com.tr/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -627,7 +628,7 @@
"suggest_url": "https://suggest.yandex.ua/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ua/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.ua/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index efaa4b294..7f25a36e8 100644
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -29,6 +29,7 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
+ &yandex_com,
&google,
&bing,
&yahoo,
@@ -156,8 +157,8 @@ const PrepopulatedEngine* const engines_BR[] = {
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &google,
&yandex_by,
+ &google,
&mail_ru,
&bing,
&duckduckgo,
@@ -435,10 +436,10 @@ const PrepopulatedEngine* const engines_IN[] = {
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
+ &yandex_tr,
&google,
&bing,
&yahoo,
- &yandex_tr,
&petal_search,
};
@@ -525,8 +526,8 @@ const PrepopulatedEngine* const engines_KW[] = {
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &google,
&yandex_kz,
+ &google,
&mail_ru,
&bing,
&duckduckgo,
@@ -894,8 +895,8 @@ const PrepopulatedEngine* const engines_TN[] = {
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &google,
&yandex_tr,
+ &google,
&yahoo_tr,
&bing,
&duckduckgo,
@@ -1388,12 +1389,15 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
t_urls = GetPrepopulationSetFromCountryID(
country_codes::GetCountryIDFromPrefs(prefs));
}
- if (default_search_provider_index) {
- const auto itr =
- base::ranges::find(t_urls, yandex_ru.id, &TemplateURLData::prepopulate_id);
- *default_search_provider_index =
- itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr);
- }
+ /* Making yandex_ru be the first in "const PrepopulatedEngine* const engines_RU[]"
+ * makes it be the first item in chrome://settings/search,
+ * but Google is still chosen by default.
+ * Removed code calculated the distance between 0 and Google's position
+ * and assign that position to default_search_provider_index,
+ * so that Google still was the default search engine.
+ * Instead, just use the first search engine as the default one.
+ */
+ if (default_search_provider_index) *default_search_provider_index = 0;
return t_urls;
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="272px" height="92px" viewBox="0 0 272 92" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 259.328125 80.109375 C 264.664062 80.109375 268.441406 78.980469 271.257812 76.550781 L 271.257812 65.527344 C 268.367188 67.871094 264.886719 69.347656 259.992188 69.347656 C 251.765625 69.347656 248.359375 61.882812 248.359375 50.078125 C 248.359375 37.667969 252.507812 31.332031 260.066406 31.332031 C 264.515625 31.332031 268.886719 33.15625 271.183594 34.890625 L 271.183594 23.433594 C 268.738281 21.871094 264.515625 20.742188 258.734375 20.742188 C 243.984375 20.742188 236.351562 33.15625 236.351562 50.511719 C 236.425781 69.519531 243.910156 80.109375 259.328125 80.109375 Z M 187.214844 75.074219 L 187.214844 64.054688 C 183.65625 66.917969 177.578125 69.433594 172.019531 69.433594 C 163.570312 69.433594 160.382812 64.746094 159.863281 55.199219 L 187.730469 55.199219 L 187.730469 48.082031 C 187.730469 28.207031 180.246094 20.742188 168.757812 20.742188 C 154.675781 20.742188 148.007812 33.328125 148.007812 50.601562 C 148.007812 70.476562 156.382812 80.109375 171.054688 80.109375 C 178.394531 80.109375 183.804688 77.765625 187.214844 75.074219 Z M 81.453125 21.785156 L 81.453125 44.351562 L 66.035156 44.351562 L 66.035156 21.785156 L 54.472656 21.785156 L 54.472656 78.980469 L 66.035156 78.980469 L 66.035156 55.113281 L 81.453125 55.113281 L 81.453125 78.980469 L 93.011719 78.980469 L 93.011719 21.785156 Z M 145.117188 68.21875 L 140.003906 68.21875 L 140.003906 21.785156 L 106.355469 21.785156 L 106.355469 26.644531 C 106.355469 40.617188 105.613281 58.671875 101.535156 68.21875 L 97.832031 68.21875 L 97.832031 92 L 108.503906 92 L 108.503906 78.980469 L 134.371094 78.980469 L 134.371094 92 L 145.042969 92 L 145.042969 68.21875 Z M 224.046875 78.980469 L 237.167969 78.980469 L 218.636719 48.167969 L 234.941406 21.785156 L 223.308594 21.785156 L 207 48.167969 L 207 21.785156 L 195.441406 21.785156 L 195.441406 78.980469 L 207 78.980469 L 207 50.859375 Z M 168.460938 31.332031 C 174.167969 31.332031 175.949219 36.886719 175.949219 44.089844 L 175.949219 45.21875 L 159.863281 45.21875 C 160.160156 36.105469 162.976562 31.332031 168.460938 31.332031 Z M 128.441406 68.21875 L 112.136719 68.21875 C 115.320312 59.625 116.210938 44.003906 116.210938 34.109375 L 116.210938 32.375 L 128.441406 32.375 Z M 128.441406 68.21875 "/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(98.823529%,24.705882%,11.372549%);fill-opacity:1;" d="M 44.839844 78.980469 L 33.054688 78.980469 L 33.054688 10.675781 L 27.792969 10.675781 C 18.15625 10.675781 13.117188 16.316406 13.117188 24.734375 C 13.117188 34.28125 16.601562 38.710938 23.789062 44.351562 L 29.71875 49.039062 L 12.671875 78.980469 L 0 78.980469 L 15.339844 52.25 C 6.523438 44.871094 1.554688 37.667969 1.554688 25.515625 C 1.554688 10.328125 10.597656 0 27.71875 0 L 44.765625 0 L 44.765625 78.980469 Z M 44.839844 78.980469 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

@ -0,0 +1,12 @@
diff -up chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent chromium-101.0.4951.41/content/common/user_agent.cc
--- chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent 2022-04-27 20:03:36.913767022 +0000
+++ chromium-101.0.4951.41/content/common/user_agent.cc 2022-04-27 20:04:30.591942420 +0000
@@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() {
#elif BUILDFLAG(IS_MAC)
return "Macintosh; ";
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
- return "X11; "; // strange, but that's what Firefox uses
+ return "X11; Fedora; "; // strange, but that's what Firefox uses
#elif BUILDFLAG(IS_ANDROID)
return "Linux; ";
#elif BUILDFLAG(IS_FUCHSIA)

File diff suppressed because it is too large Load Diff

@ -0,0 +1,134 @@
diff -up chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py
--- chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py.116 2022-07-05 13:31:29.434673638 +0000
+++ chromium-103.0.5060.53/third_party/catapult/third_party/six/six.py 2022-07-05 21:52:01.884578748 +0000
@@ -29,7 +29,7 @@ import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
-__version__ = "1.15.0"
+__version__ = "1.16.0"
# Useful for very coarse version differentiation.
@@ -71,6 +71,11 @@ else:
MAXSIZE = int((1 << 63) - 1)
del X
+if PY34:
+ from importlib.util import spec_from_loader
+else:
+ spec_from_loader = None
+
def _add_doc(func, doc):
"""Add documentation to a function."""
@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
return self
return None
+ def find_spec(self, fullname, path, target=None):
+ if fullname in self.known_modules:
+ return spec_from_loader(fullname, self)
+ return None
+
def __get_module(self, fullname):
try:
return self.known_modules[fullname]
@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object):
return None
get_source = get_code # same as get_code
+ def create_module(self, spec):
+ return self.load_module(spec.name)
+
+ def exec_module(self, module):
+ pass
+
_importer = _SixMetaPathImporter(__name__)
diff -up chromium-103.0.5060.53/third_party/six/src/six.py.116 chromium-103.0.5060.53/third_party/six/src/six.py
--- chromium-103.0.5060.53/third_party/six/src/six.py.116 2022-07-05 13:32:28.916687658 +0000
+++ chromium-103.0.5060.53/third_party/six/src/six.py 2022-07-05 21:59:42.561240407 +0000
@@ -29,7 +29,7 @@ import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
-__version__ = "1.14.0"
+__version__ = "1.16.0"
# Useful for very coarse version differentiation.
@@ -71,6 +71,11 @@ else:
MAXSIZE = int((1 << 63) - 1)
del X
+if PY34:
+ from importlib.util import spec_from_loader
+else:
+ spec_from_loader = None
+
def _add_doc(func, doc):
"""Add documentation to a function."""
@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
return self
return None
+ def find_spec(self, fullname, path, target=None):
+ if fullname in self.known_modules:
+ return spec_from_loader(fullname, self)
+ return None
+
def __get_module(self, fullname):
try:
return self.known_modules[fullname]
@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object):
return None
get_source = get_code # same as get_code
+ def create_module(self, spec):
+ return self.load_module(spec.name)
+
+ def exec_module(self, module):
+ pass
+
_importer = _SixMetaPathImporter(__name__)
@@ -890,12 +906,11 @@ def ensure_binary(s, encoding='utf-8', e
- `str` -> encoded to `bytes`
- `bytes` -> `bytes`
"""
+ if isinstance(s, binary_type):
+ return s
if isinstance(s, text_type):
return s.encode(encoding, errors)
- elif isinstance(s, binary_type):
- return s
- else:
- raise TypeError("not expecting type '%s'" % type(s))
+ raise TypeError("not expecting type '%s'" % type(s))
def ensure_str(s, encoding='utf-8', errors='strict'):
@@ -909,12 +924,15 @@ def ensure_str(s, encoding='utf-8', erro
- `str` -> `str`
- `bytes` -> decoded to `str`
"""
- if not isinstance(s, (text_type, binary_type)):
- raise TypeError("not expecting type '%s'" % type(s))
+ # Optimization: Fast return for the common case.
+ if type(s) is str:
+ return s
if PY2 and isinstance(s, text_type):
- s = s.encode(encoding, errors)
+ return s.encode(encoding, errors)
elif PY3 and isinstance(s, binary_type):
- s = s.decode(encoding, errors)
+ return s.decode(encoding, errors)
+ elif not isinstance(s, (text_type, binary_type)):
+ raise TypeError("not expecting type '%s'" % type(s))
return s

@ -0,0 +1,39 @@
diff -up chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem chromium-105.0.5195.52/build/linux/unbundle/libusb.gn
--- chromium-105.0.5195.52/build/linux/unbundle/libusb.gn.gnsystem 2022-09-01 12:23:27.557313611 +0000
+++ chromium-105.0.5195.52/build/linux/unbundle/libusb.gn 2022-09-01 12:23:27.557313611 +0000
@@ -0,0 +1,24 @@
+# Copyright 2016 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.
+
+import("//build/config/linux/pkg_config.gni")
+import("//build/shim_headers.gni")
+
+pkg_config("system_libusb") {
+ packages = [ "libusb-1.0" ]
+}
+
+shim_headers("libusb_shim") {
+ root_path = "src/libusb"
+ headers = [
+ "libusb.h",
+ ]
+}
+
+source_set("libusb") {
+ deps = [
+ ":libusb_shim",
+ ]
+ public_configs = [ ":system_libusb" ]
+}
diff -up chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py
--- chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py.gnsystem 2022-09-01 12:23:27.558313577 +0000
+++ chromium-105.0.5195.52/build/linux/unbundle/replace_gn_files.py 2022-09-01 12:36:01.870847125 +0000
@@ -52,6 +52,7 @@ REPLACEMENTS = {
'libjpeg': 'third_party/libjpeg.gni',
'libjxl' : 'third_party/libjxl/BUILD.gn',
'libpng': 'third_party/libpng/BUILD.gn',
+ 'libusb': 'third_party/libusb/BUILD.gn',
'libvpx': 'third_party/libvpx/BUILD.gn',
'libwebp': 'third_party/libwebp/BUILD.gn',
'libxml': 'third_party/libxml/BUILD.gn',

@ -0,0 +1,36 @@
diff -up chromium-108.0.5359.124/third_party/wayland/src/src/wayland-shm.c.me chromium-108.0.5359.124/third_party/wayland/src/src/wayland-shm.c
--- chromium-108.0.5359.124/third_party/wayland/src/src/wayland-shm.c.me 2022-12-24 11:08:03.212333476 +0100
+++ chromium-108.0.5359.124/third_party/wayland/src/src/wayland-shm.c 2022-12-24 11:08:18.316606155 +0100
@@ -44,7 +44,7 @@
#include <signal.h>
#include <pthread.h>
#include <errno.h>
-#include <fcntl.h>
+#include <linux/fcntl.h>
#include "wayland-os.h"
#include "wayland-util.h"
diff -up chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc.el7-memfd-include chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc
--- chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc.el7-memfd-include 2022-06-15 10:52:49.553817031 -0400
+++ chromium-102.0.5005.115/v8/src/base/platform/platform-posix.cc 2022-06-15 10:56:15.775173013 -0400
@@ -56,6 +56,7 @@
#if V8_OS_LINUX
#include <sys/prctl.h> // for prctl
+#include <linux/memfd.h> // for MFD_CLOEXEC
#endif
#if defined(V8_OS_FUCHSIA)
diff -up iridium-browser-2022.12.108.1/third_party/wayland/src/cursor/os-compatibility.c.me iridium-browser-2022.12.108.1/third_party/wayland/src/cursor/os-compatibility.c
--- iridium-browser-2022.12.108.1/third_party/wayland/src/cursor/os-compatibility.c.me 2022-12-08 21:59:43.502200984 +0100
+++ iridium-browser-2022.12.108.1/third_party/wayland/src/cursor/os-compatibility.c 2022-12-08 22:13:53.375653343 +0100
@@ -29,7 +29,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include <fcntl.h>
+#include <linux/fcntl.h> // for F_SEAL_SHRINK, F_ADD_SEALS, F_SEAL_SEAL
+#include <linux/memfd.h> // for MFD_CLOEXEC
#include <errno.h>
#include <signal.h>
#include <string.h>

@ -0,0 +1,11 @@
diff -up chromium-108.0.5359.124/third_party/wayland/src/src/scanner.c.me chromium-108.0.5359.124/third_party/wayland/src/src/scanner.c
--- chromium-108.0.5359.124/third_party/wayland/src/src/scanner.c.me 2022-12-27 16:14:22.507496575 +0100
+++ chromium-108.0.5359.124/third_party/wayland/src/src/scanner.c 2022-12-27 16:35:17.617573610 +0100
@@ -26,6 +26,7 @@
*/
#include "wayland-version.h"
+#include "config.h" // HAVE_STRNDUP
#include <stdbool.h>
#include <stdio.h>

@ -0,0 +1,294 @@
diff -up chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc
--- chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc 2023-01-04 21:44:23.098276796 +0100
@@ -74,7 +74,7 @@ void CdmAudioDecoderConfigToAVCodecConte
codec_context->sample_fmt = AV_SAMPLE_FMT_NONE;
}
- codec_context->ch_layout.nb_channels = config.channel_count;
+ codec_context->channels = config.channel_count;
codec_context->sample_rate = config.samples_per_second;
if (config.extra_data) {
@@ -124,8 +124,8 @@ void CopySamples(cdm::AudioFormat cdm_fo
case cdm::kAudioFormatPlanarS16:
case cdm::kAudioFormatPlanarF32: {
const int decoded_size_per_channel =
- decoded_audio_size / av_frame.ch_layout.nb_channels;
- for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) {
+ decoded_audio_size / av_frame.channels;
+ for (int i = 0; i < av_frame.channels; ++i) {
memcpy(output_buffer, av_frame.extended_data[i],
decoded_size_per_channel);
output_buffer += decoded_size_per_channel;
@@ -185,14 +185,13 @@ bool FFmpegCdmAudioDecoder::Initialize(
// Success!
decoding_loop_ = std::make_unique<FFmpegDecodingLoop>(codec_context_.get());
samples_per_second_ = config.samples_per_second;
- bytes_per_frame_ =
- codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8;
+ bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8;
output_timestamp_helper_ =
std::make_unique<AudioTimestampHelper>(config.samples_per_second);
is_initialized_ = true;
// Store initial values to guard against midstream configuration changes.
- channels_ = codec_context_->ch_layout.nb_channels;
+ channels_ = codec_context_->channels;
av_sample_format_ = codec_context_->sample_fmt;
return true;
@@ -292,19 +291,17 @@ cdm::Status FFmpegCdmAudioDecoder::Decod
for (auto& frame : audio_frames) {
int decoded_audio_size = 0;
if (frame->sample_rate != samples_per_second_ ||
- frame->ch_layout.nb_channels != channels_ ||
- frame->format != av_sample_format_) {
+ frame->channels != channels_ || frame->format != av_sample_format_) {
DLOG(ERROR) << "Unsupported midstream configuration change!"
<< " Sample Rate: " << frame->sample_rate << " vs "
- << samples_per_second_
- << ", Channels: " << frame->ch_layout.nb_channels << " vs "
- << channels_ << ", Sample Format: " << frame->format << " vs "
- << av_sample_format_;
+ << samples_per_second_ << ", Channels: " << frame->channels
+ << " vs " << channels_ << ", Sample Format: " << frame->format
+ << " vs " << av_sample_format_;
return cdm::kDecodeError;
}
decoded_audio_size = av_samples_get_buffer_size(
- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples,
+ nullptr, codec_context_->channels, frame->nb_samples,
codec_context_->sample_fmt, 1);
if (!decoded_audio_size)
continue;
@@ -323,9 +320,9 @@ bool FFmpegCdmAudioDecoder::OnNewFrame(
size_t* total_size,
std::vector<std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame>>* audio_frames,
AVFrame* frame) {
- *total_size += av_samples_get_buffer_size(
- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples,
- codec_context_->sample_fmt, 1);
+ *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels,
+ frame->nb_samples,
+ codec_context_->sample_fmt, 1);
audio_frames->emplace_back(av_frame_clone(frame));
return true;
}
diff -up chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc
--- chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc 2023-01-04 21:52:59.674165082 +0100
@@ -353,11 +353,9 @@ bool AVCodecContextToAudioDecoderConfig(
codec_context->sample_fmt, codec_context->codec_id);
ChannelLayout channel_layout =
- codec_context->ch_layout.nb_channels > 8
+ codec_context->channels > 8
? CHANNEL_LAYOUT_DISCRETE
- : ChannelLayoutToChromeChannelLayout(
- codec_context->ch_layout.u.mask,
- codec_context->ch_layout.nb_channels);
+ : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, codec_context->channels);
switch (codec) {
// For AC3/EAC3 we enable only demuxing, but not decoding, so FFmpeg does
@@ -409,7 +407,7 @@ bool AVCodecContextToAudioDecoderConfig(
extra_data, encryption_scheme, seek_preroll,
codec_context->delay);
if (channel_layout == CHANNEL_LAYOUT_DISCRETE)
- config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels);
+ config->SetChannelsForDiscrete(codec_context->channels);
#if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO)
// These are bitstream formats unknown to ffmpeg, so they don't have
@@ -478,7 +476,7 @@ void AudioDecoderConfigToAVCodecContext(
// TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses
// said information to decode.
- codec_context->ch_layout.nb_channels = config.channels();
+ codec_context->channels = config.channels();
codec_context->sample_rate = config.samples_per_second();
if (config.extra_data().empty()) {
diff -up chromium-108.0.5359.124/media/filters/audio_file_reader.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_file_reader.cc
--- chromium-108.0.5359.124/media/filters/audio_file_reader.cc.revert-new-channel-layout-api 2023-01-04 21:44:23.095276762 +0100
+++ chromium-108.0.5359.124/media/filters/audio_file_reader.cc 2023-01-04 21:44:23.098276796 +0100
@@ -113,15 +113,14 @@ bool AudioFileReader::OpenDecoder() {
// Verify the channel layout is supported by Chrome. Acts as a sanity check
// against invalid files. See http://crbug.com/171962
- if (ChannelLayoutToChromeChannelLayout(
- codec_context_->ch_layout.u.mask,
- codec_context_->ch_layout.nb_channels) ==
+ if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout,
+ codec_context_->channels) ==
CHANNEL_LAYOUT_UNSUPPORTED) {
return false;
}
// Store initial values to guard against midstream configuration changes.
- channels_ = codec_context_->ch_layout.nb_channels;
+ channels_ = codec_context_->channels;
audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id);
sample_rate_ = codec_context_->sample_rate;
av_sample_format_ = codec_context_->sample_fmt;
@@ -224,7 +223,7 @@ bool AudioFileReader::OnNewFrame(
if (frames_read < 0)
return false;
- const int channels = frame->ch_layout.nb_channels;
+ const int channels = frame->channels;
if (frame->sample_rate != sample_rate_ || channels != channels_ ||
frame->format != av_sample_format_) {
DLOG(ERROR) << "Unsupported midstream configuration change!"
diff -up chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc
--- chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc 2023-01-04 21:44:23.098276796 +0100
@@ -121,11 +121,11 @@ class AudioFileReaderTest : public testi
EXPECT_FALSE(reader_->Open());
}
- void RunTestFailingDecode(const char* fn, int expect_read = 0) {
+ void RunTestFailingDecode(const char* fn) {
Initialize(fn);
EXPECT_TRUE(reader_->Open());
std::vector<std::unique_ptr<AudioBus>> decoded_audio_packets;
- EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read);
+ EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0);
}
void RunTestPartialDecode(const char* fn) {
@@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) {
}
TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) {
- RunTestFailingDecode("midstream_config_change.mp3", 42624);
+ RunTestFailingDecode("midstream_config_change.mp3");
}
#endif
diff -up chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc
--- chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc 2023-01-04 21:44:23.098276796 +0100
@@ -113,15 +113,6 @@ bool AudioVideoMetadataExtractor::Extrac
if (!stream)
continue;
- void* display_matrix =
- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr);
- if (display_matrix) {
- rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
- static_cast<int32_t*>(display_matrix))
- .rotation;
- info.tags["rotate"] = base::NumberToString(rotation_);
- }
-
// Extract dictionary from streams also. Needed for containers that attach
// metadata to contained streams instead the container itself, like OGG.
ExtractDictionary(stream->metadata, &info.tags);
@@ -264,6 +255,8 @@ void AudioVideoMetadataExtractor::Extrac
if (raw_tags->find(tag->key) == raw_tags->end())
(*raw_tags)[tag->key] = tag->value;
+ if (ExtractInt(tag, "rotate", &rotation_))
+ continue;
if (ExtractString(tag, "album", &album_))
continue;
if (ExtractString(tag, "artist", &artist_))
diff -up chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc
--- chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc 2023-01-04 21:44:23.099276807 +0100
@@ -195,15 +195,14 @@ bool FFmpegAACBitstreamConverter::Conver
if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id ||
audio_profile_ != stream_codec_parameters_->profile ||
sample_rate_index_ != sample_rate_index ||
- channel_configuration_ !=
- stream_codec_parameters_->ch_layout.nb_channels ||
+ channel_configuration_ != stream_codec_parameters_->channels ||
frame_length_ != header_plus_packet_size) {
header_generated_ =
GenerateAdtsHeader(stream_codec_parameters_->codec_id,
0, // layer
stream_codec_parameters_->profile, sample_rate_index,
0, // private stream
- stream_codec_parameters_->ch_layout.nb_channels,
+ stream_codec_parameters_->channels,
0, // originality
0, // home
0, // copyrighted_stream
@@ -215,7 +214,7 @@ bool FFmpegAACBitstreamConverter::Conver
codec_ = stream_codec_parameters_->codec_id;
audio_profile_ = stream_codec_parameters_->profile;
sample_rate_index_ = sample_rate_index;
- channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels;
+ channel_configuration_ = stream_codec_parameters_->channels;
frame_length_ = header_plus_packet_size;
}
diff -up chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc
--- chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc 2023-01-04 21:44:23.099276807 +0100
@@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest :
memset(&test_parameters_, 0, sizeof(AVCodecParameters));
test_parameters_.codec_id = AV_CODEC_ID_AAC;
test_parameters_.profile = FF_PROFILE_AAC_MAIN;
- test_parameters_.ch_layout.nb_channels = 2;
+ test_parameters_.channels = 2;
test_parameters_.extradata = extradata_header_;
test_parameters_.extradata_size = sizeof(extradata_header_);
}
diff -up chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc
--- chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100
+++ chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc 2023-01-04 21:44:23.099276807 +0100
@@ -28,7 +28,7 @@ namespace media {
// Return the number of channels from the data in |frame|.
static inline int DetermineChannels(AVFrame* frame) {
- return frame->ch_layout.nb_channels;
+ return frame->channels;
}
// Called by FFmpeg's allocation routine to allocate a buffer. Uses
@@ -233,7 +233,7 @@ bool FFmpegAudioDecoder::OnNewFrame(cons
// Translate unsupported into discrete layouts for discrete configurations;
// ffmpeg does not have a labeled discrete configuration internally.
ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout(
- codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels);
+ codec_context_->channel_layout, codec_context_->channels);
if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED &&
config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) {
channel_layout = CHANNEL_LAYOUT_DISCRETE;
@@ -350,11 +350,11 @@ bool FFmpegAudioDecoder::ConfigureDecode
// Success!
av_sample_format_ = codec_context_->sample_fmt;
- if (codec_context_->ch_layout.nb_channels != config.channels()) {
+ if (codec_context_->channels != config.channels()) {
MEDIA_LOG(ERROR, media_log_)
<< "Audio configuration specified " << config.channels()
<< " channels, but FFmpeg thinks the file contains "
- << codec_context_->ch_layout.nb_channels << " channels";
+ << codec_context_->channels << " channels";
ReleaseFFmpegResources();
state_ = DecoderState::kUninitialized;
return false;
@@ -405,7 +405,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(s
if (frame->nb_samples <= 0)
return AVERROR(EINVAL);
- if (s->ch_layout.nb_channels != channels) {
+ if (s->channels != channels) {
DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count.";
return AVERROR(EINVAL);
}
@@ -438,8 +438,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(s
ChannelLayout channel_layout =
config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE
? CHANNEL_LAYOUT_DISCRETE
- : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask,
- s->ch_layout.nb_channels);
+ : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels);
if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
DLOG(ERROR) << "Unsupported channel layout.";

@ -15,9 +15,8 @@ diff -up chromium-108.0.5359.124/chrome/common/chrome_paths.cc.widevine-other-lo
+ cur = base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm")); + cur = base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm"));
+ break; + break;
+ } + }
if (!GetComponentDirectory(&cur)) { if (!GetComponentDirectory(&cur))
return false; return false;
}
cur = cur.AppendASCII(kWidevineCdmBaseDirectory); cur = cur.AppendASCII(kWidevineCdmBaseDirectory);
diff -up chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn diff -up chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn
--- chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations 2023-01-02 11:10:45.953114153 +0100 --- chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations 2023-01-02 11:10:45.953114153 +0100

@ -0,0 +1,64 @@
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2023-01-08 15:48:08.654793086 +0100
@@ -27,8 +27,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/unzip.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2023-01-08 15:48:08.655793097 +0100
@@ -26,8 +26,8 @@ limitations under the License.
#include "tensorflow_lite_support/cc/port/statusor.h"
#include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h"
#include "tensorflow_lite_support/metadata/metadata_schema_generated.h"
-#include "third_party/zlib/contrib/minizip/ioapi.h"
-#include "third_party/zlib/contrib/minizip/unzip.h"
+#include <minizip/ioapi.h>
+#include <minizip/zip.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2023-01-08 15:48:08.655793097 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2023-01-08 15:53:17.498329640 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2023-01-08 15:48:08.655793097 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {
diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
--- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2023-01-04 20:20:37.000000000 +0100
+++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2023-01-08 15:48:08.655793097 +0100
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include <minizip/ioapi.h>
namespace tflite {
namespace metadata {

@ -0,0 +1,141 @@
diff -up chromium-110.0.5481.77/sandbox/policy/linux/bpf_hardware_video_decoding_policy_linux.cc.me chromium-110.0.5481.77/sandbox/policy/linux/bpf_hardware_video_decoding_policy_linux.cc
--- chromium-110.0.5481.77/sandbox/policy/linux/bpf_hardware_video_decoding_policy_linux.cc.me 2023-02-08 20:34:02.700010846 +0100
+++ chromium-110.0.5481.77/sandbox/policy/linux/bpf_hardware_video_decoding_policy_linux.cc 2023-02-08 20:35:30.455580670 +0100
@@ -4,7 +4,9 @@
#include "sandbox/policy/linux/bpf_hardware_video_decoding_policy_linux.h"
-#include <linux/kcmp.h>
+#ifndef KCMP_FILE
+#define KCMP_FILE 0
+#endif
#include "media/gpu/buildflags.h"
#include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
diff -up chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/mojo/core/channel_linux.cc
--- chromium-99.0.4844.51/mojo/core/channel_linux.cc.epel7-header-workarounds 2022-02-28 19:05:54.000000000 -0500
+++ chromium-99.0.4844.51/mojo/core/channel_linux.cc 2022-03-05 14:50:49.876812909 -0500
@@ -44,6 +44,25 @@
#include "base/android/build_info.h"
#endif
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#ifndef F_SEAL_SEAL
+#define F_SEAL_SEAL 0x0001
+#endif
+#ifndef F_SEAL_SHRINK
+#define F_SEAL_SHRINK 0x0002
+#endif
+#ifndef F_SEAL_GROW
+#define F_SEAL_GROW 0x0004
+#endif
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#endif
+#ifndef F_GET_SEALS
+#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
+#endif
+
#ifndef EFD_ZERO_ON_WAKE
#define EFD_ZERO_ON_WAKE O_NOFOLLOW
#endif
diff -up chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
--- chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.epel7-header-workarounds 2022-03-05 14:50:49.877812915 -0500
+++ chromium-99.0.4844.51/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2022-03-05 15:15:02.536867009 -0500
@@ -53,6 +53,25 @@
#endif // BUILDFLAG(IS_ANDROID)
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#ifndef F_SEAL_SEAL
+#define F_SEAL_SEAL 0x0001
+#endif
+#ifndef F_SEAL_SHRINK
+#define F_SEAL_SHRINK 0x0002
+#endif
+#ifndef F_SEAL_GROW
+#define F_SEAL_GROW 0x0004
+#endif
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#endif
+#ifndef F_GET_SEALS
+#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
+#endif
+
#if defined(__arm__) && !defined(MAP_STACK)
#define MAP_STACK 0x20000 // Daisy build environment has old headers.
#endif
diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500
+++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500
@@ -6,7 +6,24 @@
#include <errno.h>
#include <fcntl.h>
-#include <linux/kcmp.h>
+#ifndef KCMP_FILE
+#define KCMP_FILE 0
+#endif
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#ifndef F_SEAL_SEAL
+#define F_SEAL_SEAL 0x0001
+#endif
+#ifndef F_SEAL_SHRINK
+#define F_SEAL_SHRINK 0x0002
+#endif
+#ifndef F_SEAL_GROW
+#define F_SEAL_GROW 0x0004
+#endif
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#endif
#include <sys/socket.h>
// Some arch's (arm64 for instance) unistd.h don't pull in symbols used here
diff -up chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc
--- chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc.epel7-header-workarounds 2022-02-28 19:05:55.000000000 -0500
+++ chromium-99.0.4844.51/sandbox/policy/linux/bpf_gpu_policy_linux.cc 2022-03-05 14:50:49.877812915 -0500
@@ -22,6 +22,22 @@
#include "sandbox/policy/linux/sandbox_linux.h"
#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#ifndef F_SEAL_SEAL
+#define F_SEAL_SEAL 0x0001
+#endif
+#ifndef F_SEAL_SHRINK
+#define F_SEAL_SHRINK 0x0002
+#endif
+#ifndef F_SEAL_GROW
+#define F_SEAL_GROW 0x0004
+#endif
+#ifndef F_ADD_SEALS
+#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
+#endif
+
using sandbox::bpf_dsl::AllOf;
using sandbox::bpf_dsl::Allow;
using sandbox::bpf_dsl::Arg;
diff -up chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc
--- chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc.epel7-header-workarounds 2022-02-28 19:06:49.000000000 -0500
+++ chromium-99.0.4844.51/ui/events/ozone/evdev/event_converter_evdev_impl.cc 2022-03-05 14:50:49.877812915 -0500
@@ -23,6 +23,10 @@
#include "ui/events/ozone/evdev/numberpad_metrics.h"
#endif
+#ifndef SW_PEN_INSERTED
+#define SW_PEN_INSERTED 0x0f /* set = pen inserted */
+#endif
+
namespace ui {
namespace {

@ -0,0 +1,11 @@
diff -up chromium-110.0.5481.177/base/memory/ref_counted.h.me chromium-110.0.5481.177/base/memory/ref_counted.h
--- chromium-110.0.5481.177/base/memory/ref_counted.h.me 2023-02-23 13:34:33.174817255 -0500
+++ chromium-110.0.5481.177/base/memory/ref_counted.h 2023-02-23 13:42:28.646052469 -0500
@@ -6,6 +6,7 @@
#define BASE_MEMORY_REF_COUNTED_H_
#include <stddef.h>
+#include <limits>
#include <utility>

@ -0,0 +1,120 @@
From 2aef9000a1c8d76d3072365ffcb471ebffa20d3d Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@cryptomilk.org>
Date: Tue, 15 Mar 2022 14:26:16 +0100
Subject: [PATCH] Track first_dts instead of using non-upstream functions
The function av_stream_get_first_dts() is not an upstream ffmpeg function and
is not available if you build with system ffmpeg. We can easily track the
first_dts on our own.
See also
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285401.html
Bug: 1306560
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Change-Id: I90ba3cf2f2e16f56a0b405f26c67f911349fb71d
---
media/filters/ffmpeg_demuxer.cc | 18 ++++++++++++------
media/filters/ffmpeg_demuxer.h | 3 +++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 111899b661..799fc6e941 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -97,7 +97,7 @@ static base::TimeDelta FramesToTimeDelta(int frames, double sample_rate) {
sample_rate);
}
-static base::TimeDelta ExtractStartTime(AVStream* stream) {
+static base::TimeDelta ExtractStartTime(AVStream* stream, int64_t first_dts) {
// The default start time is zero.
base::TimeDelta start_time;
@@ -107,12 +107,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
// Next try to use the first DTS value, for codecs where we know PTS == DTS
// (excludes all H26x codecs). The start time must be returned in PTS.
- if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
+ if (first_dts != AV_NOPTS_VALUE &&
stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
const base::TimeDelta first_pts =
- ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
+ ConvertFromTimeBase(stream->time_base, first_dts);
if (first_pts < start_time)
start_time = first_pts;
}
@@ -283,6 +283,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
fixup_negative_timestamps_(false),
fixup_chained_ogg_(false),
num_discarded_packet_warnings_(0),
+ first_dts_(AV_NOPTS_VALUE),
last_packet_pos_(AV_NOPTS_VALUE),
last_packet_dts_(AV_NOPTS_VALUE) {
DCHECK(demuxer_);
@@ -349,6 +350,10 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
int64_t packet_dts =
packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts;
+ if (first_dts_ == AV_NOPTS_VALUE) {
+ first_dts_ = packet_dts;
+ }
+
// Chained ogg files have non-monotonically increasing position and time stamp
// values, which prevents us from using them to determine if a packet should
// be dropped. Since chained ogg is only allowed on single track audio only
@@ -1442,7 +1447,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(int result) {
max_duration = std::max(max_duration, streams_[i]->duration());
- base::TimeDelta start_time = ExtractStartTime(stream);
+ base::TimeDelta start_time =
+ ExtractStartTime(stream, streams_[i]->first_dts());
// Note: This value is used for seeking, so we must take the true value and
// not the one possibly clamped to zero below.
@@ -1599,7 +1605,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindStreamWithLowestStartTimestamp(
for (const auto& stream : streams_) {
if (!stream || stream->IsEnabled() != enabled)
continue;
- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
+ if (stream->first_dts() == AV_NOPTS_VALUE)
continue;
if (!lowest_start_time_stream ||
stream->start_time() < lowest_start_time_stream->start_time()) {
@@ -1620,7 +1626,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::FindPreferredStreamForSeeking(
if (stream->type() != DemuxerStream::VIDEO)
continue;
- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker)
+ if (stream->first_dts() == AV_NOPTS_VALUE)
continue;
if (!stream->IsEnabled())
diff --git a/media/filters/ffmpeg_demuxer.h b/media/filters/ffmpeg_demuxer.h
index c147309d6f..48a8f6ad8c 100644
--- a/media/filters/ffmpeg_demuxer.h
+++ b/media/filters/ffmpeg_demuxer.h
@@ -151,6 +151,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
base::TimeDelta start_time() const { return start_time_; }
void set_start_time(base::TimeDelta time) { start_time_ = time; }
+ int64_t first_dts() const { return first_dts_; }
+
private:
friend class FFmpegDemuxerTest;
@@ -208,6 +210,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream : public DemuxerStream {
bool fixup_chained_ogg_;
int num_discarded_packet_warnings_;
+ int64_t first_dts_;
int64_t last_packet_pos_;
int64_t last_packet_dts_;
};
--
2.35.1

@ -0,0 +1,12 @@
diff -up chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc
--- chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-04-07 13:54:52.562292026 +0200
+++ chromium-113.0.5672.24/chrome/browser/media/router/media_router_feature.cc 2023-04-07 13:57:41.470414086 +0200
@@ -68,7 +68,7 @@ BASE_FEATURE(kGlobalMediaControlsCastSta
#else
BASE_FEATURE(kGlobalMediaControlsCastStartStop,
"GlobalMediaControlsCastStartStop",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_CHROMEOS)
#endif // BUILDFLAG(IS_ANDROID)

@ -0,0 +1,12 @@
diff -up chromium-113.0.5672.24/components/os_crypt/sync/features.gni.disblegnomekeyring chromium-113.0.5672.24/components/os_crypt/sync/features.gni
--- chromium-113.0.5672.24/components/os_crypt/sync/features.gni.disblegnomekeyring 2023-04-07 14:23:11.083985460 +0200
+++ chromium-113.0.5672.24/components/os_crypt/sync/features.gni 2023-04-07 14:23:44.276599353 +0200
@@ -8,7 +8,7 @@ import("//build/config/ui.gni")
declare_args() {
# Whether to use libgnome-keyring (deprecated by libsecret).
# See http://crbug.com/466975 and http://crbug.com/355223.
- use_gnome_keyring = is_linux && use_glib
+ use_gnome_keyring = false
# Whether to make account and service names for the crypto key storage
# configurable at runtime for embedders.

@ -0,0 +1,21 @@
diff --git a/ui/qt/qt_ui.cc b/ui/qt/qt_ui.cc
index bac5245a..a97fa8b 100644
--- a/ui/qt/qt_ui.cc
+++ b/ui/qt/qt_ui.cc
@@ -422,12 +422,14 @@
auto desc = shim_->GetFontDescription();
font_family_ = desc.family.c_str();
+ // Points are defined at 72 DPI and pixels are 96 DPI by default.
+ constexpr double kPointToPixelRatio = 96.0 / 72.0;
if (desc.size_pixels > 0) {
font_size_pixels_ = desc.size_pixels;
- font_size_points_ = font_size_pixels_ / GetDeviceScaleFactor();
+ font_size_points_ = std::round(font_size_pixels_ / kPointToPixelRatio);
} else {
font_size_points_ = desc.size_points;
- font_size_pixels_ = font_size_points_ * GetDeviceScaleFactor();
+ font_size_pixels_ = std::round(font_size_points_ * kPointToPixelRatio);
}
font_style_ = desc.is_italic ? gfx::Font::ITALIC : gfx::Font::NORMAL;
font_weight_ = QtWeightToCssWeight(desc.weight);

@ -0,0 +1,574 @@
commit c51d6447fd0d124903d16bf5952efccbf9e1ca92
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Wed May 24 22:53:20 2023 +0000
[Qt] Handle scale factor changes
This is a speculative fix for https://crbug.com/1439149. I suspect
the scale factor is not set immediately on QT initialization, but
is set asynchronously shortly after. This CL adds a listener for
QT scale changes.
R=thestig
Low-Coverage-Reason: No QT tests currently
Change-Id: I7dea23e16a6bb26237564af2dc4e43480f6aea9f
Bug: 1439149
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4559732
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1148805}
diff --git a/ui/qt/qt5_shim_moc.cc b/ui/qt/qt5_shim_moc.cc
index 8f8b6b57784a8..6e504f23c603a 100644
--- a/ui/qt/qt5_shim_moc.cc
+++ b/ui/qt/qt5_shim_moc.cc
@@ -23,8 +23,8 @@
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_qt__QtShim_t {
- QByteArrayData data[6];
- char stringdata[52];
+ QByteArrayData data[13];
+ char stringdata[151];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET( \
@@ -33,9 +33,16 @@ struct qt_meta_stringdata_qt__QtShim_t {
static const qt_meta_stringdata_qt__QtShim_t qt_meta_stringdata_qt__QtShim = {
{QT_MOC_LITERAL(0, 0, 10), QT_MOC_LITERAL(1, 11, 11),
QT_MOC_LITERAL(2, 23, 0), QT_MOC_LITERAL(3, 24, 4),
- QT_MOC_LITERAL(4, 29, 14), QT_MOC_LITERAL(5, 44, 7)},
+ QT_MOC_LITERAL(4, 29, 14), QT_MOC_LITERAL(5, 44, 7),
+ QT_MOC_LITERAL(6, 52, 11), QT_MOC_LITERAL(7, 64, 8),
+ QT_MOC_LITERAL(8, 73, 6), QT_MOC_LITERAL(9, 80, 13),
+ QT_MOC_LITERAL(10, 94, 25), QT_MOC_LITERAL(11, 120, 3),
+ QT_MOC_LITERAL(12, 124, 26)},
"qt::QtShim\0FontChanged\0\0font\0"
- "PaletteChanged\0palette"};
+ "PaletteChanged\0palette\0ScreenAdded\0"
+ "QScreen*\0screen\0ScreenRemoved\0"
+ "LogicalDotsPerInchChanged\0dpi\0"
+ "PhysicalDotsPerInchChanged"};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_qt__QtShim[] = {
@@ -44,7 +51,7 @@ static const uint qt_meta_data_qt__QtShim[] = {
7, // revision
0, // classname
0, 0, // classinfo
- 2, 14, // methods
+ 6, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -52,11 +59,15 @@ static const uint qt_meta_data_qt__QtShim[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags
- 1, 1, 24, 2, 0x08 /* Private */, 4, 1, 27, 2, 0x08 /* Private */,
+ 1, 1, 44, 2, 0x08 /* Private */, 4, 1, 47, 2, 0x08 /* Private */, 6, 1, 50,
+ 2, 0x08 /* Private */, 9, 1, 53, 2, 0x08 /* Private */, 10, 1, 56, 2,
+ 0x08 /* Private */, 12, 1, 59, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void, QMetaType::QFont, 3, QMetaType::Void, QMetaType::QPalette,
- 5,
+ 5, QMetaType::Void, 0x80000000 | 7, 8, QMetaType::Void, 0x80000000 | 7, 8,
+ QMetaType::Void, QMetaType::QReal, 11, QMetaType::Void, QMetaType::QReal,
+ 11,
0 // eod
};
@@ -74,6 +85,18 @@ void qt::QtShim::qt_static_metacall(QObject* _o,
case 1:
_t->PaletteChanged((*reinterpret_cast<const QPalette(*)>(_a[1])));
break;
+ case 2:
+ _t->ScreenAdded((*reinterpret_cast<QScreen*(*)>(_a[1])));
+ break;
+ case 3:
+ _t->ScreenRemoved((*reinterpret_cast<QScreen*(*)>(_a[1])));
+ break;
+ case 4:
+ _t->LogicalDotsPerInchChanged((*reinterpret_cast<qreal(*)>(_a[1])));
+ break;
+ case 5:
+ _t->PhysicalDotsPerInchChanged((*reinterpret_cast<qreal(*)>(_a[1])));
+ break;
default:;
}
}
@@ -107,15 +130,15 @@ int qt::QtShim::qt_metacall(QMetaObject::Call _c, int _id, void** _a) {
return _id;
}
if (_c == QMetaObject::InvokeMetaMethod) {
- if (_id < 2) {
+ if (_id < 6) {
qt_static_metacall(this, _c, _id, _a);
}
- _id -= 2;
+ _id -= 6;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
- if (_id < 2) {
+ if (_id < 6) {
*reinterpret_cast<int*>(_a[0]) = -1;
}
- _id -= 2;
+ _id -= 6;
}
return _id;
}
diff --git a/ui/qt/qt6_shim_moc.cc b/ui/qt/qt6_shim_moc.cc
index 6d02ca317b65d..a16515008d892 100644
--- a/ui/qt/qt6_shim_moc.cc
+++ b/ui/qt/qt6_shim_moc.cc
@@ -26,8 +26,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_qt__QtShim_t {
- const uint offsetsAndSize[12];
- char stringdata0[52];
+ const uint offsetsAndSize[26];
+ char stringdata0[151];
};
#define QT_MOC_LITERAL(ofs, len) \
uint(offsetof(qt_meta_stringdata_qt__QtShim_t, stringdata0) + ofs), len
@@ -38,11 +38,21 @@ static const qt_meta_stringdata_qt__QtShim_t qt_meta_stringdata_qt__QtShim = {
QT_MOC_LITERAL(23, 0), // ""
QT_MOC_LITERAL(24, 4), // "font"
QT_MOC_LITERAL(29, 14), // "PaletteChanged"
- QT_MOC_LITERAL(44, 7) // "palette"
+ QT_MOC_LITERAL(44, 7), // "palette"
+ QT_MOC_LITERAL(52, 11), // "ScreenAdded"
+ QT_MOC_LITERAL(64, 8), // "QScreen*"
+ QT_MOC_LITERAL(73, 6), // "screen"
+ QT_MOC_LITERAL(80, 13), // "ScreenRemoved"
+ QT_MOC_LITERAL(94, 25), // "LogicalDotsPerInchChanged"
+ QT_MOC_LITERAL(120, 3), // "dpi"
+ QT_MOC_LITERAL(124, 26) // "PhysicalDotsPerInchChanged"
},
"qt::QtShim\0FontChanged\0\0font\0"
- "PaletteChanged\0palette"};
+ "PaletteChanged\0palette\0ScreenAdded\0"
+ "QScreen*\0screen\0ScreenRemoved\0"
+ "LogicalDotsPerInchChanged\0dpi\0"
+ "PhysicalDotsPerInchChanged"};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_qt__QtShim[] = {
@@ -51,7 +61,7 @@ static const uint qt_meta_data_qt__QtShim[] = {
10, // revision
0, // classname
0, 0, // classinfo
- 2, 14, // methods
+ 6, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -59,11 +69,15 @@ static const uint qt_meta_data_qt__QtShim[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags, initial metatype offsets
- 1, 1, 26, 2, 0x08, 1 /* Private */, 4, 1, 29, 2, 0x08, 3 /* Private */,
+ 1, 1, 50, 2, 0x08, 1 /* Private */, 4, 1, 53, 2, 0x08, 3 /* Private */, 6,
+ 1, 56, 2, 0x08, 5 /* Private */, 9, 1, 59, 2, 0x08, 7 /* Private */, 10, 1,
+ 62, 2, 0x08, 9 /* Private */, 12, 1, 65, 2, 0x08, 11 /* Private */,
// slots: parameters
QMetaType::Void, QMetaType::QFont, 3, QMetaType::Void, QMetaType::QPalette,
- 5,
+ 5, QMetaType::Void, 0x80000000 | 7, 8, QMetaType::Void, 0x80000000 | 7, 8,
+ QMetaType::Void, QMetaType::QReal, 11, QMetaType::Void, QMetaType::QReal,
+ 11,
0 // eod
};
@@ -83,6 +97,22 @@ void qt::QtShim::qt_static_metacall(QObject* _o,
_t->PaletteChanged(
(*reinterpret_cast<std::add_pointer_t<QPalette>>(_a[1])));
break;
+ case 2:
+ _t->ScreenAdded(
+ (*reinterpret_cast<std::add_pointer_t<QScreen*>>(_a[1])));
+ break;
+ case 3:
+ _t->ScreenRemoved(
+ (*reinterpret_cast<std::add_pointer_t<QScreen*>>(_a[1])));
+ break;
+ case 4:
+ _t->LogicalDotsPerInchChanged(
+ (*reinterpret_cast<std::add_pointer_t<qreal>>(_a[1])));
+ break;
+ case 5:
+ _t->PhysicalDotsPerInchChanged(
+ (*reinterpret_cast<std::add_pointer_t<qreal>>(_a[1])));
+ break;
default:;
}
}
@@ -98,7 +128,15 @@ const QMetaObject qt::QtShim::staticMetaObject = {
QtPrivate::TypeAndForceComplete<void, std::false_type>,
QtPrivate::TypeAndForceComplete<const QFont&, std::false_type>,
QtPrivate::TypeAndForceComplete<void, std::false_type>,
- QtPrivate::TypeAndForceComplete<const QPalette&, std::false_type>
+ QtPrivate::TypeAndForceComplete<const QPalette&, std::false_type>,
+ QtPrivate::TypeAndForceComplete<void, std::false_type>,
+ QtPrivate::TypeAndForceComplete<QScreen*, std::false_type>,
+ QtPrivate::TypeAndForceComplete<void, std::false_type>,
+ QtPrivate::TypeAndForceComplete<QScreen*, std::false_type>,
+ QtPrivate::TypeAndForceComplete<void, std::false_type>,
+ QtPrivate::TypeAndForceComplete<qreal, std::false_type>,
+ QtPrivate::TypeAndForceComplete<void, std::false_type>,
+ QtPrivate::TypeAndForceComplete<qreal, std::false_type>
>,
nullptr}};
@@ -127,15 +165,15 @@ int qt::QtShim::qt_metacall(QMetaObject::Call _c, int _id, void** _a) {
return _id;
}
if (_c == QMetaObject::InvokeMetaMethod) {
- if (_id < 2) {
+ if (_id < 6) {
qt_static_metacall(this, _c, _id, _a);
}
- _id -= 2;
+ _id -= 6;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
- if (_id < 2) {
+ if (_id < 6) {
*reinterpret_cast<QMetaType*>(_a[0]) = QMetaType();
}
- _id -= 2;
+ _id -= 6;
}
return _id;
}
diff --git a/ui/qt/qt_interface.h b/ui/qt/qt_interface.h
index 6a362bc66c0e3..28dfc6603544f 100644
--- a/ui/qt/qt_interface.h
+++ b/ui/qt/qt_interface.h
@@ -118,6 +118,7 @@ class QtInterface {
virtual void FontChanged() = 0;
virtual void ThemeChanged() = 0;
+ virtual void ScaleFactorMaybeChanged() = 0;
};
QtInterface() = default;
diff --git a/ui/qt/qt_shim.cc b/ui/qt/qt_shim.cc
index 74d34ad196f18..0aec9c3aed4ad 100644
--- a/ui/qt/qt_shim.cc
+++ b/ui/qt/qt_shim.cc
@@ -16,6 +16,7 @@
#include <QMimeType>
#include <QPainter>
#include <QPalette>
+#include <QScreen>
#include <QStyle>
#include <QStyleOptionTitleBar>
@@ -52,8 +53,9 @@ FontHinting QtHintingToFontHinting(QFont::HintingPreference hinting) {
// Obtain the average color of a gradient.
SkColor GradientColor(const QGradient& gradient) {
QGradientStops stops = gradient.stops();
- if (stops.empty())
+ if (stops.empty()) {
return qRgba(0, 0, 0, 0);
+ }
float a = 0;
float r = 0;
@@ -86,11 +88,13 @@ SkColor GradientColor(const QGradient& gradient) {
// Obtain the average color of a texture.
SkColor TextureColor(QImage image) {
size_t size = image.width() * image.height();
- if (!size)
+ if (!size) {
return qRgba(0, 0, 0, 0);
+ }
- if (image.format() != QImage::Format_ARGB32_Premultiplied)
+ if (image.format() != QImage::Format_ARGB32_Premultiplied) {
image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ }
size_t a = 0;
size_t r = 0;
@@ -203,6 +207,13 @@ QtShim::QtShim(QtInterface::Delegate* delegate, int* argc, char** argv)
SLOT(FontChanged(const QFont&)));
connect(&app_, SIGNAL(paletteChanged(const QPalette&)), this,
SLOT(PaletteChanged(const QPalette&)));
+ connect(&app_, SIGNAL(screenAdded(QScreen*)), this,
+ SLOT(ScreenAdded(QScreen*)));
+ connect(&app_, SIGNAL(screenRemoved(QScreen*)), this,
+ SLOT(ScreenRemoved(QScreen*)));
+ for (QScreen* screen : app_.screens()) {
+ ScreenAdded(screen);
+ }
}
QtShim::~QtShim() = default;
@@ -241,8 +252,9 @@ Image QtShim::GetIconForContentType(const String& content_type,
auto icon = QIcon::fromTheme(name);
auto pixmap = icon.pixmap(size);
auto image = pixmap.toImage();
- if (image.format() != QImage::Format_ARGB32_Premultiplied)
+ if (image.format() != QImage::Format_ARGB32_Premultiplied) {
image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ }
if (auto bytes = image.sizeInBytes()) {
return {image.width(), image.height(),
static_cast<float>(image.devicePixelRatio()),
@@ -283,6 +295,30 @@ void QtShim::PaletteChanged(const QPalette& palette) {
delegate_->ThemeChanged();
}
+DISABLE_CFI_VCALL
+void QtShim::ScreenAdded(QScreen* screen) {
+ connect(screen, SIGNAL(logicalDotsPerInchChanged(qreal)), this,
+ SLOT(LogicalDotsPerInchChanged(qreal)));
+ connect(screen, SIGNAL(physicalDotsPerInchChanged(qreal)), this,
+ SLOT(PhysicalDotsPerInchChanged(qreal)));
+ delegate_->ScaleFactorMaybeChanged();
+}
+
+DISABLE_CFI_VCALL
+void QtShim::ScreenRemoved(QScreen* screen) {
+ delegate_->ScaleFactorMaybeChanged();
+}
+
+DISABLE_CFI_VCALL
+void QtShim::LogicalDotsPerInchChanged(qreal dpi) {
+ delegate_->ScaleFactorMaybeChanged();
+}
+
+DISABLE_CFI_VCALL
+void QtShim::PhysicalDotsPerInchChanged(qreal dpi) {
+ delegate_->ScaleFactorMaybeChanged();
+}
+
Image QtShim::DrawHeader(int width,
int height,
SkColor default_color,
@@ -309,8 +345,9 @@ QImage QtShim::DrawHeaderImpl(int width,
QStyleOptionTitleBar opt;
opt.rect = QRect(-kBorderWidth, -kBorderWidth, width + 2 * kBorderWidth,
height + 2 * kBorderWidth);
- if (state == ColorState::kNormal)
+ if (state == ColorState::kNormal) {
opt.titleBarState = QStyle::State_Active;
+ }
app_.style()->drawComplexControl(QStyle::CC_TitleBar, &opt, &painter,
nullptr);
} else {
diff --git a/ui/qt/qt_shim.h b/ui/qt/qt_shim.h
index 607e6fe22dfc0..d979c47d589d4 100644
--- a/ui/qt/qt_shim.h
+++ b/ui/qt/qt_shim.h
@@ -42,6 +42,10 @@ class QtShim : public QObject, public QtInterface {
private slots:
void FontChanged(const QFont& font);
void PaletteChanged(const QPalette& palette);
+ void ScreenAdded(QScreen* screen);
+ void ScreenRemoved(QScreen* screen);
+ void LogicalDotsPerInchChanged(qreal dpi);
+ void PhysicalDotsPerInchChanged(qreal dpi);
private:
QImage DrawHeaderImpl(int width,
diff --git a/ui/qt/qt_ui.cc b/ui/qt/qt_ui.cc
index 6a3b58e9f930b..bac5245a069f9 100644
--- a/ui/qt/qt_ui.cc
+++ b/ui/qt/qt_ui.cc
@@ -19,6 +19,7 @@
#include "base/nix/xdg_util.h"
#include "base/notreached.h"
#include "base/path_service.h"
+#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "cc/paint/paint_canvas.h"
#include "chrome/browser/themes/theme_properties.h" // nogncheck
@@ -36,6 +37,7 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_skia_source.h"
+#include "ui/linux/device_scale_factor_observer.h"
#include "ui/linux/linux_ui.h"
#include "ui/linux/nav_button_provider.h"
#include "ui/native_theme/native_theme_aura.h"
@@ -194,16 +196,21 @@ void QtUi::GetDefaultFontDescription(std::string* family_out,
int* style_out,
int* weight_out,
gfx::FontRenderParams* params_out) const {
- if (family_out)
+ if (family_out) {
*family_out = font_family_;
- if (size_pixels_out)
+ }
+ if (size_pixels_out) {
*size_pixels_out = font_size_pixels_;
- if (style_out)
+ }
+ if (style_out) {
*style_out = font_style_;
- if (weight_out)
+ }
+ if (weight_out) {
*weight_out = font_weight_;
- if (params_out)
+ }
+ if (params_out) {
*params_out = font_params_;
+ }
}
ui::SelectFileDialog* QtUi::CreateSelectFileDialog(
@@ -236,6 +245,7 @@ bool QtUi::Initialize() {
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
base::BindRepeating(&QtUi::AddNativeColorMixer, base::Unretained(this)));
FontChanged();
+ scale_factor_ = shim_->GetScaleFactor();
return true;
}
@@ -246,8 +256,9 @@ ui::NativeTheme* QtUi::GetNativeTheme() const {
bool QtUi::GetColor(int id, SkColor* color, bool use_custom_frame) const {
auto value = GetColor(id, use_custom_frame);
- if (value)
+ if (value) {
*color = *value;
+ }
return value.has_value();
}
@@ -297,8 +308,9 @@ gfx::Image QtUi::GetIconForContentType(const std::string& content_type,
float scale) const {
Image image =
shim_->GetIconForContentType(String(content_type.c_str()), size * scale);
- if (!image.data_argb.size())
+ if (!image.data_argb.size()) {
return {};
+ }
SkImageInfo image_info = SkImageInfo::Make(
image.width, image.height, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
@@ -345,14 +357,16 @@ bool QtUi::AnimationsEnabled() const {
void QtUi::AddWindowButtonOrderObserver(
ui::WindowButtonOrderObserver* observer) {
- if (fallback_linux_ui_)
+ if (fallback_linux_ui_) {
fallback_linux_ui_->AddWindowButtonOrderObserver(observer);
+ }
}
void QtUi::RemoveWindowButtonOrderObserver(
ui::WindowButtonOrderObserver* observer) {
- if (fallback_linux_ui_)
+ if (fallback_linux_ui_) {
fallback_linux_ui_->RemoveWindowButtonOrderObserver(observer);
+ }
}
std::unique_ptr<ui::NavButtonProvider> QtUi::CreateNavButtonProvider() {
@@ -441,11 +455,24 @@ void QtUi::ThemeChanged() {
native_theme_->ThemeChanged(PreferDarkTheme());
}
+void QtUi::ScaleFactorMaybeChanged() {
+ // This gets called whenever the monitor configuration changes. Handle the
+ // scale change asynchronously to allow the change to propagate to QT's scale
+ // factor. This also coalesces scale change events together.
+ if (!scale_factor_task_active_) {
+ scale_factor_task_active_ = true;
+ base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
+ FROM_HERE, base::BindOnce(&QtUi::ScaleFactorMaybeChangedImpl,
+ weak_factory_.GetWeakPtr()));
+ }
+}
+
DISABLE_CFI_VCALL
void QtUi::AddNativeColorMixer(ui::ColorProvider* provider,
const ui::ColorProviderManager::Key& key) {
- if (key.system_theme != ui::SystemTheme::kQt)
+ if (key.system_theme != ui::SystemTheme::kQt) {
return;
+ }
ui::ColorMixer& mixer = provider->AddMixer();
// These color constants are required by native_chrome_color_mixer_linux.cc
@@ -494,8 +521,9 @@ void QtUi::AddNativeColorMixer(ui::ColorProvider* provider,
ColorState::kInactive},
{ui::kColorNativeToolbarBackground, ColorType::kButtonBg},
};
- for (const auto& map : kMaps)
+ for (const auto& map : kMaps) {
mixer[map.id] = {shim_->GetColor(map.role, map.state)};
+ }
const bool use_custom_frame =
key.frame_type == ui::ColorProviderManager::FrameType::kChromium;
@@ -578,6 +606,20 @@ absl::optional<SkColor> QtUi::GetColor(int id, bool use_custom_frame) const {
}
}
+DISABLE_CFI_VCALL
+void QtUi::ScaleFactorMaybeChangedImpl() {
+ scale_factor_task_active_ = false;
+ double scale = shim_->GetScaleFactor();
+ if (scale == scale_factor_) {
+ return;
+ }
+ scale_factor_ = scale;
+ for (ui::DeviceScaleFactorObserver& observer :
+ device_scale_factor_observer_list()) {
+ observer.OnDeviceScaleFactorChanged();
+ }
+}
+
std::unique_ptr<ui::LinuxUiAndTheme> CreateQtUi(
ui::LinuxUi* fallback_linux_ui) {
return std::make_unique<QtUi>(fallback_linux_ui);
diff --git a/ui/qt/qt_ui.h b/ui/qt/qt_ui.h
index b53ed93240708..3319edf1ea9bc 100644
--- a/ui/qt/qt_ui.h
+++ b/ui/qt/qt_ui.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/component_export.h"
+#include "base/memory/weak_ptr.h"
#include "printing/buildflags/buildflags.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/color/color_provider.h"
@@ -88,11 +89,14 @@ class QtUi : public ui::LinuxUiAndTheme, QtInterface::Delegate {
// QtInterface::Delegate:
void FontChanged() override;
void ThemeChanged() override;
+ void ScaleFactorMaybeChanged() override;
private:
void AddNativeColorMixer(ui::ColorProvider* provider,
const ui::ColorProviderManager::Key& key);
+ void ScaleFactorMaybeChangedImpl();
+
absl::optional<SkColor> GetColor(int id, bool use_custom_frame) const;
// TODO(https://crbug.com/1317782): This is a fallback for any unimplemented
@@ -114,6 +118,11 @@ class QtUi : public ui::LinuxUiAndTheme, QtInterface::Delegate {
std::unique_ptr<QtInterface> shim_;
std::unique_ptr<QtNativeTheme> native_theme_;
+
+ bool scale_factor_task_active_ = false;
+ double scale_factor_ = 1.0;
+
+ base::WeakPtrFactory<QtUi> weak_factory_{this};
};
// This should be the only symbol exported from this component.

@ -0,0 +1,46 @@
commit 7b1d747a599a752e493e34e7bbf841d8b4c7882f
Author: Tomasz Śniatowski <tomasz.sniatowski@xperi.com>
Date: Thu May 25 16:09:27 2023 +0000
Dep on //printing in //ui/qt if printing is enabled
qt_ui.h can use printing/printing_context_linux.h, and needs to dep
on //printing if it does, to avoid a missing dependency build break.
Without this fix, a clean build can fail on obj/ui/qt/qt/qt_ui.o with
In file included from ../../ui/qt/qt_ui.cc:8:
In file included from ../../ui/qt/qt_ui.h:21:
../../printing/printing_context_linux.h:12:10: fatal error:
'printing/mojom/print.mojom.h' file not found
(the #include is a // NOGNCHECK one, which is how this came to be)
Change-Id: I70af37071e232ffbf462a05e026051efae044b69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4566944
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Tomasz Śniatowski <tomasz.sniatowski@xperi.com>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1149138}
diff --git a/ui/qt/BUILD.gn b/ui/qt/BUILD.gn
index 6a67961edc2f7..89fffcf3089f9 100644
--- a/ui/qt/BUILD.gn
+++ b/ui/qt/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/chromecast_build.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/sysroot.gni")
+import("//printing/buildflags/buildflags.gni")
import("//ui/qt/qt.gni")
assert(use_qt)
@@ -127,6 +128,9 @@ component("qt") {
"//ui/views",
]
public_deps = [ "//skia" ]
+ if (enable_printing) {
+ public_deps += [ "//printing" ]
+ }
sources = [
"qt_ui.cc",

@ -0,0 +1,12 @@
diff -up chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc.me chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc
--- chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc.me 2023-06-11 18:47:09.742886578 +0200
+++ chromium-114.0.5735.106/ui/linux/linux_ui_factory.cc 2023-06-11 18:48:42.231584886 +0200
@@ -127,7 +127,7 @@ LinuxUiAndTheme* GetDefaultLinuxUiAndThe
} // namespace
-BASE_FEATURE(kAllowQt, "AllowQt", base::FEATURE_DISABLED_BY_DEFAULT);
+BASE_FEATURE(kAllowQt, "AllowQt", base::FEATURE_ENABLED_BY_DEFAULT);
LinuxUi* GetDefaultLinuxUi() {
auto* linux_ui = GetDefaultLinuxUiAndTheme();

@ -0,0 +1,59 @@
commit ff39a278ddccf61716a7dbcb575415801bbf8ded
Author: Tom Anderson <thomasanderson@chromium.org>
Date: Wed May 31 18:31:09 2023 +0000
[QT] Account for logical scale factor
Previously we were only using the device pixel ratio. But QT UI
scales with both the device pixel ratio and the logical DPI. This CL
sets Chrome's scale factor to be the product of these two.
R=thestig
CC=jkummerow
Change-Id: I9bd414046058e741450fabae4913d47a16ca48c3
Bug: 1439149
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575572
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151380}
diff --git a/ui/qt/qt_shim.cc b/ui/qt/qt_shim.cc
index 0aec9c3aed4ad..3780f8c3988b4 100644
--- a/ui/qt/qt_shim.cc
+++ b/ui/qt/qt_shim.cc
@@ -7,7 +7,7 @@
#include "ui/qt/qt_shim.h"
-#include <stdio.h>
+#include <cmath>
#include <QApplication>
#include <QFont>
@@ -219,7 +219,24 @@ QtShim::QtShim(QtInterface::Delegate* delegate, int* argc, char** argv)
QtShim::~QtShim() = default;
double QtShim::GetScaleFactor() const {
- return app_.devicePixelRatio();
+ constexpr double kDefaultPixelDpi = 96.0;
+ // Use the largest scale factor across all displays as the global scale
+ // factor. This matches the behavior of `app_.devicePixelRatio()`, except
+ // this also takes into account the logical DPI.
+ // TODO(https://crbug.com/1450301): Unlike GTK, QT supports per-display
+ // scaling. Use this instead of the max scale factor.
+ double scale = 0.0;
+ for (QScreen* screen : app_.screens()) {
+ scale =
+ std::max(scale, screen->devicePixelRatio() *
+ screen->logicalDotsPerInch() / kDefaultPixelDpi);
+ }
+ // Round to the nearest 16th so that UI can losslessly multiply and divide
+ // by the scale factor using floating point arithmetic. GtkUi also rounds
+ // in this way, but to 1/64th. 1/16th is chosen here since that's what
+ // KDE settings uses.
+ scale = std::round(scale * 16) / 16;
+ return scale > 0 ? scale : 1.0;
}
FontRenderParams QtShim::GetFontRenderParams() const {

@ -0,0 +1,87 @@
diff -up chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
--- chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me 2023-05-21 10:05:00.357860329 +0200
+++ chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2023-05-21 10:18:09.665432735 +0200
@@ -41,7 +41,6 @@
#include "media/gpu/gpu_video_encode_accelerator_helpers.h"
#include "media/gpu/h264_dpb.h"
#include "media/gpu/macros.h"
-#include "media/gpu/vaapi/av1_vaapi_video_encoder_delegate.h"
#include "media/gpu/vaapi/h264_vaapi_video_encoder_delegate.h"
#include "media/gpu/vaapi/va_surface.h"
#include "media/gpu/vaapi/vaapi_common.h"
@@ -200,7 +199,7 @@ bool VaapiVideoEncodeAccelerator::Initia
const VideoCodec codec = VideoCodecProfileToVideoCodec(config.output_profile);
if (codec != VideoCodec::kH264 && codec != VideoCodec::kVP8 &&
- codec != VideoCodec::kVP9 && codec != VideoCodec::kAV1) {
+ codec != VideoCodec::kVP9) {
MEDIA_LOG(ERROR, media_log.get())
<< "Unsupported profile: " << GetProfileName(config.output_profile);
return false;
@@ -293,7 +292,6 @@ void VaapiVideoEncodeAccelerator::Initia
break;
case VideoCodec::kVP8:
case VideoCodec::kVP9:
- case VideoCodec::kAV1:
mode = VaapiWrapper::kEncodeConstantQuantizationParameter;
break;
default:
@@ -356,12 +354,6 @@ void VaapiVideoEncodeAccelerator::Initia
vaapi_wrapper_, error_cb);
}
break;
- case VideoCodec::kAV1:
- if (!IsConfiguredForTesting()) {
- encoder_ = std::make_unique<AV1VaapiVideoEncoderDelegate>(
- vaapi_wrapper_, error_cb);
- }
- break;
default:
NOTREACHED() << "Unsupported codec type " << GetCodecName(output_codec_);
return;
@@ -835,10 +827,6 @@ VaapiVideoEncodeAccelerator::CreateEncod
case VideoCodec::kVP9:
picture = new VaapiVP9Picture(std::move(reconstructed_surface));
break;
- case VideoCodec::kAV1:
- picture = new VaapiAV1Picture(/*display_va_surface=*/nullptr,
- std::move(reconstructed_surface));
- break;
default:
return nullptr;
}
diff -up chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/BUILD.gn
--- chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200
+++ chromium-114.0.5735.35/media/gpu/BUILD.gn 2023-05-20 13:14:10.755183630 +0200
@@ -373,10 +373,7 @@ source_set("common") {
"vp9_svc_layers.h",
]
configs += [ "//third_party/libvpx:libvpx_config" ]
- deps += [
- "//third_party/libaom:libaomrc",
- "//third_party/libvpx:libvpxrc",
- ]
+ deps += [ "//third_party/libvpx:libvpxrc" ]
}
if (use_libgav1_parser) {
sources += [
diff -up chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn
--- chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200
+++ chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn 2023-05-20 13:14:10.756183626 +0200
@@ -38,8 +38,6 @@ source_set("vaapi") {
sources = [
"av1_vaapi_video_decoder_delegate.cc",
"av1_vaapi_video_decoder_delegate.h",
- "av1_vaapi_video_encoder_delegate.cc",
- "av1_vaapi_video_encoder_delegate.h",
"h264_vaapi_video_decoder_delegate.cc",
"h264_vaapi_video_decoder_delegate.h",
"h264_vaapi_video_encoder_delegate.cc",
@@ -107,7 +105,6 @@ source_set("vaapi") {
"//media/gpu/chromeos:common",
"//media/parsers",
"//mojo/public/cpp/bindings",
- "//third_party/libaom:libaomrc",
"//third_party/libvpx:libvpxrc",
"//third_party/libyuv",
"//ui/gfx",

@ -0,0 +1,22 @@
diff -up chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc.me chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc
--- chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc.me 2023-05-13 12:09:44.423727385 +0200
+++ chromium-114.0.5735.26/sandbox/policy/linux/bpf_network_policy_linux.cc 2023-05-13 17:52:19.934347246 +0200
@@ -11,7 +11,6 @@
#include <linux/net.h>
#include <linux/netlink.h>
#include <linux/sockios.h>
-#include <linux/wireless.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/inotify.h>
@@ -48,6 +47,10 @@ using sandbox::syscall_broker::BrokerPro
#define F2FS_IOC_GET_FEATURES _IOR(0xf5, 12, uint32_t)
#endif
+#if !defined(SIOCGIWNAME)
+#define SIOCGIWNAME 0x8B01
+#endif
+
namespace sandbox::policy {
namespace {

@ -0,0 +1,226 @@
commit 73e9d865abd6b636280c4bb45720af2ff2c1e374
Author: Monica Basta <msalama@chromium.org>
Date: Fri Jun 2 13:25:42 2023 +0000
[BSC]: Add BoundSessionRefreshCookieFetcher::Result
Bug: b/273920907
Change-Id: I6508dcb79592420bfa3ebe3aac872c097a303a02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574672
Commit-Queue: Monica Basta <msalama@chromium.org>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1152484}
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
index 4e7e0b092a568..1c8c0110e3516 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_cookie_controller_impl.cc
@@ -93,7 +93,7 @@ void BoundSessionCookieControllerImpl::MaybeRefreshCookie() {
void BoundSessionCookieControllerImpl::OnCookieRefreshFetched(
BoundSessionRefreshCookieFetcher::Result result) {
refresh_cookie_fetcher_.reset();
- if (result.net_error == net::OK && result.response_code == net::HTTP_OK) {
+ if (result == BoundSessionRefreshCookieFetcher::Result::kSuccess) {
// Requests are resumed once the cookie is set in the cookie jar. The
// cookie is expected to be fresh and `this` is notified with its
// expiration date before `OnCookieRefreshFetched` is called.
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher.h b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher.h
index db62988635a26..f7a8b3693346f 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher.h
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher.h
@@ -14,10 +14,13 @@
// created per request.
class BoundSessionRefreshCookieFetcher {
public:
- struct Result {
- net::Error net_error;
- absl::optional<int> response_code;
+ enum class Result {
+ kSuccess = 0,
+ kConnectionError = 1,
+ kServerTransientError = 2,
+ kServerPersistentError = 3,
};
+
// Reports the result of the fetch request.
using RefreshCookieCompleteCallback = base::OnceCallback<void(Result)>;
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
index 46be6f06b147a..a6f038b158311 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc
@@ -8,6 +8,7 @@
#include "components/signin/public/base/signin_client.h"
#include "google_apis/gaia/gaia_urls.h"
+#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -102,7 +103,36 @@ void BoundSessionRefreshCookieFetcherImpl::OnURLLoaderComplete(
scoped_refptr<net::HttpResponseHeaders> headers) {
net::Error net_error = static_cast<net::Error>(url_loader_->NetError());
- std::move(callback_).Run(
- Result(net_error, headers ? absl::optional<int>(headers->response_code())
- : absl::nullopt));
+ Result result = GetResultFromNetErrorAndHttpStatusCode(
+ net_error,
+ headers ? absl::optional<int>(headers->response_code()) : absl::nullopt);
+ std::move(callback_).Run(result);
+}
+
+BoundSessionRefreshCookieFetcher::Result
+BoundSessionRefreshCookieFetcherImpl::GetResultFromNetErrorAndHttpStatusCode(
+ net::Error net_error,
+ absl::optional<int> response_code) {
+ if ((net_error != net::OK &&
+ net_error != net::ERR_HTTP_RESPONSE_CODE_FAILURE) ||
+ !response_code) {
+ return BoundSessionRefreshCookieFetcher::Result::kConnectionError;
+ }
+
+ if (response_code == net::HTTP_OK) {
+ return BoundSessionRefreshCookieFetcher::Result::kSuccess;
+ }
+
+ if (response_code >= net::HTTP_INTERNAL_SERVER_ERROR) {
+ // Server error 5xx.
+ return BoundSessionRefreshCookieFetcher::Result::kServerTransientError;
+ }
+
+ if (response_code >= net::HTTP_BAD_REQUEST) {
+ // Server error 4xx.
+ return BoundSessionRefreshCookieFetcher::Result::kServerPersistentError;
+ }
+
+ // Unexpected response code.
+ return BoundSessionRefreshCookieFetcher::Result::kServerPersistentError;
}
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.h b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.h
index 733ffbaae088c..52943f0194c32 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.h
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.h
@@ -31,8 +31,14 @@ class BoundSessionRefreshCookieFetcherImpl
void Start(RefreshCookieCompleteCallback callback) override;
private:
+ FRIEND_TEST_ALL_PREFIXES(BoundSessionRefreshCookieFetcherImplTest,
+ GetResultFromNetErrorAndHttpStatusCode);
+
void StartRefreshRequest();
void OnURLLoaderComplete(scoped_refptr<net::HttpResponseHeaders> headers);
+ Result GetResultFromNetErrorAndHttpStatusCode(
+ net::Error net_error,
+ absl::optional<int> response_code);
const raw_ptr<SigninClient> client_;
const scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl_unittest.cc b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl_unittest.cc
index d018592022d55..36ae64f83e4ee 100644
--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl_unittest.cc
+++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl_unittest.cc
@@ -19,8 +19,6 @@
#include "services/network/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
class BoundSessionRefreshCookieFetcherImplTest : public ::testing::Test {
public:
BoundSessionRefreshCookieFetcherImplTest() {
@@ -55,8 +53,7 @@ TEST_F(BoundSessionRefreshCookieFetcherImplTest, Success) {
pending_request->request.url.spec(), "");
EXPECT_TRUE(future.Wait());
BoundSessionRefreshCookieFetcher::Result result = future.Get();
- EXPECT_EQ(result.net_error, net::OK);
- EXPECT_EQ(result.response_code, net::HTTP_OK);
+ EXPECT_EQ(result, BoundSessionRefreshCookieFetcher::Result::kSuccess);
}
TEST_F(BoundSessionRefreshCookieFetcherImplTest, FailureNetError) {
@@ -75,8 +72,7 @@ TEST_F(BoundSessionRefreshCookieFetcherImplTest, FailureNetError) {
EXPECT_TRUE(future.Wait());
BoundSessionRefreshCookieFetcher::Result result = future.Get();
- EXPECT_EQ(result.net_error, status.error_code);
- EXPECT_FALSE(result.response_code.has_value());
+ EXPECT_EQ(result, BoundSessionRefreshCookieFetcher::Result::kConnectionError);
}
TEST_F(BoundSessionRefreshCookieFetcherImplTest, FailureHttpError) {
@@ -93,8 +89,38 @@ TEST_F(BoundSessionRefreshCookieFetcherImplTest, FailureHttpError) {
EXPECT_TRUE(future.Wait());
BoundSessionRefreshCookieFetcher::Result result = future.Get();
- EXPECT_EQ(result.net_error, net::ERR_HTTP_RESPONSE_CODE_FAILURE);
- EXPECT_EQ(result.response_code, net::HTTP_UNAUTHORIZED);
+ EXPECT_EQ(result,
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
+}
+
+TEST_F(BoundSessionRefreshCookieFetcherImplTest,
+ GetResultFromNetErrorAndHttpStatusCode) {
+ // Connection error.
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::ERR_CONNECTION_TIMED_OUT, absl::nullopt),
+ BoundSessionRefreshCookieFetcher::Result::kConnectionError);
+ // net::OK.
+ EXPECT_EQ(
+ fetcher_->GetResultFromNetErrorAndHttpStatusCode(net::OK, net::HTTP_OK),
+ BoundSessionRefreshCookieFetcher::Result::kSuccess);
+ // net::ERR_HTTP_RESPONSE_CODE_FAILURE
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::ERR_HTTP_RESPONSE_CODE_FAILURE, net::HTTP_BAD_REQUEST),
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
+ // Persistent error.
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::OK, net::HTTP_BAD_REQUEST),
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::OK, net::HTTP_NOT_FOUND),
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
+ // Transient error.
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::OK, net::HTTP_INTERNAL_SERVER_ERROR),
+ BoundSessionRefreshCookieFetcher::Result::kServerTransientError);
+ EXPECT_EQ(fetcher_->GetResultFromNetErrorAndHttpStatusCode(
+ net::OK, net::HTTP_GATEWAY_TIMEOUT),
+ BoundSessionRefreshCookieFetcher::Result::kServerTransientError);
}
TEST_F(BoundSessionRefreshCookieFetcherImplTest, NetworkDelayed) {
@@ -114,5 +140,3 @@ TEST_F(BoundSessionRefreshCookieFetcherImplTest, NetworkDelayed) {
EXPECT_TRUE(future.Wait());
}
-
-} // namespace
diff --git a/chrome/browser/signin/bound_session_credentials/fake_bound_session_refresh_cookie_fetcher.cc b/chrome/browser/signin/bound_session_credentials/fake_bound_session_refresh_cookie_fetcher.cc
index b4b1a07e687cb..fcfa9305d04e9 100644
--- a/chrome/browser/signin/bound_session_credentials/fake_bound_session_refresh_cookie_fetcher.cc
+++ b/chrome/browser/signin/bound_session_credentials/fake_bound_session_refresh_cookie_fetcher.cc
@@ -51,7 +51,8 @@ void FakeBoundSessionRefreshCookieFetcher::SimulateCompleteRefreshRequest(
// Synchronous since tests use `BoundSessionTestCookieManager`.
OnRefreshCookieCompleted(CreateFakeCookie(cookie_expiration.value()));
} else {
- std::move(callback_).Run(Result(net::Error::OK, net::HTTP_FORBIDDEN));
+ std::move(callback_).Run(
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
}
}
@@ -83,9 +84,11 @@ void FakeBoundSessionRefreshCookieFetcher::OnCookieSet(
net::CookieAccessResult access_result) {
bool success = access_result.status.IsInclude();
if (!success) {
- std::move(callback_).Run(Result(net::Error::OK, net::HTTP_FORBIDDEN));
+ std::move(callback_).Run(
+ BoundSessionRefreshCookieFetcher::Result::kServerPersistentError);
} else {
- std::move(callback_).Run(Result(net::Error::OK, net::HTTP_OK));
+ std::move(callback_).Run(
+ BoundSessionRefreshCookieFetcher::Result::kSuccess);
}
// |This| may be destroyed
}

@ -0,0 +1,21 @@
diff -up chromium-115.0.5790.24/components/omnibox/browser/omnibox_edit_model.cc.buildflag-el7 chromium-115.0.5790.24/components/omnibox/browser/omnibox_edit_model.cc
--- chromium-115.0.5790.24/components/omnibox/browser/omnibox_edit_model.cc.buildflag-el7 2023-06-07 21:48:29.000000000 +0200
+++ chromium-115.0.5790.24/components/omnibox/browser/omnibox_edit_model.cc 2023-06-17 16:50:46.373867625 +0200
@@ -79,7 +79,7 @@
#include "ui/gfx/vector_icon_types.h"
#endif
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+#ifdef GOOGLE_CHROME_BRANDING
#include "components/vector_icons/vector_icons.h" // nogncheck
#endif
@@ -631,7 +631,7 @@ bool OmniboxEditModel::ShouldShowCurrent
ui::ImageModel OmniboxEditModel::GetSuperGIcon(int image_size,
bool dark_mode) const {
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+#ifdef GOOGLE_CHROME_BRANDING
if (dark_mode) {
return ui::ImageModel::FromVectorIcon(
vector_icons::kGoogleGLogoMonochromeIcon, ui::kColorRefPrimary100,

@ -0,0 +1,57 @@
diff -up chromium-115.0.5790.98/sql/recover_module/cursor.h.me chromium-115.0.5790.98/sql/recover_module/cursor.h
--- chromium-115.0.5790.98/sql/recover_module/cursor.h.me 2023-07-21 20:13:43.587451992 +0200
+++ chromium-115.0.5790.98/sql/recover_module/cursor.h 2023-07-21 20:16:24.989457148 +0200
@@ -61,6 +61,10 @@ class VirtualCursor {
// The VirtualCursor instance that embeds a given SQLite virtual table cursor.
//
// |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor().
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#endif
static inline VirtualCursor* FromSqliteCursor(
sqlite3_vtab_cursor* sqlite_cursor) {
VirtualCursor* result = reinterpret_cast<VirtualCursor*>(
@@ -69,6 +73,9 @@ class VirtualCursor {
CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_);
return result;
}
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
// Seeks the cursor to the first readable row. Returns a SQLite status code.
int First();
diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp
--- chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp.me 2023-07-21 20:10:05.119385885 +0200
+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp 2023-07-21 20:10:14.386558331 +0200
@@ -14,7 +14,6 @@
#include "libANGLE/histogram_macros.h"
#include "platform/PlatformMethods.h"
-#define USE_SYSTEM_ZLIB
#include "compression_utils_portable.h"
namespace egl
diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp
--- chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp.me 2023-07-21 20:10:36.864976619 +0200
+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp 2023-07-21 20:11:07.629549228 +0200
@@ -8,7 +8,6 @@
// layer to warm up the cache from disk.
// Include zlib first, otherwise FAR gets defined elsewhere.
-#define USE_SYSTEM_ZLIB
#include "compression_utils_portable.h"
#include "libANGLE/MemoryProgramCache.h"
diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp
--- chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp.me 2023-07-21 20:09:44.206996746 +0200
+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp 2023-07-21 20:09:51.834138674 +0200
@@ -10,7 +10,6 @@
#include "libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h"
-#define USE_SYSTEM_ZLIB
#include "compression_utils_portable.h"
namespace rx

@ -0,0 +1,26 @@
diff -up chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc.me chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
--- chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc.me 2023-06-24 10:38:11.011511463 +0200
+++ chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc 2023-06-24 13:07:35.865375884 +0200
@@ -84,6 +84,7 @@ CanvasStyle::CanvasStyle(const CanvasSty
void CanvasStyle::ApplyToFlags(cc::PaintFlags& flags,
float global_alpha) const {
+ SkColor4f custom_color = SkColor4f{0.0f, 0.0f, 0.0f, global_alpha};
switch (type_) {
case kColor:
ApplyColorToFlags(flags, global_alpha);
@@ -91,12 +92,12 @@ void CanvasStyle::ApplyToFlags(cc::Paint
case kGradient:
GetCanvasGradient()->GetGradient()->ApplyToFlags(flags, SkMatrix::I(),
ImageDrawOptions());
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(custom_color);
break;
case kImagePattern:
GetCanvasPattern()->GetPattern()->ApplyToFlags(
flags, AffineTransformToSkMatrix(GetCanvasPattern()->GetTransform()));
- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha));
+ flags.setColor(custom_color);
break;
default:
NOTREACHED();

@ -0,0 +1,30 @@
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index bb0122ffd72d4..9262cc744582f 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -807,7 +807,7 @@ BASE_FEATURE(kVaapiVp9kSVCHWEncoding,
"VaapiVp9kSVCHWEncoding",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
-#if defined(ARCH_CPU_ARM_FAMILY) && BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
// Enables the new V4L2StatefulVideoDecoder instead of V4L2VideoDecoder.
BASE_FEATURE(kV4L2FlatStatelessVideoDecoder,
"V4L2FlatStatelessVideoDecoder",
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
index 97d9602eee49e..aacfac69fae20 100644
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -318,10 +318,10 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiH264TemporalLayerHWEncoding);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp8TemporalLayerHWEncoding);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp9kSVCHWEncoding);
#endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
-#if defined(ARCH_CPU_ARM_FAMILY) && BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
MEDIA_EXPORT BASE_DECLARE_FEATURE(kV4L2FlatStatelessVideoDecoder);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kV4L2FlatStatefulVideoDecoder);
-#endif // defined(ARCH_CPU_ARM_FAMILY) && BUILDFLAG(IS_CHROMEOS)
+#endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoBlitColorAccuracy);
#if BUILDFLAG(IS_APPLE)
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoToolboxVideoDecoder);

@ -0,0 +1,21 @@
diff -up chromium-115.0.5790.40/chrome/test/chromedriver/capabilities.cc.me chromium-115.0.5790.40/chrome/test/chromedriver/capabilities.cc
--- chromium-115.0.5790.40/chrome/test/chromedriver/capabilities.cc.me 2023-06-25 10:06:58.445990069 +0200
+++ chromium-115.0.5790.40/chrome/test/chromedriver/capabilities.cc 2023-06-25 10:51:17.640818231 +0200
@@ -355,7 +355,7 @@ Status ParseMobileEmulation(const base::
"'version' field of type string");
}
- brands.emplace_back(*brand, *version);
+ brands.emplace_back() = {*brand, *version};
}
client_hints.brands = std::move(brands);
@@ -392,7 +392,7 @@ Status ParseMobileEmulation(const base::
"a 'version' field of type string");
}
- full_version_list.emplace_back(*brand, *version);
+ full_version_list.emplace_back() = {*brand, *version};
}
client_hints.full_version_list = std::move(full_version_list);

@ -0,0 +1,378 @@
diff -up chromium-109.0.5414.74/base/check_op.h.me chromium-109.0.5414.74/base/check_op.h
--- chromium-109.0.5414.74/base/check_op.h.me 2023-01-17 17:39:27.620875883 +0100
+++ chromium-109.0.5414.74/base/check_op.h 2023-01-17 17:39:42.546060957 +0100
@@ -5,6 +5,7 @@
#ifndef BASE_CHECK_OP_H_
#define BASE_CHECK_OP_H_
+#include <cstdint>
#include <cstddef>
#include <string>
#include <type_traits>
diff -up chromium-109.0.5414.74/base/debug/profiler.h.me chromium-109.0.5414.74/base/debug/profiler.h
--- chromium-109.0.5414.74/base/debug/profiler.h.me 2023-01-17 16:29:26.368090073 +0100
+++ chromium-109.0.5414.74/base/debug/profiler.h 2023-01-17 16:59:41.190628679 +0100
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <cstdint>
#include <string>
#include "base/base_export.h"
diff -up chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h.me chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h
--- chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h.me 2023-01-17 19:03:10.920014806 +0100
+++ chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h 2023-01-17 19:03:48.736395274 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_
#define COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_
+#include <cstdint>
#include <string>
#include <vector>
diff -up chromium-109.0.5414.74/gpu/config/gpu_feature_info.h.me chromium-109.0.5414.74/gpu/config/gpu_feature_info.h
--- chromium-109.0.5414.74/gpu/config/gpu_feature_info.h.me 2023-01-17 19:06:53.530675129 +0100
+++ chromium-109.0.5414.74/gpu/config/gpu_feature_info.h 2023-01-17 19:07:08.874849879 +0100
@@ -5,6 +5,7 @@
#ifndef GPU_CONFIG_GPU_FEATURE_INFO_H_
#define GPU_CONFIG_GPU_FEATURE_INFO_H_
+#include <cstdint>
#include <string>
#include <vector>
diff -up chromium-109.0.5414.74/net/base/net_export.h.me chromium-109.0.5414.74/net/base/net_export.h
--- chromium-109.0.5414.74/net/base/net_export.h.me 2023-01-17 18:16:34.133854615 +0100
+++ chromium-109.0.5414.74/net/base/net_export.h 2023-01-17 18:16:15.945623153 +0100
@@ -5,6 +5,8 @@
#ifndef NET_BASE_NET_EXPORT_H_
#define NET_BASE_NET_EXPORT_H_
+#include <cstdint>
+
// Defines NET_EXPORT so that functionality implemented by the net module can
// be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to
// access features not intended to be used directly by real consumers.
diff -up chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h
--- chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me 2023-01-17 17:12:34.184686515 +0100
+++ chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h 2023-01-17 17:13:16.537162420 +0100
@@ -5,6 +5,7 @@
#ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_
#define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_
+#include <cstdint>
#include <bitset>
#include <string>
diff -up chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h.me chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h
--- chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h.me 2023-01-17 17:33:20.895717307 +0100
+++ chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h 2023-01-17 17:34:03.456185365 +0100
@@ -27,6 +27,7 @@
#ifndef ABSL_STRINGS_STRING_VIEW_H_
#define ABSL_STRINGS_STRING_VIEW_H_
+#include <cstdint>
#include <algorithm>
#include <cassert>
#include <cstddef>
diff -up chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h.me chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h
--- chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h.me 2023-01-17 17:36:15.017616250 +0100
+++ chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h 2023-01-17 17:36:48.960982195 +0100
@@ -10,6 +10,7 @@
#ifndef GLSLANG_SHADERVARS_H_
#define GLSLANG_SHADERVARS_H_
+#include <cstdint>
#include <algorithm>
#include <array>
#include <string>
diff -up chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.me chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h
--- chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.me 2023-01-17 19:17:40.480876171 +0100
+++ chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h 2023-01-17 19:17:46.803958320 +0100
@@ -5,6 +5,7 @@
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_
+#include <cstdint>
#include <array>
#include <string>
diff -up chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h.me chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h
--- chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h.me 2023-01-17 18:02:44.681538107 +0100
+++ chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h 2023-01-17 18:02:57.208679140 +0100
@@ -15,6 +15,7 @@
#ifndef SRC_TINT_READER_SPIRV_NAMER_H_
#define SRC_TINT_READER_SPIRV_NAMER_H_
+#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
diff -up chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.me chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h
--- chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.me 2023-01-18 15:22:38.472940648 +0100
+++ chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h 2023-01-18 15:23:09.380255101 +0100
@@ -5,6 +5,7 @@
#ifndef DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_
#define DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_
+#include <cstdint>
#include <functional>
#include <map>
#include <set>
diff -up chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp.me chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp
--- chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp.me 2023-01-17 15:37:48.530626516 +0100
+++ chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp 2023-01-17 16:57:46.025548092 +0100
@@ -17,6 +17,7 @@
#include "System/Debug.hpp"
+#include <cstdint>
#include <cstddef>
#include <functional>
#include <unordered_set>
diff -up chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.me chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h
--- chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.me 2023-01-17 15:40:23.854386206 +0100
+++ chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 2023-01-17 16:58:19.397862885 +0100
@@ -2388,6 +2388,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeV
#ifdef VMA_IMPLEMENTATION
#undef VMA_IMPLEMENTATION
+#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cstring>
diff -up chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h.me chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h
--- chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h.me 2023-01-17 18:08:25.745491353 +0100
+++ chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h 2023-01-17 18:08:35.777667632 +0100
@@ -5,6 +5,7 @@
#ifndef UI_GFX_LINEAR_GRADIENT_H_
#define UI_GFX_LINEAR_GRADIENT_H_
+#include <cstdint>
#include <array>
#include <string>
diff -up chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h.me chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h
--- chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h.me 2023-01-19 10:10:21.287876736 +0100
+++ chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h 2023-01-19 10:11:21.714778896 +0100
@@ -17,6 +17,7 @@ limitations under the License.
#define RUY_RUY_PROFILER_INSTRUMENTATION_H_
#ifdef RUY_PROFILER
+#include <string>
#include <cstdio>
#include <mutex>
#include <vector>
diff -up chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.me chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h
--- chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.me 2023-01-19 10:30:27.533861985 +0100
+++ chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h 2023-01-19 10:31:12.585554183 +0100
@@ -31,6 +31,7 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_
#define TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_
+#include <cstdint>
#include <complex>
#include <deque>
#include <vector>
diff -up chromium-109.0.5414.74/base/containers/flat_map.h.mee chromium-109.0.5414.74/base/containers/flat_map.h
--- chromium-109.0.5414.74/base/containers/flat_map.h.mee 2023-01-19 10:59:52.214957773 +0100
+++ chromium-109.0.5414.74/base/containers/flat_map.h 2023-01-19 11:00:06.415215309 +0100
@@ -5,6 +5,7 @@
#ifndef BASE_CONTAINERS_FLAT_MAP_H_
#define BASE_CONTAINERS_FLAT_MAP_H_
+#include <cstdint>
#include <functional>
#include <tuple>
#include <utility>
diff -up chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h.mee chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h
--- chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h.mee 2023-01-19 10:36:40.571422826 +0100
+++ chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h 2023-01-19 10:36:49.343565294 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
#define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
+#include <cstdint>
#include <string>
#include "build/build_config.h"
diff -up chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h.mee chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h
--- chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h.mee 2023-01-19 11:45:15.953159755 +0100
+++ chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h 2023-01-19 11:45:22.320246241 +0100
@@ -5,6 +5,8 @@
#ifndef UI_BASE_PREDICTION_KALMAN_FILTER_H_
#define UI_BASE_PREDICTION_KALMAN_FILTER_H_
+#include <cstdint>
+
#include "base/component_export.h"
#include "ui/gfx/geometry/matrix3_f.h"
diff -up chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h.me chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h
--- chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h.me 2023-01-19 15:20:07.620987949 +0100
+++ chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h 2023-01-19 15:20:18.324173702 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_
+#include <cstdint>
#include <string>
diff -up chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h.me chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h
--- chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h.me 2023-01-19 16:00:14.350186515 +0100
+++ chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h 2023-01-19 16:00:21.643307993 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_
#define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_
+#include <cstdint>
#include <string>
namespace feature_engagement {
diff -up chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h.me chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h
--- chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h.me 2023-01-19 15:59:18.210239416 +0100
+++ chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h 2023-01-19 15:59:34.513515030 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_
#define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_
+#include <cstdint>
#include <string>
#include "components/feature_engagement/internal/event_storage_validator.h"
diff -up chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.me chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc
--- chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.me 2023-01-19 16:09:29.216477182 +0100
+++ chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc 2023-01-19 16:10:05.657089208 +0100
@@ -45,6 +45,7 @@
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
+#include <cstdint>
#include <string>
#include <sysexits.h>
#ifdef HAVE_BACKTRACE
diff -up chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h.me chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h
--- chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h.me 2023-01-19 16:32:05.338160131 +0100
+++ chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h 2023-01-19 16:32:16.213326798 +0100
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_
#define CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_
+#include <cstdint>
#include <map>
#include "base/containers/flat_set.h"
diff -up chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h.me chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h
--- chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h.me 2023-01-19 16:47:55.548571102 +0100
+++ chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h 2023-01-19 16:48:29.214146529 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_
+#include <cstdint>
#include <string>
class GURL;
diff -up chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h.me chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h
--- chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h.me 2023-01-19 16:57:29.525372814 +0100
+++ chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h 2023-01-19 16:58:02.667979288 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_
#define COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_
+#include <cstdint>
#include <string>
#include <utility>
#include <vector>
diff -up chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h.me chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h
--- chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h.me 2023-01-19 17:02:45.258544665 +0100
+++ chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h 2023-01-19 17:02:52.577611757 +0100
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_
#define COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_
+#include <cstdint>
#include <stddef.h>
#include <string>
diff -up chromium-109.0.5414.74/pdf/document_attachment_info.h.me chromium-109.0.5414.74/pdf/document_attachment_info.h
--- chromium-109.0.5414.74/pdf/document_attachment_info.h.me 2023-01-19 17:28:28.552063534 +0100
+++ chromium-109.0.5414.74/pdf/document_attachment_info.h 2023-01-19 17:28:48.072379953 +0100
@@ -5,6 +5,7 @@
#ifndef PDF_DOCUMENT_ATTACHMENT_INFO_H_
#define PDF_DOCUMENT_ATTACHMENT_INFO_H_
+#include <cstdint>
#include <string>
diff -up chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h.me chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h
--- chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h.me 2023-01-19 18:25:47.648193710 +0100
+++ chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h 2023-01-19 18:26:11.488593556 +0100
@@ -5,6 +5,8 @@
#ifndef CONSTANTS_ANNOTATION_FLAGS_H_
#define CONSTANTS_ANNOTATION_FLAGS_H_
+#include <cstdint>
+
namespace pdfium {
namespace annotation_flags {
diff -up chromium-109.0.5414.74/base/cpu.h.me chromium-109.0.5414.74/base/cpu.h
--- chromium-109.0.5414.74/base/cpu.h.me 2023-01-19 21:31:02.905062987 +0100
+++ chromium-109.0.5414.74/base/cpu.h 2023-01-19 21:31:32.298573267 +0100
@@ -5,6 +5,7 @@
#ifndef BASE_CPU_H_
#define BASE_CPU_H_
+#include <cstdint>
#include <string>
#include "base/base_export.h"
diff -up chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.me chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h
--- chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.me 2023-04-15 16:44:55.344305412 +0200
+++ chromium-113.0.5672.24/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h 2023-04-15 16:47:09.028666995 +0200
@@ -2854,6 +2854,7 @@ static void vma_aligned_free(void* VMA_N
// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.
#if VMA_STATS_STRING_ENABLED
+#include <stdio.h>
static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num)
{
snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
diff -up chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h.me chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h
--- chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h.me 2023-04-18 15:55:44.774916319 +0200
+++ chromium-113.0.5672.37/chrome/browser/webauthn/authenticator_request_dialog_model.h 2023-04-18 15:55:54.441085882 +0200
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <variant>
#include "base/containers/span.h"
#include "base/functional/callback_forward.h"
diff -up chromium-113.0.5672.37/gin/time_clamper.h.me chromium-113.0.5672.37/gin/time_clamper.h
--- chromium-113.0.5672.37/gin/time_clamper.h.me 2023-04-18 16:38:41.180437467 +0200
+++ chromium-113.0.5672.37/gin/time_clamper.h 2023-04-18 16:39:43.857049432 +0200
@@ -48,7 +48,7 @@ class GIN_EXPORT TimeClamper {
const int64_t micros = now_micros % 1000;
// abs() is necessary for devices with times before unix-epoch (most likely
// configured incorrectly).
- if (abs(micros) + kResolutionMicros < 1000) {
+ if (std::abs(micros) + kResolutionMicros < 1000) {
return now_micros / 1000;
}
return ClampTimeResolution(now_micros) / 1000;
diff -up chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc.me chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc
--- chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc.me 2023-04-21 08:07:55.362714544 +0200
+++ chromium-113.0.5672.53/chrome/test/chromedriver/chrome/web_view_impl.cc 2023-04-21 08:14:35.424158693 +0200
@@ -10,6 +10,7 @@
#include <queue>
#include <utility>
#include <vector>
+#include <cstring>
#include "base/check.h"
#include "base/files/file_path.h"

@ -0,0 +1,12 @@
diff --git a/media/gpu/v4l2/v4l2_stateful_video_decoder.cc b/media/gpu/v4l2/v4l2_stateful_video_decoder.cc
index c84dedb7d1c1f..ca8cd566d2018 100644
--- a/media/gpu/v4l2/v4l2_stateful_video_decoder.cc
+++ b/media/gpu/v4l2/v4l2_stateful_video_decoder.cc
@@ -9,6 +9,7 @@
#include <sys/eventfd.h>
#include <sys/ioctl.h>
+#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"

@ -0,0 +1,22 @@
diff -up chromium-115.0.5790.32/skia/ext/skcolorspace_trfn.cc.me chromium-115.0.5790.32/skia/ext/skcolorspace_trfn.cc
--- chromium-115.0.5790.32/skia/ext/skcolorspace_trfn.cc.me 2023-06-18 12:33:52.387412788 +0200
+++ chromium-115.0.5790.32/skia/ext/skcolorspace_trfn.cc 2023-06-18 12:35:28.229148935 +0200
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "skia/ext/skcolorspace_trfn.h"
+#include <cmath>
namespace skia {
diff -up chromium-115.0.5790.32/net/cert/pki/verify_name_match.h.me chromium-115.0.5790.32/net/cert/pki/verify_name_match.h
--- chromium-115.0.5790.32/net/cert/pki/verify_name_match.h.me 2023-06-18 14:23:13.847725775 +0200
+++ chromium-115.0.5790.32/net/cert/pki/verify_name_match.h 2023-06-18 14:23:41.637221117 +0200
@@ -6,6 +6,7 @@
#define NET_CERT_PKI_VERIFY_NAME_MATCH_H_
#include <string>
+#include <vector>
#include "net/base/net_export.h"

@ -0,0 +1,63 @@
diff -up chromium-115.0.5790.24/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-115.0.5790.24/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
--- chromium-115.0.5790.24/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar 2023-06-07 21:48:24.000000000 +0200
+++ chromium-115.0.5790.24/chrome/browser/safe_browsing/download_protection/file_analyzer.cc 2023-06-17 14:33:36.906639952 +0200
@@ -77,8 +77,6 @@ void FileAnalyzer::Start(const base::Fil
if (inspection_type == DownloadFileType::ZIP) {
StartExtractZipFeatures();
- } else if (inspection_type == DownloadFileType::RAR) {
- StartExtractRarFeatures();
#if BUILDFLAG(IS_MAC)
} else if (inspection_type == DownloadFileType::DMG) {
StartExtractDmgFeatures();
diff -up chromium-115.0.5790.24/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-115.0.5790.24/chrome/common/safe_browsing/BUILD.gn
--- chromium-115.0.5790.24/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-06-07 21:48:26.000000000 +0200
+++ chromium-115.0.5790.24/chrome/common/safe_browsing/BUILD.gn 2023-06-17 14:33:36.906639952 +0200
@@ -134,7 +134,6 @@ source_set("safe_browsing") {
"//components/safe_browsing/content/common:file_type_policies",
"//components/safe_browsing/core/common",
"//third_party/lzma_sdk/google:seven_zip_reader",
- "//third_party/unrar:unrar",
]
public_deps = [
diff -up chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.cc
--- chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-06-07 21:48:26.000000000 +0200
+++ chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.cc 2023-06-17 14:33:36.906639952 +0200
@@ -69,6 +69,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
base::File rar_file,
mojo::PendingRemote<chrome::mojom::TemporaryFileGetter> temp_file_getter,
AnalyzeRarFileCallback callback) {
+#if 0
DCHECK(rar_file.IsValid());
temp_file_getter_.Bind(std::move(temp_file_getter));
callback_ = std::move(callback);
@@ -84,6 +85,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile
rar_analyzer_.Analyze(std::move(rar_file), base::FilePath(),
std::move(analysis_finished_callback),
std::move(temp_file_getter_callback), &results_);
+#else
+ NOTREACHED();
+#endif
}
void SafeArchiveAnalyzer::AnalyzeSevenZipFile(
diff -up chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.h.nounrar chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.h
--- chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.h.nounrar 2023-06-07 21:48:26.000000000 +0200
+++ chromium-115.0.5790.24/chrome/services/file_util/safe_archive_analyzer.h 2023-06-17 14:40:20.953942489 +0200
@@ -7,7 +7,6 @@
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h"
-#include "chrome/utility/safe_browsing/rar_analyzer.h"
#include "chrome/utility/safe_browsing/seven_zip_analyzer.h"
#include "chrome/utility/safe_browsing/zip_analyzer.h"
#include "mojo/public/cpp/bindings/remote.h"
@@ -63,7 +62,6 @@ class SafeArchiveAnalyzer : public chrom
void Timeout();
safe_browsing::ZipAnalyzer zip_analyzer_;
- safe_browsing::RarAnalyzer rar_analyzer_;
safe_browsing::SevenZipAnalyzer seven_zip_analyzer_;
#if BUILDFLAG(IS_MAC)
safe_browsing::dmg::DMGAnalyzer dmg_analyzer_;

@ -0,0 +1,289 @@
commit b2c4ff8d5d8cdbf2487363a5b8d68b6485706069
Author: Richard Townsend <Richard.Townsend@arm.com>
Date: Thu May 18 22:51:36 2023 +0000
Reland "Reland "mte: refactor the tagging functions to use ifuncs""
This is a reland of commit 2321ea383c006149c3b496a515f54fb3aebdc34c
and a revert of commit adfb1c2c6ceb3daf210cef1e5688541ebc561e20. It
was reverted because of a problem with android-arm64 orderfile
generation, which is now resolved.
Original change's description:
> Reland "mte: refactor the tagging functions to use ifuncs"
>
> This was reverted due to a toolchain problem affecting ThinLTO,
> resolved in [1]
>
> [1] https://reviews.llvm.org/D144982
>
> This reverts commit 6c22e41fc3ffd305359f17b2423c37c2c976acf3.
>
> Bug: 1137393
> Change-Id: I991e12618f98cdf8b89ec83cad06e30ad60d332e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4473870
> Reviewed-by: Keishi Hattori <keishi@chromium.org>
> Commit-Queue: Richard Townsend <richard.townsend@arm.com>
> Cr-Commit-Position: refs/heads/main@{#1135862}
Bug: 1137393, 1440531
Change-Id: I4cd1911a36cf55ee1c06e6ffda971866c93fa741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4517702
Commit-Queue: Richard Townsend <richard.townsend@arm.com>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146244}
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc
index 486594e81f823..8ab37f6dec750 100644
--- a/base/allocator/partition_allocator/partition_root.cc
+++ b/base/allocator/partition_allocator/partition_root.cc
@@ -869,10 +869,6 @@ void PartitionRoot<thread_safe>::Init(PartitionOptions opts) {
return;
}
- // Swaps out the active no-op tagging intrinsics with MTE-capable ones, if
- // running on the right hardware.
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
-
#if BUILDFLAG(HAS_64_BIT_POINTERS)
// Reserve address space for partition alloc.
internal::PartitionAddressSpace::Init();
diff --git a/base/allocator/partition_allocator/tagging.cc b/base/allocator/partition_allocator/tagging.cc
index a8a74155de4e1..ea7ac2af82c88 100644
--- a/base/allocator/partition_allocator/tagging.cc
+++ b/base/allocator/partition_allocator/tagging.cc
@@ -12,7 +12,9 @@
#if PA_CONFIG(HAS_MEMORY_TAGGING)
#include <arm_acle.h>
+#include <asm/hwcap.h>
#include <sys/auxv.h>
+#include <sys/ifunc.h>
#include <sys/prctl.h>
#define PR_SET_TAGGED_ADDR_CTRL 55
#define PR_GET_TAGGED_ADDR_CTRL 56
@@ -119,12 +121,6 @@ namespace {
return ret;
}
-#if PA_CONFIG(HAS_MEMORY_TAGGING)
-static bool HasCPUMemoryTaggingExtension() {
- return base::CPU::GetInstanceNoAllocation().has_mte();
-}
-#endif // PA_CONFIG(HAS_MEMORY_TAGGING)
-
#if PA_CONFIG(HAS_MEMORY_TAGGING)
void* TagRegionRandomlyForMTE(void* ptr, size_t sz, uint64_t mask) {
// Randomly tag a region (MTE-enabled systems only). The first 16-byte
@@ -166,7 +162,6 @@ void* RemaskVoidPtrForMTE(void* ptr) {
}
return nullptr;
}
-#endif
void* TagRegionIncrementNoOp(void* ptr, size_t sz) {
// Region parameters are checked even on non-MTE systems to check the
@@ -183,24 +178,49 @@ void* TagRegionRandomlyNoOp(void* ptr, size_t sz, uint64_t mask) {
void* RemaskVoidPtrNoOp(void* ptr) {
return ptr;
}
+#endif
} // namespace
-void InitializeMTESupportIfNeeded() {
#if PA_CONFIG(HAS_MEMORY_TAGGING)
- if (HasCPUMemoryTaggingExtension()) {
- global_remask_void_ptr_fn = RemaskVoidPtrForMTE;
- global_tag_memory_range_increment_fn = TagRegionIncrementForMTE;
- global_tag_memory_range_randomly_fn = TagRegionRandomlyForMTE;
+using RemaskPtrInternalFn = void*(void* ptr);
+using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size);
+
+using TagMemoryRangeRandomlyInternalFn = void*(void* ptr,
+ size_t size,
+ uint64_t mask);
+
+extern "C" TagMemoryRangeIncrementInternalFn(
+ *ResolveTagMemoryRangeIncrement(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
+ if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
+ return TagRegionIncrementForMTE;
}
-#endif
+ return TagRegionIncrementNoOp;
+}
+
+extern "C" TagMemoryRangeRandomlyInternalFn(
+ *ResolveTagMemoryRandomly(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
+ if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
+ return TagRegionRandomlyForMTE;
+ }
+ return TagRegionRandomlyNoOp;
+}
+
+extern "C" RemaskPtrInternalFn(
+ *ResolveRemaskPointer(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
+ if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
+ return RemaskVoidPtrForMTE;
+ }
+ return RemaskVoidPtrNoOp;
}
-RemaskPtrInternalFn* global_remask_void_ptr_fn = RemaskVoidPtrNoOp;
-TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn =
- TagRegionIncrementNoOp;
-TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn =
- TagRegionRandomlyNoOp;
+void* TagMemoryRangeIncrementInternal(void* ptr, size_t size)
+ __attribute__((ifunc("ResolveTagMemoryRangeIncrement")));
+void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask)
+ __attribute__((ifunc("ResolveTagMemoryRandomly")));
+void* RemaskPointerInternal(void* ptr)
+ __attribute__((ifunc("ResolveRemaskPointer")));
+#endif // PA_CONFIG(HAS_MEMORY_TAGGING)
TagViolationReportingMode GetMemoryTaggingModeForCurrentThread() {
#if PA_CONFIG(HAS_MEMORY_TAGGING)
diff --git a/base/allocator/partition_allocator/tagging.h b/base/allocator/partition_allocator/tagging.h
index af914452b1162..d49e062ce6319 100644
--- a/base/allocator/partition_allocator/tagging.h
+++ b/base/allocator/partition_allocator/tagging.h
@@ -55,32 +55,16 @@ void ChangeMemoryTaggingModeForAllThreadsPerProcess(TagViolationReportingMode);
PA_COMPONENT_EXPORT(PARTITION_ALLOC)
TagViolationReportingMode GetMemoryTaggingModeForCurrentThread();
-// Called by the partition allocator after initial startup, this detects MTE
-// support in the current CPU and replaces the active tagging intrinsics with
-// MTE versions if needed.
-PA_COMPONENT_EXPORT(PARTITION_ALLOC) void InitializeMTESupportIfNeeded();
-
-// These global function pointers hold the implementations of the tagging
-// intrinsics (TagMemoryRangeRandomly, TagMemoryRangeIncrement, RemaskPtr).
-// They are designed to be callable without taking a branch. They are initially
-// set to no-op functions in tagging.cc, but can be replaced with MTE-capable
-// ones through InitializeMTEIfNeeded(). This is conceptually similar to an
-// IFUNC, even though less secure. These function pointers were introduced to
-// support older Android releases. With the removal of support for Android M,
-// it became possible to use IFUNC instead.
-// TODO(bartekn): void* -> uintptr_t
-using RemaskPtrInternalFn = void*(void* ptr);
-using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size);
-
-using TagMemoryRangeRandomlyInternalFn = void*(void* ptr,
- size_t size,
- uint64_t mask);
-extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
- TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn;
-extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
- TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn;
-extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
- RemaskPtrInternalFn* global_remask_void_ptr_fn;
+// These forward-defined functions do not really exist in tagging.cc, they're resolved
+// by the dynamic linker to MTE-capable versions on the right hardware.
+#if PA_CONFIG(HAS_MEMORY_TAGGING)
+PA_COMPONENT_EXPORT(PARTITION_ALLOC)
+void* TagMemoryRangeIncrementInternal(void* ptr, size_t size);
+PA_COMPONENT_EXPORT(PARTITION_ALLOC)
+void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask);
+PA_COMPONENT_EXPORT(PARTITION_ALLOC)
+void* RemaskPointerInternal(void* ptr);
+#endif
// Increments the tag of the memory range ptr. Useful for provable revocations
// (e.g. free). Returns the pointer with the new tag. Ensures that the entire
@@ -90,7 +74,7 @@ extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
template <typename T>
PA_ALWAYS_INLINE T* TagMemoryRangeIncrement(T* ptr, size_t size) {
#if PA_CONFIG(HAS_MEMORY_TAGGING)
- return reinterpret_cast<T*>(global_tag_memory_range_increment_fn(ptr, size));
+ return reinterpret_cast<T*>(TagMemoryRangeIncrementInternal(ptr, size));
#else
return ptr;
#endif
@@ -108,8 +92,7 @@ PA_ALWAYS_INLINE T* TagMemoryRangeRandomly(T* ptr,
size_t size,
uint64_t mask = 0u) {
#if PA_CONFIG(HAS_MEMORY_TAGGING)
- return reinterpret_cast<T*>(
- global_tag_memory_range_randomly_fn(ptr, size, mask));
+ return reinterpret_cast<T*>(TagMemoryRangeRandomlyInternal(ptr, size, mask));
#else
return ptr;
#endif
@@ -124,7 +107,7 @@ PA_ALWAYS_INLINE void* TagMemoryRangeRandomly(uintptr_t ptr,
template <typename T>
PA_ALWAYS_INLINE T* TagPtr(T* ptr) {
#if PA_CONFIG(HAS_MEMORY_TAGGING)
- return reinterpret_cast<T*>(global_remask_void_ptr_fn(ptr));
+ return reinterpret_cast<T*>(RemaskPointerInternal(ptr));
#else
return ptr;
#endif
diff --git a/base/allocator/partition_allocator/tagging_unittest.cc b/base/allocator/partition_allocator/tagging_unittest.cc
index f3b8532a8f1f4..47f62ac000b43 100644
--- a/base/allocator/partition_allocator/tagging_unittest.cc
+++ b/base/allocator/partition_allocator/tagging_unittest.cc
@@ -16,7 +16,6 @@ namespace partition_alloc::internal {
// Check whether we can call the tagging intrinsics safely on all architectures.
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
PageAccessibilityConfiguration(
@@ -32,7 +31,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -54,7 +52,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) {
#if defined(ARCH_CPU_64_BITS)
// Size / alignment constraints are only enforced on 64-bit architectures.
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -71,7 +68,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -87,7 +83,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -104,7 +99,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -120,7 +114,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
@@ -136,7 +129,6 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) {
}
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadAlign) {
- ::partition_alloc::internal::InitializeMTESupportIfNeeded();
base::CPU cpu;
uintptr_t buffer =
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),

@ -0,0 +1,36 @@
diff -up chromium-115.0.5790.24/net/filter/brotli_source_stream.cc.system-brotli chromium-115.0.5790.24/net/filter/brotli_source_stream.cc
--- chromium-115.0.5790.24/net/filter/brotli_source_stream.cc.system-brotli 2023-06-07 21:48:38.000000000 +0200
+++ chromium-115.0.5790.24/net/filter/brotli_source_stream.cc 2023-06-17 14:42:19.734299929 +0200
@@ -10,7 +10,7 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "net/base/io_buffer.h"
-#include "third_party/brotli/include/brotli/decode.h"
+#include <brotli/decode.h>
namespace net {
diff -up chromium-115.0.5790.24/net/ssl/cert_compression.cc.system-brotli chromium-115.0.5790.24/net/ssl/cert_compression.cc
--- chromium-115.0.5790.24/net/ssl/cert_compression.cc.system-brotli 2023-06-07 21:48:38.000000000 +0200
+++ chromium-115.0.5790.24/net/ssl/cert_compression.cc 2023-06-17 14:42:19.734299929 +0200
@@ -9,7 +9,7 @@
#include "third_party/boringssl/src/include/openssl/ssl.h"
#if !defined(NET_DISABLE_BROTLI)
-#include "third_party/brotli/include/brotli/decode.h"
+#include <brotli/decode.h>
#endif
namespace net {
diff -up chromium-115.0.5790.24/ui/base/resource/resource_bundle.cc.system-brotli chromium-115.0.5790.24/ui/base/resource/resource_bundle.cc
--- chromium-115.0.5790.24/ui/base/resource/resource_bundle.cc.system-brotli 2023-06-17 14:42:19.734299929 +0200
+++ chromium-115.0.5790.24/ui/base/resource/resource_bundle.cc 2023-06-17 14:44:18.591002119 +0200
@@ -32,7 +32,7 @@
#include "net/filter/gzip_header.h"
#include "skia/ext/image_operations.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
-#include "third_party/brotli/include/brotli/decode.h"
+#include <brotli/decode.h>
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/zlib/google/compression_utils.h"

@ -0,0 +1,48 @@
diff -up chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc.typename chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc
--- chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc.typename 2023-06-17 14:50:56.342591702 +0200
+++ chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc 2023-06-17 14:57:48.024377375 +0200
@@ -91,7 +91,7 @@ ItemSortKey GetSortKey(const Item& item)
// Helper to get an iterator to the last element in the cache. The cache
// must not be empty.
template <typename Item>
-SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
+typename SortedItems<Item>::const_iterator GetLastIter(const SortedItems<Item>& cache) {
CHECK(!cache.empty());
auto it = cache.end();
return std::prev(it);
@@ -967,9 +967,9 @@ bool DownloadBubbleUpdateService::CacheM
}
template <typename Id, typename Item>
-SortedItems<Item>::iterator
+typename SortedItems<Item>::iterator
DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter(
- SortedItems<Item>::iterator iter,
+ typename SortedItems<Item>::iterator iter,
SortedItems<Item>& cache,
IterMap<Id, Item>& iter_map) {
CHECK(iter != cache.end());
diff -up chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h.me chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h
--- chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h.me 2023-06-18 21:52:53.515625237 +0200
+++ chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h 2023-06-18 21:53:06.881881293 +0200
@@ -189,7 +189,7 @@ class TFLiteModelExecutor : public Model
void SendForBatchExecution(
BatchExecutionCallback callback_on_complete,
base::TimeTicks start_time,
- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
override {
DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff -up chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.me1 chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
--- chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.me1 2023-06-19 10:03:32.319218678 +0200
+++ chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc 2023-06-19 10:04:12.023942232 +0200
@@ -169,7 +169,7 @@ class HTMLFastPathParser {
using Span = base::span<const Char>;
using USpan = base::span<const UChar>;
// 32 matches that used by HTMLToken::Attribute.
- typedef std::conditional<std::is_same_v<Char, UChar>,
+ typedef typename std::conditional<std::is_same_v<Char, UChar>,
UCharLiteralBuffer<32>,
LCharLiteralBuffer<32>>::type LiteralBufferType;
typedef UCharLiteralBuffer<32> UCharLiteralBufferType;

@ -0,0 +1,31 @@
commit 8f46ad499d8f8afd56bf5c82cbbcad67285ed8aa
Author: Phan Quang Minh <phanquangminh217@gmail.com>
Date: Wed May 24 10:13:45 2023 +0000
ozone/wayland: Load default cursor theme if theme name is empty
We might need to load the cursor theme even if `OnCursorThemeName` never
gets called (e.g. Qt theme backend). In this case we will need to load
the default theme by passing `NULL` to wl_cursor_theme_load.
Change-Id: I0e1814178319734a4d0fe7574cdc8c7a1d1cf7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4553659
Reviewed-by: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Maksim Sisov <msisov@igalia.com>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1148441}
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
index 9ab12b1994c68..11b162554abc8 100644
--- a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
@@ -230,7 +230,8 @@ void WaylandCursorFactory::MaybeLoadThemeCursors() {
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE,
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
- base::BindOnce(wl_cursor_theme_load, name_.c_str(), GetCacheKey(),
+ base::BindOnce(wl_cursor_theme_load,
+ name_.empty() ? nullptr : name_.c_str(), GetCacheKey(),
connection_->buffer_factory()->shm()),
base::BindOnce(&WaylandCursorFactory::OnThemeLoaded,
weak_factory_.GetWeakPtr(), name_, size_));

@ -0,0 +1,81 @@
diff -up chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc
--- chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding 2023-06-07 21:48:37.000000000 +0200
+++ chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc 2023-06-17 16:53:20.216628557 +0200
@@ -94,7 +94,9 @@ void CdmPromiseAdapter::RejectPromise(ui
void CdmPromiseAdapter::Clear(ClearReason reason) {
// Reject all outstanding promises.
DCHECK(thread_checker_.CalledOnValidThread());
- for (auto& [promise_id, promise] : promises_) {
+ for (auto& [p_i, p_e] : promises_) {
+ auto& promise_id = p_i;
+ auto& promise = p_e;
TRACE_EVENT_NESTABLE_ASYNC_END1(
"media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id),
"status", "cleared");
diff -up chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
--- chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding 2023-06-07 21:48:41.000000000 +0200
+++ chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-06-17 18:47:06.001403966 +0200
@@ -238,7 +238,10 @@ const NGLayoutResult* NGGridLayoutAlgori
: BuildGridSizingTree(&oof_children);
LayoutUnit intrinsic_block_size;
- auto& [grid_items, layout_data, tree_size] = grid_sizing_tree.TreeRootData();
+ auto& [g_i, l_d, t_s] = grid_sizing_tree.TreeRootData();
+ auto& grid_items = g_i;
+ auto& layout_data = l_d;
+ auto& tree_size = t_s;
if (IsBreakInside(BreakToken())) {
// TODO(layout-dev): When we support variable inline-size fragments we'll
@@ -655,8 +658,10 @@ NGGridSizingTree NGGridLayoutAlgorithm::
NGGridSizingTree sizing_tree;
if (const auto* layout_subtree = ConstraintSpace().GridLayoutSubtree()) {
- auto& [grid_items, layout_data, subtree_size] =
- sizing_tree.CreateSizingData();
+ auto& [g_i, l_d, s_s] = sizing_tree.CreateSizingData();
+ auto& grid_items = g_i;
+ auto& layout_data = l_d;
+ auto& subtree_size = s_s;
const auto& node = Node();
grid_items =
@@ -1798,8 +1803,10 @@ void NGGridLayoutAlgorithm::CompleteTrac
bool* opt_needs_additional_pass) const {
DCHECK(sizing_subtree);
- auto& [grid_items, layout_data, subtree_size] =
- sizing_subtree.SubtreeRootData();
+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData();
+ auto& grid_items = g_i;
+ auto& layout_data = l_d;
+ auto& subtree_size = s_s;
const bool is_for_columns = track_direction == kForColumns;
const bool has_non_definite_track =
@@ -1924,8 +1931,10 @@ template <typename CallbackFunc>
void NGGridLayoutAlgorithm::ForEachSubgrid(
const NGGridSizingSubtree& sizing_subtree,
const CallbackFunc& callback_func) const {
- auto& [grid_items, layout_data, subtree_size] =
- sizing_subtree.SubtreeRootData();
+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData();
+ auto& grid_items = g_i;
+ auto& layout_data = l_d;
+ auto& subtree_size = s_s;
// If we know this subtree doesn't have nested subgrids we can exit early
// instead of iterating over every grid item looking for them.
diff -up chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc
--- chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me 2023-06-19 08:04:02.287072722 +0200
+++ chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc 2023-06-19 08:18:24.576814950 +0200
@@ -1393,7 +1393,8 @@ void ServiceWorkerContextWrapper::MaybeP
return;
}
- auto [document_url, key, callback] = std::move(*request);
+ auto [d_u, key, callback] = std::move(*request);
+ auto document_url = d_u;
DCHECK(document_url.is_valid());
TRACE_EVENT1("ServiceWorker",

@ -0,0 +1,20 @@
diff -up chromium-70.0.3538.67/sandbox/linux/BUILD.gn.sandboxpie chromium-70.0.3538.67/sandbox/linux/BUILD.gn
--- chromium-70.0.3538.67/sandbox/linux/BUILD.gn.sandboxpie 2018-10-18 12:14:05.766939769 -0400
+++ chromium-70.0.3538.67/sandbox/linux/BUILD.gn 2018-10-18 12:16:37.820027182 -0400
@@ -315,10 +315,16 @@ if (is_linux) {
# For ULLONG_MAX
"-std=gnu99",
+ "-fPIE",
+
# These files have a suspicious comparison.
# TODO fix this and re-enable this warning.
"-Wno-sign-compare",
]
+
+ ldflags = [
+ "-pie",
+ ]
}
}

@ -0,0 +1,22 @@
diff -up chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle chromium-77.0.3865.75/third_party/zlib/zconf.h
--- chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle 2019-09-12 09:36:37.924086850 +0200
+++ chromium-77.0.3865.75/third_party/zlib/zconf.h 2019-09-12 09:53:01.623958551 +0200
@@ -9,18 +9,6 @@
#define ZCONF_H
/*
- * This library is also built as a part of AOSP, which does not need to include
- * chromeconf.h. This config does not want chromeconf.h, so it can set this
- * macro to opt out. While this works today, there's no guarantee that building
- * zlib outside of Chromium keeps working in the future.
- */
-#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF)
-/* This include does prefixing as below, but with an updated set of names. Also
- * sets up export macros in component builds. */
-#include "chromeconf.h"
-#endif
-
-/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set

@ -0,0 +1,12 @@
diff -up chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn
--- chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib 2020-04-13 12:25:09.001172601 -0400
+++ chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn 2020-04-13 12:25:23.688921586 -0400
@@ -294,7 +294,7 @@ if (enable_perfetto_zlib) {
public_configs = [ "//buildtools:zlib_config" ]
public_deps = [ "//buildtools:zlib" ]
} else {
- public_configs = [ "//third_party/zlib:zlib_config" ]
+ public_configs = [ "//third_party/zlib:system_zlib" ]
public_deps = [ "//third_party/zlib" ]
}
}

@ -0,0 +1,15 @@
diff -up chromium-85.0.4183.83/ui/gfx/linux/drm_util_linux.cc.el7-old-libdrm chromium-85.0.4183.83/ui/gfx/linux/drm_util_linux.cc
--- chromium-85.0.4183.83/ui/gfx/linux/drm_util_linux.cc.el7-old-libdrm 2020-08-31 09:38:46.043993882 -0400
+++ chromium-85.0.4183.83/ui/gfx/linux/drm_util_linux.cc 2020-08-31 09:39:21.599906318 -0400
@@ -6,6 +6,11 @@
#include <drm_fourcc.h>
+// the libdrm in EL-7 is too old to have this define
+#ifndef DRM_FORMAT_P010
+#define DRM_FORMAT_P010 DRM_FORMAT_INVALID
+#endif
+
#include "base/notreached.h"
namespace ui {

@ -0,0 +1,13 @@
diff -up chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed chromium-91.0.4472.77/third_party/closure_compiler/compiler.py
--- chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed 2021-06-02 17:14:48.445064647 +0000
+++ chromium-91.0.4472.77/third_party/closure_compiler/compiler.py 2021-06-02 17:15:12.994836949 +0000
@@ -13,8 +13,7 @@ import subprocess
_CURRENT_DIR = os.path.join(os.path.dirname(__file__))
-_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java")
-assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds"
+_JAVA_PATH = "java"
class Compiler(object):
"""Runs the Closure compiler on given source files to typecheck them

@ -0,0 +1,12 @@
diff -up chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py
--- chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 2021-08-31 21:40:34.000000000 -0400
+++ chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py 2021-09-02 08:26:04.415846917 -0400
@@ -130,7 +130,7 @@ def main(argv):
if not options.debug:
gn_gen_args += ' is_debug=false'
subprocess.check_call([
- gn_path, 'gen', out_dir,
+ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python3',
'--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
])

@ -0,0 +1,35 @@
diff -up chromium-96.0.4664.45/third_party/webrtc/common_video/h264/pps_parser.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/common_video/h264/pps_parser.h
diff -up chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h
--- chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h.missing-cstdint 2021-11-19 17:05:31.379750350 -0500
+++ chromium-96.0.4664.45/third_party/webrtc/common_video/h264/sps_parser.h 2021-11-19 17:07:35.191520127 -0500
@@ -11,6 +11,7 @@
#ifndef COMMON_VIDEO_H264_SPS_PARSER_H_
#define COMMON_VIDEO_H264_SPS_PARSER_H_
+#include <cstdint>
#include "absl/types/optional.h"
#include "rtc_base/bitstream_reader.h"
diff -up chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h.missing-cstdint chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h
--- chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h.missing-cstdint 2021-11-12 05:28:10.000000000 -0500
+++ chromium-96.0.4664.45/third_party/webrtc/modules/include/module_common_types_public.h 2021-11-19 17:05:31.379750350 -0500
@@ -11,6 +11,7 @@
#ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_
#define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_
+#include <cstdint>
#include <limits>
#include "absl/types/optional.h"
diff -up chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h.missing-cstdint chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h
--- chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h.missing-cstdint 2021-11-12 05:25:24.000000000 -0500
+++ chromium-96.0.4664.45/ui/gfx/linux/drm_util_linux.h 2021-11-19 17:05:31.379750350 -0500
@@ -9,6 +9,8 @@
#include "ui/gfx/buffer_types.h"
+#include <cstdint>
+
namespace ui {
int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format);

@ -0,0 +1,24 @@
diff -up chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc
--- chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc.missing-cstring 2021-11-12 05:28:09.000000000 -0500
+++ chromium-96.0.4664.45/third_party/webrtc/audio/utility/channel_mixer.cc 2021-11-19 17:10:02.927438695 -0500
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <cstring>
+
#include "audio/utility/channel_mixer.h"
#include "audio/utility/channel_mixing_matrix.h"
diff -up chromium-96.0.4664.45/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
diff -up chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc
--- chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-cstring 2021-11-12 05:28:10.000000000 -0500
+++ chromium-96.0.4664.45/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc 2021-11-19 17:10:02.928438701 -0500
@@ -10,6 +10,7 @@
#include "modules/video_coding/utility/ivf_file_reader.h"
+#include <cstring>
#include <string>
#include <vector>

@ -0,0 +1,20 @@
diff -up chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc.erase-fix chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc
--- chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc.erase-fix 2022-02-03 19:16:57.784979831 +0000
+++ chromium-98.0.4758.80/components/ui_devtools/views/ui_element_with_metadata.cc 2022-02-03 19:17:12.983633352 +0000
@@ -19,14 +19,14 @@ namespace {
// Remove any custom editor "prefixes" from the property name. The prefixes must
// not be valid identifier characters.
void StripPrefix(std::string& property_name) {
- auto cur = property_name.cbegin();
+ auto cur = property_name.begin();
for (; cur < property_name.cend(); ++cur) {
if ((*cur >= 'A' && *cur <= 'Z') || (*cur >= 'a' && *cur <= 'z') ||
*cur == '_') {
break;
}
}
- property_name.erase(property_name.cbegin(), cur);
+ property_name.erase(property_name.begin(), cur);
}
} // namespace

@ -0,0 +1,26 @@
diff -up chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h.el7-extra-operator-equalequal chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h
--- chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h.el7-extra-operator-equalequal 2022-03-05 18:37:25.979241754 -0500
+++ chromium-99.0.4844.51/base/allocator/partition_allocator/starscan/metadata_allocator.h 2022-03-05 18:37:25.979241754 -0500
@@ -39,6 +39,11 @@ class MetadataAllocator {
}
template <typename U>
+ bool operator==(const MetadataAllocator<U>&) const {
+ return true;
+ }
+
+ template <typename U>
bool operator!=(const MetadataAllocator<U>& o) {
return !operator==(o);
}
diff -up chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h.el7-extra-operator-equalequal chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h
--- chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h.el7-extra-operator-equalequal 2022-03-06 19:14:20.892513442 -0500
+++ chromium-99.0.4844.51/third_party/pdfium/core/fxcrt/fx_memory_wrappers.h 2022-03-06 19:15:40.412060574 -0500
@@ -70,6 +70,7 @@ struct FxPartitionAllocAllocator {
}
// There's no state, so they are all the same,
+ bool operator==(const FxPartitionAllocAllocator&) const { return true; }
bool operator==(const FxPartitionAllocAllocator& that) { return true; }
bool operator!=(const FxPartitionAllocAllocator& that) { return false; }
};

@ -0,0 +1,142 @@
diff -up chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.cc
--- chromium-99.0.4844.51/printing/backend/cups_helper.cc.el7cups 2022-02-28 19:05:55.000000000 -0500
+++ chromium-99.0.4844.51/printing/backend/cups_helper.cc 2022-03-05 15:17:45.516887985 -0500
@@ -34,18 +34,6 @@ namespace printing {
// This section contains helper code for PPD parsing for semantic capabilities.
namespace {
-// Function availability can be tested by checking whether its address is not
-// nullptr. Weak symbols remove the need for platform specific build flags and
-// allow for appropriate CUPS usage on platforms with non-uniform version
-// support, namely Linux.
-#define WEAK_CUPS_FN(x) extern "C" __attribute__((weak)) decltype(x) x
-
-WEAK_CUPS_FN(httpConnect2);
-
-// Timeout for establishing a CUPS connection. It is expected that cupsd is
-// able to start and respond on all systems within this duration.
-constexpr base::TimeDelta kCupsTimeout = base::Seconds(5);
-
// CUPS default max copies value (parsed from kCupsMaxCopies PPD attribute).
constexpr int32_t kDefaultMaxCopies = 9999;
constexpr char kCupsMaxCopies[] = "cupsMaxCopies";
@@ -527,8 +515,7 @@ const int kDefaultIPPServerPort = 631;
// Helper wrapper around http_t structure, with connection and cleanup
// functionality.
HttpConnectionCUPS::HttpConnectionCUPS(const GURL& print_server_url,
- http_encryption_t encryption,
- bool blocking)
+ http_encryption_t encryption)
: http_(nullptr) {
// If we have an empty url, use default print server.
if (print_server_url.is_empty())
@@ -538,17 +525,10 @@ HttpConnectionCUPS::HttpConnectionCUPS(c
if (port == url::PORT_UNSPECIFIED)
port = kDefaultIPPServerPort;
- if (httpConnect2) {
- http_ = httpConnect2(print_server_url.host().c_str(), port,
- /*addrlist=*/nullptr, AF_UNSPEC, encryption,
- blocking ? 1 : 0, kCupsTimeout.InMilliseconds(),
- /*cancel=*/nullptr);
- } else {
- // Continue to use deprecated CUPS calls because because older Linux
- // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6.
- http_ =
- httpConnectEncrypt(print_server_url.host().c_str(), port, encryption);
- }
+ // Continue to use deprecated CUPS calls because because older Linux
+ // distribution such as RHEL/CentOS 7 are shipped with CUPS 1.6.
+ http_ =
+ httpConnectEncrypt(print_server_url.host().c_str(), port, encryption);
if (!http_) {
LOG(ERROR) << "CP_CUPS: Failed connecting to print server: "
@@ -556,8 +536,6 @@ HttpConnectionCUPS::HttpConnectionCUPS(c
return;
}
- if (!httpConnect2)
- httpBlocking(http_, blocking ? 1 : 0);
}
HttpConnectionCUPS::~HttpConnectionCUPS() {
@@ -565,6 +543,10 @@ HttpConnectionCUPS::~HttpConnectionCUPS(
httpClose(http_);
}
+void HttpConnectionCUPS::SetBlocking(bool blocking) {
+ httpBlocking(http_, blocking ? 1 : 0);
+}
+
http_t* HttpConnectionCUPS::http() {
return http_;
}
diff -up chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups chromium-99.0.4844.51/printing/backend/cups_helper.h
--- chromium-99.0.4844.51/printing/backend/cups_helper.h.el7cups 2022-02-28 19:05:55.000000000 -0500
+++ chromium-99.0.4844.51/printing/backend/cups_helper.h 2022-03-05 15:17:45.517887991 -0500
@@ -34,10 +34,11 @@ constexpr cups_ptype_t kDestinationsFilt
class COMPONENT_EXPORT(PRINT_BACKEND) HttpConnectionCUPS {
public:
HttpConnectionCUPS(const GURL& print_server_url,
- http_encryption_t encryption,
- bool blocking);
+ http_encryption_t encryption);
~HttpConnectionCUPS();
+ void SetBlocking(bool blocking);
+
http_t* http();
private:
diff -up chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups chromium-99.0.4844.51/printing/backend/print_backend_cups.cc
--- chromium-99.0.4844.51/printing/backend/print_backend_cups.cc.el7cups 2022-02-28 19:05:55.000000000 -0500
+++ chromium-99.0.4844.51/printing/backend/print_backend_cups.cc 2022-03-05 15:17:45.517887991 -0500
@@ -146,7 +146,7 @@ mojom::ResultCode PrintBackendCUPS::Enum
// not showing as available. Using cupsEnumDests() allows us to do our own
// filtering should any duplicates occur.
CupsDestsData dests_data = {0, nullptr};
- ipp_status_t last_error = IPP_STATUS_OK;
+ ipp_status_t last_error = IPP_OK;
if (print_server_url_.is_empty()) {
VLOG(1) << "CUPS: using cupsEnumDests to enumerate printers";
if (!cupsEnumDests(CUPS_DEST_FLAGS_NONE, kCupsTimeoutMs,
@@ -173,7 +173,7 @@ mojom::ResultCode PrintBackendCUPS::Enum
// no printer drivers installed. Rely upon CUPS error code to distinguish
// between these.
DCHECK(!dests_data.dests);
- if (last_error != IPP_STATUS_ERROR_NOT_FOUND) {
+ if (last_error != IPP_NOT_FOUND) {
VLOG(1) << "CUPS: Error getting printers from CUPS server"
<< ", server: " << print_server_url_
<< ", error: " << static_cast<int>(last_error) << " - "
@@ -336,7 +336,8 @@ int PrintBackendCUPS::GetDests(cups_dest
if (print_server_url_.is_empty())
return cupsGetDests2(CUPS_HTTP_DEFAULT, dests);
- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_);
+ HttpConnectionCUPS http(print_server_url_, cups_encryption_);
+ http.SetBlocking(blocking_);
// This call must be made in the same scope as `http` because its destructor
// closes the connection.
@@ -362,7 +363,8 @@ base::FilePath PrintBackendCUPS::GetPPD(
// connection will timeout after 10 seconds of no data period. And it will
// return the same way as if data was completely and successfully
// downloaded.
- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_);
+ HttpConnectionCUPS http(print_server_url_, cups_encryption_);
+ http.SetBlocking(blocking_);
ppd_file_path = cupsGetPPD2(http.http(), name);
// Check if the get full PPD, since non-blocking call may simply return
// normally after timeout expired.
@@ -398,7 +400,8 @@ PrintBackendCUPS::ScopedDestination Prin
// Use default (local) print server.
dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, printer_name.c_str(), nullptr);
} else {
- HttpConnectionCUPS http(print_server_url_, cups_encryption_, blocking_);
+ HttpConnectionCUPS http(print_server_url_, cups_encryption_);
+ http.SetBlocking(blocking_);
dest = cupsGetNamedDest(http.http(), printer_name.c_str(), nullptr);
}
return ScopedDestination(dest);

@ -25,6 +25,15 @@ else
[ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list" [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
fi fi
# Always use our versions of ffmpeg libs.
# This also makes RPMs find the compatibly-named library symlinks.
if [[ -n "$LD_LIBRARY_PATH" ]]; then
LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
else
LD_LIBRARY_PATH="$HERE:$HERE/lib"
fi
export LD_LIBRARY_PATH
export CHROME_VERSION_EXTRA="Built from source for @@BUILD_TARGET@@" export CHROME_VERSION_EXTRA="Built from source for @@BUILD_TARGET@@"
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
@ -39,6 +48,7 @@ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
--enable-extensions \ --enable-extensions \
--enable-user-scripts \ --enable-user-scripts \
--enable-printing \ --enable-printing \
--enable-gpu-rasterization \
--enable-sync \ --enable-sync \
--auto-ssl-client-auth @@EXTRA_FLAGS@@" --auto-ssl-client-auth @@EXTRA_FLAGS@@"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save