Commit af73a263 authored by Timothy Pearson's avatar Timothy Pearson
Browse files

Initial import of patchset for Chromium 126.0.6478.57

parents
=================================================================================
APPLICATION
export QUILT_PATCHES=patches
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
quilt push -a
=================================================================================
NOTE
The Ungoogled patches are modified to apply to a stock Debian Chromium tree,
without any other Ungoogled patches applied. Typically, this means that the
following patches must be removed from the Debian patch series and reverted
from the source tree before this repository can be used:
* ungoogled/disable-privacy-sandbox.patch
Be aware that since Debian already carries cookie deactivation patches the
associated patch in the Ungoogled tree has also been removed. If you are
considering applying this Ungoogled patch series to a non-Debian Chromium tree,
it may be a good idea to use the upstream Ungoogled patch series as a starting
point instead of this patch series.
If building a Debian package, safe_browsing_mode=0 will need to be set in the
debian/rules file.
Index: chromium-126.0.6478.57/build/config/compiler/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/build/config/compiler/BUILD.gn
+++ chromium-126.0.6478.57/build/config/compiler/BUILD.gn
@@ -1425,7 +1425,7 @@ config("compiler_cpu_abi") {
cflags += [ "-maix64" ]
ldflags += [ "-maix64" ]
} else {
- cflags += [ "-m64" ]
+ cflags += [ "-m64", "-mcpu=power9", "-mtune=power9" ]
ldflags += [ "-m64" ]
}
} else if (current_cpu == "riscv64") {
Index: chromium-126.0.6478.57/third_party/libvpx/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/third_party/libvpx/BUILD.gn
+++ chromium-126.0.6478.57/third_party/libvpx/BUILD.gn
@@ -97,7 +97,7 @@ config("libvpx_config") {
if (current_cpu == "ppc64") {
cflags += [
- "-mcpu=power8",
+ "-mcpu=power9",
"-maltivec",
"-mvsx",
]
Index: chromium-126.0.6478.57/v8/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/v8/BUILD.gn
+++ chromium-126.0.6478.57/v8/BUILD.gn
@@ -1415,7 +1415,7 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_PPC_LE" ]
cflags += [
# Enable usage of AltiVec, VSX, and other POWER8 and higher features
- "-mcpu=power8",
+ "-mcpu=power9",
"-maltivec",
"-mvsx",
]
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-126.0.6478.57/third_party/crashpad/crashpad/compat/linux/sys/user.h
===================================================================
--- chromium-126.0.6478.57.orig/third_party/crashpad/crashpad/compat/linux/sys/user.h
+++ chromium-126.0.6478.57/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>
From bfdb97e53b1b6d037d00711f4601aabf167dbfbf Mon Sep 17 00:00:00 2001
From: Shawn Anastasio <shawnanastasio@yahoo.com>
Date: Sat, 1 Sep 2018 16:43:48 -0500
Subject: [PATCH] Add support for ppc64
---
chromium/scripts/build_ffmpeg.py | 11 +++++++++--
chromium/scripts/copy_config.sh | 2 +-
chromium/scripts/generate_gn.py | 2 +-
chromium/scripts/generate_gn_unittest.py | 10 ++++++++--
4 files changed, 19 insertions(+), 6 deletions(-)
Index: chromium-126.0.6478.57/third_party/ffmpeg/chromium/scripts/generate_gn.py
===================================================================
--- chromium-126.0.6478.57.orig/third_party/ffmpeg/chromium/scripts/generate_gn.py
+++ chromium-126.0.6478.57/third_party/ffmpeg/chromium/scripts/generate_gn.py
@@ -77,7 +77,7 @@ GN_SOURCE_END = """]
_Attrs = ('ARCHITECTURE', 'TARGET', 'PLATFORM')
Attr = collections.namedtuple('Attr', _Attrs)(*_Attrs)
SUPPORT_MATRIX = {
- Attr.ARCHITECTURE: set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon']),
+ Attr.ARCHITECTURE: set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'ppc64']),
Attr.TARGET: set(['Chromium', 'Chrome', 'ChromeOS']),
Attr.PLATFORM: set(['android', 'linux', 'win', 'mac'])
}
Index: chromium-126.0.6478.57/third_party/breakpad/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/third_party/breakpad/BUILD.gn
+++ chromium-126.0.6478.57/third_party/breakpad/BUILD.gn
@@ -620,7 +620,6 @@ if (is_linux || is_chromeos || is_androi
"breakpad/src/client/minidump_file_writer.h",
"breakpad/src/common/convert_UTF.cc",
"breakpad/src/common/convert_UTF.h",
- "breakpad/src/common/linux/breakpad_getcontext.S",
"breakpad/src/common/linux/elf_core_dump.cc",
"breakpad/src/common/linux/elf_core_dump.h",
"breakpad/src/common/linux/elfutils.cc",
@@ -652,6 +651,8 @@ if (is_linux || is_chromeos || is_androi
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":client_config" ]
+ defines = [ "HAVE_GETCONTEXT" ]
+
if (current_cpu == "arm" && is_chromeos_ash) {
# Avoid running out of registers in
# linux_syscall_support.h:sys_clone()'s inline assembly.
@@ -709,7 +710,6 @@ if (is_linux || is_chromeos || is_androi
"breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc",
"breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc",
"breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc",
- "breakpad/src/common/linux/breakpad_getcontext_unittest.cc",
"breakpad/src/common/linux/elf_core_dump_unittest.cc",
"breakpad/src/common/linux/file_id_unittest.cc",
"breakpad/src/common/linux/linux_libc_support_unittest.cc",
Index: chromium-126.0.6478.57/build/config/BUILDCONFIG.gn
===================================================================
--- chromium-126.0.6478.57.orig/build/config/BUILDCONFIG.gn
+++ chromium-126.0.6478.57/build/config/BUILDCONFIG.gn
@@ -138,7 +138,6 @@ declare_args() {
# Set to true when compiling with the Clang compiler.
is_clang = current_os != "linux" ||
(current_cpu != "s390x" && current_cpu != "s390" &&
- current_cpu != "ppc64" && current_cpu != "ppc" &&
current_cpu != "mips" && current_cpu != "mips64" &&
current_cpu != "riscv64")
kIndex: chromium-114.0.5735.45/base/allocator/partition_allocator/partition_alloc.gni
===================================================================
Index: chromium-126.0.6478.57/base/allocator/partition_allocator/partition_alloc.gni
===================================================================
--- chromium-126.0.6478.57.orig/base/allocator/partition_allocator/partition_alloc.gni
+++ chromium-126.0.6478.57/base/allocator/partition_allocator/partition_alloc.gni
@@ -21,7 +21,8 @@ if (is_nacl) {
# NaCl targets don't use 64-bit pointers.
has_64_bit_pointers = false
} else if (current_cpu == "x64" || current_cpu == "arm64" ||
- current_cpu == "loong64" || current_cpu == "riscv64") {
+ current_cpu == "loong64" || current_cpu == "riscv64" ||
+ current_cpu == "ppc64") {
has_64_bit_pointers = true
} else if (current_cpu == "x86" || current_cpu == "arm") {
has_64_bit_pointers = false
Index: chromium-126.0.6478.57/build/toolchain/gcc_toolchain.gni
===================================================================
--- chromium-126.0.6478.57.orig/build/toolchain/gcc_toolchain.gni
+++ chromium-126.0.6478.57/build/toolchain/gcc_toolchain.gni
@@ -457,7 +457,13 @@ template("single_gcc_toolchain") {
# -soname flag is not available on aix ld
soname_flag = "-Wl,-soname=\"$soname\""
}
- link_command = "$ld -shared $soname_flag {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\" {{rlibs}}"
+ if (target_cpu == "ppc64") {
+ # Work around linker failures due to Rust libraries and the use of whole-archive
+ link_command = "$ld -shared $soname_flag -Wl,--start-group {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\" {{rlibs}} -Wl,--end-group"
+ }
+ else {
+ link_command = "$ld -shared $soname_flag {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" @\"$rspfile\" {{rlibs}}"
+ }
# Generate a map file to be used for binary size analysis.
# Map file adds ~10% to the link time on a z620.
@@ -569,7 +575,13 @@ template("single_gcc_toolchain") {
whole_archive_flag = "-Wl,--whole-archive"
no_whole_archive_flag = "-Wl,--no-whole-archive"
}
- command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" $soname_flag @\"$rspfile\""
+ if (target_cpu == "ppc64") {
+ # Work around linker failures due to Rust libraries and the use of whole-archive
+ command = "$ld -shared -Wl,--start-group {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" $soname_flag @\"$rspfile\" -Wl,--end-group"
+ }
+ else {
+ command = "$ld -shared {{ldflags}}${extra_ldflags} -o \"$unstripped_sofile\" $soname_flag @\"$rspfile\""
+ }
if (defined(invoker.strip)) {
strip_command = "${invoker.strip} -o \"$sofile\" \"$unstripped_sofile\""
@@ -629,7 +641,13 @@ template("single_gcc_toolchain") {
start_group_flag = "-Wl,--start-group"
end_group_flag = "-Wl,--end-group "
}
- link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" {{solibs}} $end_group_flag {{libs}} {{rlibs}}"
+ if (target_cpu == "ppc64") {
+ # Work around linker failures due to Rust libraries and the use of whole-archive
+ link_command = "$ld -Wl,--start-group {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" @\"$rspfile\" {{solibs}} {{libs}} {{rlibs}} -Wl,--end-group"
+ }
+ else {
+ link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" {{solibs}} $end_group_flag {{libs}} {{rlibs}}"
+ }
# Generate a map file to be used for binary size analysis.
# Map file adds ~10% to the link time on a z620.
author: Andres Salomon <dilinger@debian.org>
description: allow ppc64le to build by using proper rustc target
Index: chromium-126.0.6478.57/build/config/rust.gni
===================================================================
--- chromium-126.0.6478.57.orig/build/config/rust.gni
+++ chromium-126.0.6478.57/build/config/rust.gni
@@ -190,6 +190,8 @@ rust_abi_target = ""
if (is_linux || is_chromeos) {
if (current_cpu == "arm64") {
rust_abi_target = "aarch64-unknown-linux-gnu"
+ } else if (current_cpu == "ppc64") {
+ rust_abi_target = "powerpc64le-unknown-linux-gnu"
} else if (current_cpu == "x86") {
rust_abi_target = "i686-unknown-linux-gnu"
} else if (current_cpu == "x64") {
Index: chromium-126.0.6478.57/build/config/compiler/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/build/config/compiler/BUILD.gn
+++ chromium-126.0.6478.57/build/config/compiler/BUILD.gn
@@ -1789,7 +1789,7 @@ config("default_warnings") {
# -Wno-class-memaccess warns about hash table and vector in blink.
# But the violation is intentional.
- if (!is_nacl) {
+ if ((!is_nacl) && (current_cpu != "ppc64")) {
cflags_cc += [ "-Wno-class-memaccess" ]
}
@@ -1799,7 +1799,9 @@ config("default_warnings") {
# Don't warn about "maybe" uninitialized. Clang doesn't include this
# in -Wall but gcc does, and it gives false positives.
- cflags += [ "-Wno-maybe-uninitialized" ]
+ if (current_cpu != "ppc64") {
+ cflags += [ "-Wno-maybe-uninitialized" ]
+ }
cflags += [ "-Wno-deprecated-declarations" ]
# -Wcomment gives too many false positives in the case a
@@ -1810,7 +1812,9 @@ config("default_warnings") {
# -Wpacked-not-aligned complains all generated mojom-shared-internal.h
# files.
- cflags += [ "-Wno-packed-not-aligned" ]
+ if (current_cpu != "ppc64") {
+ cflags += [ "-Wno-packed-not-aligned" ]
+ }
}
}
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-126.0.6478.57/third_party/libaom/BUILD.gn
===================================================================
--- chromium-126.0.6478.57.orig/third_party/libaom/BUILD.gn
+++ chromium-126.0.6478.57/third_party/libaom/BUILD.gn
@@ -272,6 +272,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) {
@@ -335,6 +347,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-126.0.6478.57/third_party/libaom/cmake_update.sh
===================================================================
--- chromium-126.0.6478.57.orig/third_party/libaom/cmake_update.sh
+++ chromium-126.0.6478.57/third_party/libaom/cmake_update.sh
@@ -192,6 +192,9 @@ gen_config_files linux/arm64-cpu-detect
"${toolchain}/arm64-linux-gcc.cmake -DCONFIG_RUNTIME_CPU_DETECT=1 \
${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"/* \
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-126.0.6478.57/sandbox/linux/seccomp-bpf/trap.cc
===================================================================
--- chromium-126.0.6478.57.orig/sandbox/linux/seccomp-bpf/trap.cc
+++ chromium-126.0.6478.57/sandbox/linux/seccomp-bpf/trap.cc
@@ -231,6 +231,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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment