summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--0001-Fix-error-call-to-function-memmove-that-is-neither-v.patch22
-rw-r--r--0001-Fix-no-template-named-optional-in-namespace-std.patch21
-rw-r--r--INSTALL.sh148
-rw-r--r--bubble-contents.patch29
-rw-r--r--chrome-wrapper38
-rw-r--r--chromium-102-regex_pattern-array.patch16
-rw-r--r--chromium-106-ffmpeg-duration.patch17
-rw-r--r--chromium-117-string-convert.patch21
-rw-r--r--chromium-119-assert.patch12
-rw-r--r--chromium-120-make_unique-struct.patch12
-rw-r--r--chromium-121-rust-clang_lib.patch68
-rw-r--r--chromium-123-missing-QtGui.patch12
-rw-r--r--chromium-125-compiler.patch277
-rw-r--r--chromium-125-disable-FFmpegAllowLists.patch12
-rw-r--r--chromium-125-lp155-typename.patch350
-rw-r--r--chromium-126-quiche-interator.patch12
-rw-r--r--chromium-127-bindgen.patch108
-rw-r--r--chromium-127-clang17-traitors.patch285
-rw-r--r--chromium-127-constexpr.patch93
-rw-r--r--chromium-127-rust-clanglib.patch22
-rw-r--r--chromium-91-java-only-allowed-in-android-builds.patch16
-rw-r--r--chromium-disable-GlobalMediaControlsCastStartStop.patch13
-rw-r--r--chromium-libusb_interrupt_event_handler.patch15
-rw-r--r--chromium-master-prefs-path.patch16
-rw-r--r--chromium-norar.patch12
-rw-r--r--chromium-prop-codecs.patch17
-rw-r--r--chromium-symbolic.svg30
-rw-r--r--chromium.spec955
-rw-r--r--emplace.patch79
-rw-r--r--fix_building_widevinecdm_with_chromium.patch11
-rw-r--r--gcc-enable-lto.patch70
-rw-r--r--gn-absl.patch174
-rw-r--r--gn-funcs.patch80
-rw-r--r--master_preferences30
-rw-r--r--riscv-cpuinfo.patch32
-rw-r--r--riscv-dav1d.patch53
-rw-r--r--riscv-sandbox.patch2043
-rw-r--r--riscv-swiftshader.patch25
-rw-r--r--riscv-v8.patch27
-rw-r--r--sources2
-rw-r--r--system-libdrm.patch42
-rw-r--r--use-of-undeclared-identifier-memset.patch31
43 files changed, 5350 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..2c4a70f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/chromium-128.0.6613.119.tar.xz
+/esbuild.tar.gz
diff --git a/0001-Fix-error-call-to-function-memmove-that-is-neither-v.patch b/0001-Fix-error-call-to-function-memmove-that-is-neither-v.patch
new file mode 100644
index 0000000..bb9f99a
--- /dev/null
+++ b/0001-Fix-error-call-to-function-memmove-that-is-neither-v.patch
@@ -0,0 +1,22 @@
+From 00921a941f3b5bdde37d15d59208cdc5b25dd576 Mon Sep 17 00:00:00 2001
+From: misaka00251 <liuxin@iscas.ac.cn>
+Date: Wed, 25 Sep 2024 20:51:15 +0800
+Subject: [PATCH] Fix error: call to function 'memmove' that is neither visible
+ in the template definition nor found by argument-dependent lookup
+
+
+diff --git a/base/containers/span.h b/base/containers/span.h
+index 6fc6e8a641..2a26acc58f 100644
+--- a/base/containers/span.h
++++ b/base/containers/span.h
+@@ -18,6 +18,7 @@
+ #include <span>
+ #include <type_traits>
+ #include <utility>
++#include <cstring>
+
+ #include "base/check.h"
+ #include "base/compiler_specific.h"
+--
+2.46.1
+
diff --git a/0001-Fix-no-template-named-optional-in-namespace-std.patch b/0001-Fix-no-template-named-optional-in-namespace-std.patch
new file mode 100644
index 0000000..d9fe826
--- /dev/null
+++ b/0001-Fix-no-template-named-optional-in-namespace-std.patch
@@ -0,0 +1,21 @@
+From e9269478656835e1313aad6d33628677994090d5 Mon Sep 17 00:00:00 2001
+From: misaka00251 <liuxin@iscas.ac.cn>
+Date: Thu, 26 Sep 2024 16:53:50 +0800
+Subject: [PATCH] Fix no template named optional in namespace std
+
+
+diff --git a/components/enterprise/connectors/common.h b/components/enterprise/connectors/common.h
+index ed56eecf25..f2bd853ebb 100644
+--- a/components/enterprise/connectors/common.h
++++ b/components/enterprise/connectors/common.h
+@@ -10,6 +10,7 @@
+ #include <string>
+ #include <utility>
+ #include <vector>
++#include <optional>
+
+ #include "base/files/file_path.h"
+ #include "base/supports_user_data.h"
+--
+2.46.1
+
diff --git a/INSTALL.sh b/INSTALL.sh
new file mode 100644
index 0000000..8491753
--- /dev/null
+++ b/INSTALL.sh
@@ -0,0 +1,148 @@
+#!/bin/bash
+set -x
+while getopts s:o:l:i: option
+do
+case "${option}" in
+s) STAGEDIR=${OPTARG};;
+o) OUTPUTDIR=${OPTARG};;
+l) LIBDIR=${OPTARG};;
+i) ICUDATAFILE=${OPTARG};;
+esac
+done
+SHLIB_PERMS="755"
+PROGNAME="chrome"
+PACKAGE="chromium-browser"
+MENUNAME="Chromium Web Browser"
+CHANNEL="stable"
+INSTALLDIR="${LIBDIR}/chromium"
+
+install -m 755 -d \
+ "${STAGEDIR}/${INSTALLDIR}" \
+ "${STAGEDIR}/usr/bin" \
+ "${STAGEDIR}/usr/share/applications" \
+ "${STAGEDIR}/usr/share/metainfo" \
+ "${STAGEDIR}/usr/share/man/man1"
+
+# app
+buildfile="${OUTPUTDIR}/${PROGNAME}"
+install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}"
+
+# crashpad
+buildfile="${OUTPUTDIR}/chrome_crashpad_handler"
+install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/chrome_crashpad_handler"
+
+# resources
+install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
+install -m 644 "${OUTPUTDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
+install -m 644 "${OUTPUTDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
+
+# ICU data file; Necessary when the GN icu_use_data_file flag is true.
+if [ "x$ICUDATAFILE" == "xtrue" ]; then
+ install -m 644 "${OUTPUTDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/"
+fi
+
+# V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
+ # is true.
+ # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
+ # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
+install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
+
+# l10n paks
+install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/locales/"
+find "${OUTPUTDIR}/locales" -type f -name '*.pak' -print -exec \
+ cp -a {} "${STAGEDIR}/${INSTALLDIR}/locales/" \;
+find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -print -exec chmod 644 {} \;
+
+# ANGLE
+if [ -f "${OUTPUTDIR}/libEGL.so" ]; then
+ for file in libEGL.so libGLESv2.so;
+ do
+ buildfile="${OUTPUTDIR}/${file}"
+ install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
+ done
+fi
+
+# ANGLE's libvulkan library
+if [ -f "${OUTPUTDIR}/libvulkan.so.1" ]; then
+ file="libvulkan.so.1"
+ buildfile="${OUTPUTDIR}/${file}"
+ install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
+fi
+
+# SwiftShader ES
+if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then
+ install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
+ for file in libEGL.so libGLESv2.so;
+ do
+ buildfile="${OUTPUTDIR}/swiftshader/${file}"
+ install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}"
+ done
+fi
+
+# SwiftShader VK
+if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then
+ install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/"
+ file="libvk_swiftshader.so"
+ buildfile="${OUTPUTDIR}/${file}"
+ install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
+fi
+sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > ${OUTPUTDIR}/vk_swiftshader_icd.json
+# Install the ICD json file to point ANGLE to libvk_swiftshader.so
+install -m 644 "${OUTPUTDIR}/vk_swiftshader_icd.json" "${STAGEDIR}/${INSTALLDIR}/"
+
+# QT shim
+if [ -f "${OUTPUTDIR}/libqt5_shim.so" ]; then
+ file="libqt5_shim.so"
+ buildfile="${OUTPUTDIR}/${file}"
+ install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
+fi
+
+# default apps
+if [ -d "${OUTPUTDIR}/default_apps" ]; then
+ cp -a "${OUTPUTDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/"
+ find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type d -exec chmod 755 '{}' \;
+ find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type f -exec chmod 644 '{}' \;
+fi
+
+# launcher script and symlink
+sed \
+ -e "s#@@PROGNAME@@#${PROGNAME}#g" \
+ -e "s#@@CHANNEL@@#${CHANNEL}#g" \
+ "chrome/installer/linux/common/wrapper" > "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper"
+chmod 755 "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper"
+ln -s "${INSTALLDIR}/chrome-wrapper" "${STAGEDIR}/usr/bin/${PACKAGE}"
+
+# app icons
+for size in 16 32;
+do
+ icon="chrome/app/theme/default_100_percent/chromium/product_logo_${size}.png"
+ installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png"
+ install -D -m 644 ${icon} ${installpath}
+done
+for size in 24 48 64 128 256;
+do
+ icon="chrome/app/theme/chromium/product_logo_${size}.png"
+ installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png"
+ install -D -m 644 ${icon} ${installpath}
+done
+
+# desktop integration
+## AppData
+install -m 644 "chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml" \
+"${STAGEDIR}/usr/share/metainfo/${PACKAGE}.appdata.xml"
+
+## Desktop file
+sed \
+ -e "s#@@MENUNAME@@#${MENUNAME}#g" \
+ -e "s#@@USR_BIN_SYMLINK_NAME@@#${PACKAGE}#g" \
+ -e "s#@@PACKAGE@@#${PACKAGE}#g" \
+ "chrome/installer/linux/common/desktop.template" > "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
+chmod 644 "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
+
+# documentation
+sed \
+ -e "s#@@MENUNAME@@#${MENUNAME}#g" \
+ -e "s#@@PACKAGE@@#${PACKAGE}#g" \
+ "chrome/app/resources/manpage.1.in" > "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
+gzip -9n "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1"
+chmod 644 "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz"
diff --git a/bubble-contents.patch b/bubble-contents.patch
new file mode 100644
index 0000000..5065b12
--- /dev/null
+++ b/bubble-contents.patch
@@ -0,0 +1,29 @@
+In file included from ../../chrome/browser/ui/commerce/commerce_ui_tab_helper.cc:28:
+In file included from ../../chrome/browser/ui/views/side_panel/side_panel_web_ui_view.h:12:
+../../chrome/browser/ui/views/bubble/bubble_contents_wrapper.h:153:9: error: static assertion expression is not an integral constant expression
+ views_metrics::IsValidWebUINameVariant("." + T::GetWebUIName()));
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:1065:34: note: in instantiation of member function 'BubbleContentsWrapperT<ShoppingInsightsSidePanelUI>::BubbleContentsWrapperT' requested here
+ { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
+ ^
+../../chrome/browser/ui/commerce/commerce_ui_tab_helper.cc:458:16: note: in instantiation of function template specialization 'std::make_unique<BubbleContentsWrapperT<ShoppingInsightsSidePanelUI>, GURL, Profile *, int, bool, bool>' requested here
+ std::make_unique<BubbleContentsWrapperT<ShoppingInsightsSidePanelUI>>(
+ ^
+/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_construct.h:97:14: note: construction of subobject of member '_M_local_buf' of union with active member '_M_allocated_capacity' is not allowed in a constant expression
+ { return ::new((void*)__location) _Tp(std::forward<_Args>(__args)...); }
+ ^
+/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/char_traits.h:351:4: note: in call to 'construct_at(&ShoppingInsightsSidePanelUI::GetWebUIName().._M_local_buf[0], char())'
+ std::construct_at(__builtin_addressof(__c1), __c2);
+ ^
+
+
+--- a/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h
++++ b/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h
+@@ -185,7 +185,6 @@ class WebUIContentsWrapperT : public Web
+ supports_draggable_regions,
+ T::GetWebUIName()),
+ webui_url_(webui_url) {
+- static_assert(views_metrics::IsValidWebUIName("." + T::GetWebUIName()));
+ if (is_ready_to_show()) {
+ CHECK(GetWebUIController());
+ GetWebUIController()->set_embedder(weak_ptr_factory_.GetWeakPtr());
diff --git a/chrome-wrapper b/chrome-wrapper
new file mode 100644
index 0000000..10e983d
--- /dev/null
+++ b/chrome-wrapper
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 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.
+
+# Let the wrapped binary know that it has been run through the wrapper.
+export CHROME_WRAPPER="`readlink -f "$0"`"
+
+HERE="`dirname "$CHROME_WRAPPER"`"
+
+# Always use our versions of ffmpeg libs.
+# This also makes RPMs find the compatibly-named library symlinks.
+export LD_LIBRARY_PATH="$HERE${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+
+export CHROME_VERSION_EXTRA="stable"
+
+# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
+export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
+
+# Allow root usage
+no_sandbox=
+if [ "`id -u`" == "0" ]; then
+ no_sandbox=--no-sandbox
+fi
+# If uname is riscv64, then allow usage too
+if [ "`uname -m`" == "riscv64" ]; then
+ no_sandbox=--no-sandbox
+fi
+
+# Sanitize std{in,out,err} because they'll be shared with untrusted child
+# processes (http://crbug.com/376567).
+exec < /dev/null
+exec > >(exec cat)
+exec 2> >(exec cat >&2)
+
+# Note: exec -a below is a bashism.
+exec -a "$0" "$HERE/chrome" $no_sandbox "$@"
diff --git a/chromium-102-regex_pattern-array.patch b/chromium-102-regex_pattern-array.patch
new file mode 100644
index 0000000..2931937
--- /dev/null
+++ b/chromium-102-regex_pattern-array.patch
@@ -0,0 +1,16 @@
+Index: chromium-123.0.6312.46/components/autofill/core/browser/BUILD.gn
+===================================================================
+--- chromium-123.0.6312.46.orig/components/autofill/core/browser/BUILD.gn
++++ chromium-123.0.6312.46/components/autofill/core/browser/BUILD.gn
+@@ -58,6 +58,11 @@ action("regex_patterns_inl_h") {
+ }
+
+ static_library("browser") {
++ if (is_clang) {
++ cflags = [
++ "-fbracket-depth=1000",
++ ]
++ }
+ sources = [
+ "address_data_cleaner.cc",
+ "address_data_cleaner.h",
diff --git a/chromium-106-ffmpeg-duration.patch b/chromium-106-ffmpeg-duration.patch
new file mode 100644
index 0000000..bef339e
--- /dev/null
+++ b/chromium-106-ffmpeg-duration.patch
@@ -0,0 +1,17 @@
+Index: chromium-106.0.5249.91/media/filters/audio_file_reader.cc
+===================================================================
+--- chromium-106.0.5249.91.orig/media/filters/audio_file_reader.cc
++++ chromium-106.0.5249.91/media/filters/audio_file_reader.cc
+@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame(
+ // silence from being output. In the case where we are also discarding some
+ // portion of the packet (as indicated by a negative pts), we further want to
+ // adjust the duration downward by however much exists before zero.
+- if (audio_codec_ == AudioCodec::kAAC && frame->duration) {
++ if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) {
+ const base::TimeDelta pkt_duration = ConvertFromTimeBase(
+ glue_->format_context()->streams[stream_index_]->time_base,
+- frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
++ frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts));
+ const base::TimeDelta frame_duration =
+ base::Seconds(frames_read / static_cast<double>(sample_rate_));
+
diff --git a/chromium-117-string-convert.patch b/chromium-117-string-convert.patch
new file mode 100644
index 0000000..cb48e4b
--- /dev/null
+++ b/chromium-117-string-convert.patch
@@ -0,0 +1,21 @@
+diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.cc.me chromium-117.0.5938.62/net/dns/host_resolver_cache.cc
+diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me chromium-117.0.5938.62/net/dns/host_resolver_cache.h
+--- chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me 2023-09-14 15:21:24.632965004 +0200
++++ chromium-117.0.5938.62/net/dns/host_resolver_cache.h 2023-09-15 09:15:48.511300845 +0200
+@@ -143,12 +143,14 @@ class NET_EXPORT HostResolverCache final
+ }
+
+ bool operator()(const Key& lhs, const KeyRef& rhs) const {
++ const std::string rhs_domain_name{rhs.domain_name};
+ return std::tie(lhs.domain_name, lhs.network_anonymization_key) <
+- std::tie(rhs.domain_name, *rhs.network_anonymization_key);
++ std::tie(rhs_domain_name, *rhs.network_anonymization_key);
+ }
+
+ bool operator()(const KeyRef& lhs, const Key& rhs) const {
+- return std::tie(lhs.domain_name, *lhs.network_anonymization_key) <
++ const std::string lhs_domain_name{lhs.domain_name};
++ return std::tie(lhs_domain_name, *lhs.network_anonymization_key) <
+ std::tie(rhs.domain_name, rhs.network_anonymization_key);
+ }
+ };
diff --git a/chromium-119-assert.patch b/chromium-119-assert.patch
new file mode 100644
index 0000000..6c502f1
--- /dev/null
+++ b/chromium-119-assert.patch
@@ -0,0 +1,12 @@
+diff -up chromium-119.0.6045.59/v8/src/base/small-vector.h.than chromium-119.0.6045.59/v8/src/base/small-vector.h
+--- chromium-119.0.6045.59/v8/src/base/small-vector.h.than 2023-11-01 16:13:12.645301345 +0100
++++ chromium-119.0.6045.59/v8/src/base/small-vector.h 2023-11-01 16:13:29.660610182 +0100
+@@ -22,7 +22,7 @@ template <typename T, size_t kSize, type
+ class SmallVector {
+ // Currently only support trivially copyable and trivially destructible data
+ // types, as it uses memcpy to copy elements and never calls destructors.
+- ASSERT_TRIVIALLY_COPYABLE(T);
++ //ASSERT_TRIVIALLY_COPYABLE(T);
+ static_assert(std::is_trivially_destructible<T>::value);
+
+ public:
diff --git a/chromium-120-make_unique-struct.patch b/chromium-120-make_unique-struct.patch
new file mode 100644
index 0000000..c848f46
--- /dev/null
+++ b/chromium-120-make_unique-struct.patch
@@ -0,0 +1,12 @@
+diff --git a/service_worker_global_scope.h b/service_worker_global_scope.h.new
+index ac4cac0..8c7d744 100644
+--- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h
++++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h
+@@ -777,6 +777,7 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final
+ blink::BlinkStorageKey storage_key_;
+
+ struct RaceNetworkRequestInfo {
++ RaceNetworkRequestInfo(int _fetch_event_id, String _token, mojo::PendingRemote<network::mojom::blink::URLLoaderFactory> _url_loader_factory) : fetch_event_id{_fetch_event_id}, token{_token}, url_loader_factory{std::move(_url_loader_factory)} {}
+ int fetch_event_id;
+ String token;
+ mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>
diff --git a/chromium-121-rust-clang_lib.patch b/chromium-121-rust-clang_lib.patch
new file mode 100644
index 0000000..0701fd2
--- /dev/null
+++ b/chromium-121-rust-clang_lib.patch
@@ -0,0 +1,68 @@
+From ce943790ea147d492f317097eb707745f78193a1 Mon Sep 17 00:00:00 2001
+From: misaka00251 <liuxin@iscas.ac.cn>
+Date: Fri, 29 Mar 2024 15:12:35 +0800
+Subject: [PATCH] Fix rust clang lib for openEuler
+
+---
+ build/config/clang/BUILD.gn | 31 +++++++++++++++++++++++++++++--
+ 1 file changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn
+index d3054d1..8b956ed 100644
+--- a/build/config/clang/BUILD.gn
++++ b/build/config/clang/BUILD.gn
+@@ -105,6 +105,7 @@ template("clang_lib") {
+ _prefix = "lib"
+ _suffix = ""
+ _ext = "a"
++ _libprefix = ""
+ if (is_win) {
+ _dir = "windows"
+ _prefix = ""
+@@ -120,7 +121,33 @@ template("clang_lib") {
+ }
+ } else if (is_apple) {
+ _dir = "darwin"
+- } else if (is_linux || is_chromeos) {
++ } else if (is_linux) {
++ _libprefix = "64"
++ if (current_cpu == "x64") {
++ if (clang_version == "17") {
++ _dir = "x86_64-openEuler-linux-gnu"
++ } else {
++ _dir = "linux"
++ _suffix ="-x86_64"
++ }
++ } else if (current_cpu == "arm64") {
++ if (clang_version == "17") {
++ _dir = "aarch64-openEuler-linux-gnu"
++ } else {
++ _dir = "linux"
++ _suffix = "-aarch64"
++ }
++ } else if (current_cpu == "riscv64") {
++ if (clang_version == "17") {
++ _dir = "riscv64-openEuler-linux-gnu"
++ } else {
++ _dir = "linux"
++ _suffix = "-riscv64"
++ }
++ } else {
++ assert(false) # Unhandled cpu type
++ }
++ } else if (is_chromeos) {
+ if (current_cpu == "x64") {
+ _dir = "x86_64-unknown-linux-gnu"
+ } else if (current_cpu == "x86") {
+@@ -159,7 +186,7 @@ template("clang_lib") {
+ assert(false) # Unhandled target platform
+ }
+
+- _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib"
++ _clang_lib_dir = "$clang_base_path/lib${_libprefix}/clang/$clang_version/lib/"
+ _lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}"
+ libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ]
+ }
+--
+2.39.3 (Apple Git-146)
+
diff --git a/chromium-123-missing-QtGui.patch b/chromium-123-missing-QtGui.patch
new file mode 100644
index 0000000..5260105
--- /dev/null
+++ b/chromium-123-missing-QtGui.patch
@@ -0,0 +1,12 @@
+diff --git a/ui/qt/BUILD.gn b/ui/qt/BUILD.gn.new
+index 2da7845..02ae3c8 100644
+--- a/ui/qt/BUILD.gn
++++ b/ui/qt/BUILD.gn
+@@ -61,6 +61,7 @@ template("qt_shim") {
+ packages = [
+ "Qt" + invoker.qt_version + "Core",
+ "Qt" + invoker.qt_version + "Widgets",
++ "Qt" + invoker.qt_version + "Gui",
+ ]
+ }
+
diff --git a/chromium-125-compiler.patch b/chromium-125-compiler.patch
new file mode 100644
index 0000000..a6322ae
--- /dev/null
+++ b/chromium-125-compiler.patch
@@ -0,0 +1,277 @@
+From 307a0f63dd9b118f4b8470ed3d7567e81fdb7a6d Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 15 Nov 2022 10:27:58 +0000
+Subject: [PATCH] Disable various compiler configs
+
+---
+ build/config/compiler/BUILD.gn | 134 +++++----------------------------
+ 1 file changed, 17 insertions(+), 117 deletions(-)
+
+Index: chromium-126.0.6478.8/build/config/compiler/BUILD.gn
+===================================================================
+--- chromium-126.0.6478.8.orig/build/config/compiler/BUILD.gn
++++ chromium-126.0.6478.8/build/config/compiler/BUILD.gn
+@@ -305,9 +305,7 @@ config("compiler") {
+
+ configs += [
+ # See the definitions below.
+- ":clang_revision",
+ ":rustc_revision",
+- ":compiler_cpu_abi",
+ ":compiler_codegen",
+ ":compiler_deterministic",
+ ]
+@@ -554,55 +554,6 @@ config("compiler") {
+ ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
+ }
+
+- if (is_clang && !is_nacl) {
+- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
+- if (save_reproducers_on_lld_crash && use_lld) {
+- ldflags += [
+- "-fcrash-diagnostics=all",
+- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir,
+- ]
+- }
+-
+- # TODO(hans): Remove this once Clang generates better optimized debug info
+- # by default. https://crbug.com/765793
+- cflags += [
+- "-mllvm",
+- "-instcombine-lower-dbg-declare=0",
+- ]
+- if (!is_debug && use_thin_lto && is_a_target_toolchain) {
+- if (is_win) {
+- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ]
+- } else {
+- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ]
+- }
+- }
+-
+- # TODO(crbug.com/40283598): This causes binary size growth and potentially
+- # other problems.
+- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version.
+- if (default_toolchain != "//build/toolchain/cros:target" &&
+- !llvm_android_mainline) {
+- cflags += [
+- "-mllvm",
+- "-split-threshold-for-reg-with-hint=0",
+- ]
+- if (use_thin_lto && is_a_target_toolchain) {
+- if (is_win) {
+- ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ]
+- } else {
+- ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ]
+- }
+- }
+- }
+-
+- # TODO(crbug.com/40192287): Investigate why/if this should be needed.
+- if (is_win) {
+- cflags += [ "/clang:-ffp-contract=off" ]
+- } else {
+- cflags += [ "-ffp-contract=off" ]
+- }
+- }
+-
+ # C11/C++11 compiler flags setup.
+ # ---------------------------
+ if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) ||
+@@ -1538,52 +1489,6 @@ config("compiler_deterministic") {
+ }
+ }
+
+- # Makes builds independent of absolute file path.
+- if (is_clang && strip_absolute_paths_from_debug_symbols) {
+- # If debug option is given, clang includes $cwd in debug info by default.
+- # For such build, this flag generates reproducible obj files even we use
+- # different build directory like "out/feature_a" and "out/feature_b" if
+- # we build same files with same compile flag.
+- # Other paths are already given in relative, no need to normalize them.
+- if (is_nacl) {
+- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
+- cflags += [
+- "-Xclang",
+- "-fdebug-compilation-dir",
+- "-Xclang",
+- ".",
+- ]
+- } else {
+- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
+- # and -fcoverage-compilation-dir=.
+- cflags += [ "-ffile-compilation-dir=." ]
+-
+- # Convert absolute paths to relative paths. Expands to, for example:
+- # -file-prefix-map /path/to/chromium/src=../..
+- swiftflags += [
+- "-file-prefix-map",
+- rebase_path("//.", "") + "=" + rebase_path("//.", root_build_dir),
+- ]
+- }
+- if (!is_win) {
+- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
+- asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
+- }
+-
+- if (is_win && use_lld) {
+- if (symbol_level == 2 || (is_clang && using_sanitizer)) {
+- # Absolutize source file paths for PDB. Pass the real build directory
+- # if the pdb contains source-level debug information and if linker
+- # reproducibility is not critical.
+- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ]
+- } else {
+- # Use a fake fixed base directory for paths in the pdb to make the pdb
+- # output fully deterministic and independent of the build directory.
+- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ]
+- }
+- }
+- }
+-
+ # Tells the compiler not to use absolute paths when passing the default
+ # paths to the tools it invokes. We don't want this because we don't
+ # really need it and it can mess up the RBE cache entries.
+@@ -1602,28 +1507,6 @@ config("compiler_deterministic") {
+ }
+ }
+
+-config("clang_revision") {
+- if (is_clang && clang_base_path == default_clang_base_path &&
+- current_os != "zos") {
+- update_args = [
+- "--print-revision",
+- "--verify-version=$clang_version",
+- ]
+- if (llvm_force_head_revision) {
+- update_args += [ "--llvm-force-head-revision" ]
+- }
+- clang_revision = exec_script("//tools/clang/scripts/update.py",
+- update_args,
+- "trim string")
+-
+- # This is here so that all files get recompiled after a clang roll and
+- # when turning clang on or off. (defines are passed via the command line,
+- # and build system rebuild things when their commandline changes). Nothing
+- # should ever read this define.
+- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ]
+- }
+-}
+-
+ config("rustc_revision") {
+ if (rustc_revision != "") {
+ # Similar to the above config, this is here so that all files get recompiled
+@@ -1983,10 +1871,6 @@ config("chromium_code") {
+ }
+ } else {
+ cflags = [ "-Wall" ]
+- if (is_clang) {
+- # Enable extra warnings for chromium_code when we control the compiler.
+- cflags += [ "-Wextra" ]
+- }
+
+ # In Chromium code, we define __STDC_foo_MACROS in order to get the
+ # C99 macros on Mac and Linux.
+@@ -1995,24 +1879,6 @@ config("chromium_code") {
+ "__STDC_FORMAT_MACROS",
+ ]
+
+- if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
+- current_cpu != "s390" && current_cpu != "ppc64" &&
+- current_cpu != "mips" && current_cpu != "mips64" &&
+- current_cpu != "riscv64" && current_cpu != "loong64") {
+- # Non-chromium code is not guaranteed to compile cleanly with
+- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
+- # disabled, so only do that for Release build.
+- fortify_level = "2"
+-
+- # ChromeOS's toolchain supports a high-quality _FORTIFY_SOURCE=3
+- # implementation with a few custom glibc patches. Use that if it's
+- # available.
+- if (is_chromeos_device && !lacros_use_chromium_toolchain) {
+- fortify_level = "3"
+- }
+- defines += [ "_FORTIFY_SOURCE=" + fortify_level ]
+- }
+-
+ if (is_apple) {
+ cflags_objc = [ "-Wimplicit-retain-self" ]
+ cflags_objcc = [ "-Wimplicit-retain-self" ]
+@@ -2442,7 +2325,8 @@ config("default_stack_frames") {
+ # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000
+ # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000
+ # [2]: https://crrev.com/c/5447532
+-config("optimize") {
++config("optimize") { }
++config("xoptimize") {
+ if (is_win) {
+ # clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for
+ # consistency with the other platforms.
+@@ -2450,7 +2317,8 @@ config("optimize") {
+ }
+
+ # Turn off optimizations.
+-config("no_optimize") {
++config("no_optimize") { }
++config("xno_optimize") {
+ if (is_win) {
+ cflags = [
+ "/Od", # Disable optimization.
+@@ -2490,7 +2358,8 @@ config("no_optimize") {
+ # Turns up the optimization level. Used to explicitly enable -O2 instead of
+ # -Os for select targets on platforms that use optimize_for_size. No-op
+ # elsewhere.
+-config("optimize_max") {
++config("optimize_max") { }
++config("xoptimize_max") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2523,7 +2392,8 @@ config("optimize_max") {
+ #
+ # TODO(crbug.com/41259697) - rework how all of these configs are related
+ # so that we don't need this disclaimer.
+-config("optimize_speed") {
++config("optimize_speed") { }
++config("xoptimize_speed") {
+ if (is_nacl && is_nacl_irt) {
+ # The NaCl IRT is a special case and always wants its own config.
+ # Various components do:
+@@ -2552,7 +2422,8 @@ config("optimize_speed") {
+ }
+ }
+
+-config("optimize_fuzzing") {
++config("optimize_fuzzing") { }
++config("xoptimize_fuzzing") {
+ cflags = [ "-O1" ] + common_optimize_on_cflags
+ rustflags = [ "-Copt-level=1" ]
+ ldflags = common_optimize_on_ldflags
+@@ -2685,7 +2556,8 @@ config("win_pdbaltpath") {
+ }
+
+ # Full symbols.
+-config("symbols") {
++config("symbols") { }
++config("xsymbols") {
+ rustflags = []
+ if (is_win) {
+ if (is_clang) {
+@@ -2835,7 +2707,8 @@ config("symbols") {
+ # Minimal symbols.
+ # This config guarantees to hold symbol for stack trace which are shown to user
+ # when crash happens in unittests running on buildbot.
+-config("minimal_symbols") {
++config("minimal_symbols") { }
++config("xminimal_symbols") {
+ rustflags = []
+ if (is_win) {
+ # Functions, files, and line tables only.
+@@ -2920,7 +2793,8 @@ config("minimal_symbols") {
+ # This configuration contains function names only. That is, the compiler is
+ # told to not generate debug information and the linker then just puts function
+ # names in the final debug information.
+-config("no_symbols") {
++config("no_symbols") { }
++config("xno_symbols") {
+ if (is_win) {
+ ldflags = [ "/DEBUG" ]
+
diff --git a/chromium-125-disable-FFmpegAllowLists.patch b/chromium-125-disable-FFmpegAllowLists.patch
new file mode 100644
index 0000000..72761b7
--- /dev/null
+++ b/chromium-125-disable-FFmpegAllowLists.patch
@@ -0,0 +1,12 @@
+diff -up chromium-122.0.6261.29/media/base/media_switches.cc.disable-FFmpegAllowLists chromium-122.0.6261.29/media/base/media_switches.cc
+--- chromium-122.0.6261.29/media/base/media_switches.cc.disable-FFmpegAllowLists 2024-02-12 15:56:50.703196471 +0100
++++ chromium-122.0.6261.29/media/base/media_switches.cc 2024-02-12 17:08:42.266076401 +0100
+@@ -1753,7 +1753,7 @@
+ // Enables FFmpeg allow lists for supported codecs / containers.
+ BASE_FEATURE(kFFmpegAllowLists,
+ "FFmpegAllowLists",
+- base::FEATURE_ENABLED_BY_DEFAULT);
++ base::FEATURE_DISABLED_BY_DEFAULT);
+
+ #if BUILDFLAG(IS_WIN)
+ // Enables audio offload when supported by endpoints.
diff --git a/chromium-125-lp155-typename.patch b/chromium-125-lp155-typename.patch
new file mode 100644
index 0000000..e1a4e48
--- /dev/null
+++ b/chromium-125-lp155-typename.patch
@@ -0,0 +1,350 @@
+
+fixed error: missing 'typename' prior to dependent type name
+
+Index: chromium-123.0.6312.46/base/containers/map_util.h
+===================================================================
+--- chromium-123.0.6312.46.orig/base/containers/map_util.h
++++ chromium-123.0.6312.46/base/containers/map_util.h
+@@ -42,7 +42,7 @@ constexpr internal::MappedType<Map>* Fin
+ template <typename Map,
+ typename Key,
+ typename MappedElementType =
+- std::pointer_traits<internal::MappedType<Map>>::element_type>
++ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
+ constexpr const MappedElementType* FindPtrOrNull(const Map& map,
+ const Key& key) {
+ auto it = map.find(key);
+@@ -60,7 +60,7 @@
+ template <typename Map,
+ typename Key,
+ typename MappedElementType =
+- std::pointer_traits<internal::MappedType<Map>>::element_type>
++ typename std::pointer_traits<internal::MappedType<Map>>::element_type>
+ constexpr MappedElementType* FindPtrOrNull(Map& map, const Key& key) {
+ auto it = map.find(key);
+ return it != map.end() ? base::to_address(it->second) : nullptr;
+Index: chromium-123.0.6312.46/base/functional/bind_internal.h
+===================================================================
+--- chromium-123.0.6312.46.orig/base/functional/bind_internal.h
++++ chromium-123.0.6312.46/base/functional/bind_internal.h
+@@ -1497,11 +1497,11 @@ template <int i,
+ typename Param>
+ struct ParamCanBeBound {
+ private:
+- using UnwrappedParam = BindArgument<i>::template ForwardedAs<
++ using UnwrappedParam = typename BindArgument<i>::template ForwardedAs<
+ Unwrapped>::template ToParamWithType<Param>;
+- using ParamStorage = BindArgument<i>::template ToParamWithType<
++ using ParamStorage = typename BindArgument<i>::template ToParamWithType<
+ Param>::template StoredAs<Storage>;
+- using BoundStorage =
++ using BoundStorage = typename
+ BindArgument<i>::template BoundAs<Arg>::template StoredAs<Storage>;
+
+ template <bool v = !UnwrappedParam::kRawPtr ||
+Index: chromium-123.0.6312.46/chrome/browser/download/bubble/download_bubble_update_service.cc
+===================================================================
+--- chromium-123.0.6312.46.orig/chrome/browser/download/bubble/download_bubble_update_service.cc
++++ chromium-123.0.6312.46/chrome/browser/download/bubble/download_bubble_update_service.cc
+@@ -90,7 +90,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);
+@@ -1090,9 +1090,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());
+Index: chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h
+===================================================================
+--- chromium-123.0.6312.46.orig/components/optimization_guide/core/tflite_model_executor.h
++++ chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h
+@@ -242,7 +242,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_);
+@@ -264,7 +264,7 @@ class TFLiteModelExecutor : public Model
+ // Starts the synchronous execution of the model. Returns model outputs.
+ // Model needs to be loaded. Synchronous calls do not load or unload model.
+ std::vector<std::optional<OutputType>> SendForBatchExecutionSync(
+- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
++ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs)
+ override {
+ DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+@@ -422,7 +422,7 @@ class TFLiteModelExecutor : public Model
+ // executes it on the model execution thread.
+ void LoadModelFileAndBatchExecute(
+ BatchExecutionCallback callback_on_complete,
+- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
++ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs) {
+ DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+
+@@ -439,7 +439,7 @@ class TFLiteModelExecutor : public Model
+
+ // Batch executes the loaded model for inputs.
+ void BatchExecuteLoadedModel(
+- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
++ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+ std::vector<std::optional<OutputType>>* outputs) {
+ DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+@@ -499,7 +499,7 @@ class TFLiteModelExecutor : public Model
+ // Unloads the model if needed.
+ void BatchExecuteLoadedModelAndRunCallback(
+ BatchExecutionCallback callback_on_complete,
+- ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
++ typename ModelExecutor<OutputType, InputType>::ConstRefInputVector inputs,
+ ExecutionStatus execution_status) {
+ DCHECK(execution_task_runner_->RunsTasksInCurrentSequence());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+Index: chromium-123.0.6312.46/mojo/public/cpp/bindings/array_traits.h
+===================================================================
+--- chromium-123.0.6312.46.orig/mojo/public/cpp/bindings/array_traits.h
++++ chromium-123.0.6312.46/mojo/public/cpp/bindings/array_traits.h
+@@ -90,7 +90,7 @@ template <typename Container>
+ { c[i] } -> std::same_as<typename Container::reference>;
+ }
+ struct ArrayTraits<Container> {
+- using Element = Container::value_type;
++ using Element = typename Container::value_type;
+
+ // vector-like containers have no built-in null.
+ static bool IsNull(const Container& c) { return false; }
+Index: chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/async_iterable.h
+===================================================================
+--- chromium-123.0.6312.46.orig/third_party/blink/renderer/bindings/core/v8/async_iterable.h
++++ chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/async_iterable.h
+@@ -245,7 +245,7 @@
+ private:
+ virtual IterationSource* CreateIterationSource(
+ ScriptState* script_state,
+- IterationSource::Kind kind,
++ typename IterationSource::Kind kind,
+ InitArgs... args,
+ ExceptionState& exception_state) = 0;
+ };
+@@ -291,7 +291,7 @@
+ private:
+ virtual IterationSource* CreateIterationSource(
+ ScriptState* script_state,
+- IterationSource::Kind kind,
++ typename IterationSource::Kind kind,
+ InitArgs... args,
+ ExceptionState& exception_state) = 0;
+ };
+Index: chromium-123.0.6312.46/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
+===================================================================
+--- chromium-123.0.6312.46.orig/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
++++ chromium-123.0.6312.46/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc
+@@ -210,7 +210,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;
+ static_assert(std::is_same_v<Char, UChar> || std::is_same_v<Char, LChar>);
+Index: chromium-123.0.6312.46/base/functional/function_ref.h
+===================================================================
+--- chromium-123.0.6312.46.orig/base/functional/function_ref.h
++++ chromium-123.0.6312.46/base/functional/function_ref.h
+@@ -64,7 +64,7 @@ class FunctionRef;
+ template <typename R, typename... Args>
+ class FunctionRef<R(Args...)> {
+ template <typename Functor,
+- typename RunType = internal::FunctorTraits<Functor>::RunType>
++ typename RunType = typename internal::FunctorTraits<Functor>::RunType>
+ static constexpr bool kCompatibleFunctor =
+ std::convertible_to<internal::ExtractReturnType<RunType>, R> &&
+ std::same_as<internal::ExtractArgs<RunType>, internal::TypeList<Args...>>;
+Index: chromium-123.0.6312.46/base/containers/heap_array.h
+===================================================================
+--- chromium-123.0.6312.46.orig/base/containers/heap_array.h
++++ chromium-123.0.6312.46/base/containers/heap_array.h
+@@ -32,8 +32,8 @@
+ static_assert(!std::is_reference_v<T>,
+ "HeapArray cannot hold reference types");
+
+- using iterator = base::span<T>::iterator;
+- using const_iterator = base::span<const T>::iterator;
++ using iterator = typename base::span<T>::iterator;
++ using const_iterator = typename base::span<const T>::iterator;
+ // We don't put this default value in the template parameter list to allow the
+ // static_assert on is_reference_v to give a nicer error message.
+ using deleter_type = std::
+Index: chromium-123.0.6312.46/mojo/public/cpp/bindings/type_converter.h
+===================================================================
+--- chromium-123.0.6312.46.orig/mojo/public/cpp/bindings/type_converter.h
++++ chromium-123.0.6312.46/mojo/public/cpp/bindings/type_converter.h
+@@ -127,7 +127,7 @@ using VecValueType = typename Vec::value
+
+ template <typename Vec>
+ using VecPtrLikeUnderlyingValueType =
+- std::pointer_traits<VecValueType<Vec>>::element_type;
++ typename std::pointer_traits<VecValueType<Vec>>::element_type;
+
+ } // namespace internal
+
+Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/wtf/hash_table.h
+===================================================================
+--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/wtf/hash_table.h
++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/wtf/hash_table.h
+@@ -2004,7 +2004,7 @@ struct HashTableConstIteratorAdapter {
+ static_assert(!IsTraceable<typename Traits::TraitType>::value);
+
+ using iterator_category = std::bidirectional_iterator_tag;
+- using value_type = HashTableType::ValueType;
++ using value_type = typename HashTableType::ValueType;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+@@ -2056,7 +2056,7 @@ struct HashTableConstIteratorAdapter<
+
+ public:
+ using iterator_category = std::bidirectional_iterator_tag;
+- using value_type = HashTableType::ValueType;
++ using value_type = typename HashTableType::ValueType;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+@@ -2110,7 +2110,7 @@ struct HashTableIteratorAdapter {
+ static_assert(!IsTraceable<typename Traits::TraitType>::value);
+
+ using iterator_category = std::bidirectional_iterator_tag;
+- using value_type = HashTableType::ValueType;
++ using value_type = typename HashTableType::ValueType;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+@@ -2158,7 +2158,7 @@ struct HashTableIteratorAdapter<
+
+ public:
+ using iterator_category = std::bidirectional_iterator_tag;
+- using value_type = HashTableType::ValueType;
++ using value_type = typename HashTableType::ValueType;
+ using difference_type = ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+Index: chromium-123.0.6312.46/base/types/fixed_array.h
+===================================================================
+--- chromium-123.0.6312.46.orig/base/types/fixed_array.h
++++ chromium-123.0.6312.46/base/types/fixed_array.h
+@@ -27,8 +27,8 @@ template <typename T,
+ class FixedArray : public absl::FixedArray<T, N, A> {
+ public:
+ using absl::FixedArray<T, N, A>::FixedArray;
+- explicit FixedArray(absl::FixedArray<T, N, A>::size_type n,
+- const absl::FixedArray<T, N, A>::allocator_type& a =
++ explicit FixedArray(typename absl::FixedArray<T, N, A>::size_type n,
++ const typename absl::FixedArray<T, N, A>::allocator_type& a =
+ typename absl::FixedArray<T, N, A>::allocator_type())
+ : FixedArray(n, T(), a) {}
+ };
+Index: chromium-123.0.6312.46/chrome/browser/web_applications/commands/internal/command_internal.h
+===================================================================
+--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/commands/internal/command_internal.h
++++ chromium-123.0.6312.46/chrome/browser/web_applications/commands/internal/command_internal.h
+@@ -121,7 +121,7 @@ class CommandBase {
+ template <typename LockType>
+ class CommandWithLock : public CommandBase {
+ public:
+- using LockDescription = LockType::LockDescription;
++ using LockDescription = typename LockType::LockDescription;
+ explicit CommandWithLock(const std::string& name,
+ LockDescription initial_lock_request);
+
+Index: chromium-123.0.6312.46/chrome/browser/web_applications/commands/web_app_command.h
+===================================================================
+--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/commands/web_app_command.h
++++ chromium-123.0.6312.46/chrome/browser/web_applications/commands/web_app_command.h
+@@ -106,7 +106,7 @@ class WebAppLockManager;
+ template <typename LockType, typename... CallbackArgs>
+ class WebAppCommand : public internal::CommandWithLock<LockType> {
+ public:
+- using LockDescription = LockType::LockDescription;
++ using LockDescription = typename LockType::LockDescription;
+ using CallbackType = base::OnceCallback<void(CallbackArgs...)>;
+ using ShutdownArgumentsTuple = std::tuple<std::decay_t<CallbackArgs>...>;
+
+Index: chromium-123.0.6312.46/chrome/browser/web_applications/web_app_command_scheduler.h
+===================================================================
+--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/web_app_command_scheduler.h
++++ chromium-123.0.6312.46/chrome/browser/web_applications/web_app_command_scheduler.h
+@@ -363,7 +363,7 @@ class WebAppCommandScheduler {
+ // command system.
+ template <typename LockType>
+ void ScheduleCallback(const std::string& operation_name,
+- LockType::LockDescription lock_description,
++ typename LockType::LockDescription lock_description,
+ CallbackCommand<LockType, void> callback,
+ base::OnceClosure on_complete,
+ const base::Location& location = FROM_HERE) {
+@@ -381,7 +381,7 @@ class WebAppCommandScheduler {
+ typename CallbackReturnValue = std::decay_t<CompletionCallbackArg>>
+ void ScheduleCallbackWithResult(
+ const std::string& operation_name,
+- LockType::LockDescription lock_description,
++ typename LockType::LockDescription lock_description,
+ CallbackCommand<LockType, CallbackReturnValue> callback,
+ base::OnceCallback<void(CompletionCallbackArg)> on_complete,
+ CallbackReturnValue arg_for_shutdown,
+Index: chromium-123.0.6312.46/components/supervised_user/core/browser/proto_fetcher.h
+===================================================================
+--- chromium-123.0.6312.46.orig/components/supervised_user/core/browser/proto_fetcher.h
++++ chromium-123.0.6312.46/components/supervised_user/core/browser/proto_fetcher.h
+@@ -424,7 +424,7 @@ class RetryingFetcherImpl final : public
+ RetryingFetcherImpl(const RetryingFetcherImpl&) = delete;
+ RetryingFetcherImpl& operator=(const RetryingFetcherImpl&) = delete;
+
+- void Start(ProtoFetcher<Response>::Callback callback) override {
++ void Start(typename ProtoFetcher<Response>::Callback callback) override {
+ callback_ = std::move(callback);
+ Retry();
+ }
+@@ -469,7 +469,7 @@ class RetryingFetcherImpl final : public
+ }
+
+ // Client callback.
+- TypedProtoFetcher<Response>::Callback callback_;
++ typename TypedProtoFetcher<Response>::Callback callback_;
+
+ // Retry controls.
+ base::OneShotTimer timer_;
+@@ -490,7 +490,7 @@ class ParallelFetchManager {
+ // Deferred fetcher is required because it should be started after it is
+ // stored internally.
+ using Fetcher = ProtoFetcher<Response>;
+- using KeyType = base::IDMap<std::unique_ptr<Fetcher>>::KeyType;
++ using KeyType = typename base::IDMap<std::unique_ptr<Fetcher>>::KeyType;
+
+ public:
+ // Provides fresh instances of a deferred fetcher for each fetch.
+@@ -506,7 +506,7 @@ class ParallelFetchManager {
+
+ // Starts the fetch. Underlying fetcher is stored internally, and will be
+ // cleaned up after finish or when this manager is destroyed.
+- void Fetch(const Request& request, Fetcher::Callback callback) {
++ void Fetch(const Request& request, typename Fetcher::Callback callback) {
+ CHECK(callback) << "Use base::DoNothing() instead of empty callback.";
+ KeyType key = requests_in_flight_.Add(MakeFetcher(request));
+ requests_in_flight_.Lookup(key)->Start(
diff --git a/chromium-126-quiche-interator.patch b/chromium-126-quiche-interator.patch
new file mode 100644
index 0000000..9b630a8
--- /dev/null
+++ b/chromium-126-quiche-interator.patch
@@ -0,0 +1,12 @@
+diff -up chromium-126.0.6478.26/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h.me chromium-126.0.6478.26/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h
+--- chromium-126.0.6478.26/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h.me 2024-06-03 15:01:54.724207324 +0200
++++ chromium-126.0.6478.26/net/third_party/quiche/src/quiche/quic/core/quic_interval_deque.h 2024-06-03 14:58:16.244189794 +0200
+@@ -144,7 +144,7 @@ class QUICHE_NO_EXPORT QuicIntervalDeque
+ // for efficient std::lower_bound() calls.
+ class QUICHE_NO_EXPORT Iterator {
+ public:
+- using iterator_category = std::random_access_iterator_tag;
++ using iterator_category = std::forward_iterator_tag;
+ using value_type = T;
+ using difference_type = std::ptrdiff_t;
+ using pointer = T*;
diff --git a/chromium-127-bindgen.patch b/chromium-127-bindgen.patch
new file mode 100644
index 0000000..46708cb
--- /dev/null
+++ b/chromium-127-bindgen.patch
@@ -0,0 +1,108 @@
+author: Andres Salomon <dilinger@debian.org>
+description: fix bindgen-related stuff
+
+Two separate but related fixes:
+
+Crabbyav1f is calling bindgen features which are not currently in
+bookworm or sid; --allowlist-item was added in bindgen 0.68. As far
+as I can tell the build.rs stuff calls allowlist_item from there as
+well, so these arguments may just be redundant? Hopefully I'm not
+breaking stuff.. Drop this for sid once bindgen gets upgraded.
+
+
+Also, the call to bindgen sets the path for libclang to
+rust_bindgen_root, which is wrong. We're already passing
+clang_base_path with the path to libclang, there's no reason that
+we'd expect libclang to be in the same directory as bindgen. That
+fix should probably go upstream.
+
+
+--- a/third_party/crabbyavif/BUILD.gn
++++ b/third_party/crabbyavif/BUILD.gn
+@@ -12,15 +12,6 @@ rust_bindgen("crabbyavif_dav1d_bindings"
+ bindgen_flags = [
+ "no-doc-comments",
+ "generate=functions,types,vars,methods,constructors,destructors",
+- "allowlist-item=dav1d_close",
+- "allowlist-item=dav1d_data_unref",
+- "allowlist-item=dav1d_data_wrap",
+- "allowlist-item=dav1d_default_settings",
+- "allowlist-item=dav1d_error",
+- "allowlist-item=dav1d_get_picture",
+- "allowlist-item=dav1d_open",
+- "allowlist-item=dav1d_picture_unref",
+- "allowlist-item=dav1d_send_data",
+ ]
+ }
+
+@@ -46,59 +37,6 @@ rust_bindgen("crabbyavif_libyuv_bindings
+ bindgen_flags = [
+ "no-doc-comments",
+ "generate=functions,types,vars,methods,constructors,destructors",
+- "allowlist-item=ARGBAttenuate",
+- "allowlist-item=ARGBUnattenuate",
+- "allowlist-item=Convert16To8Plane",
+- "allowlist-item=FilterMode",
+- "allowlist-item=FilterMode_kFilterBilinear",
+- "allowlist-item=FilterMode_kFilterBox",
+- "allowlist-item=FilterMode_kFilterNone",
+- "allowlist-item=HalfFloatPlane",
+- "allowlist-item=I010AlphaToARGBMatrix",
+- "allowlist-item=I010AlphaToARGBMatrixFilter",
+- "allowlist-item=I010ToARGBMatrix",
+- "allowlist-item=I010ToARGBMatrixFilter",
+- "allowlist-item=I012ToARGBMatrix",
+- "allowlist-item=I210AlphaToARGBMatrix",
+- "allowlist-item=I210AlphaToARGBMatrixFilter",
+- "allowlist-item=I210ToARGBMatrix",
+- "allowlist-item=I210ToARGBMatrixFilter",
+- "allowlist-item=I400ToARGBMatrix",
+- "allowlist-item=I410AlphaToARGBMatrix",
+- "allowlist-item=I410ToARGBMatrix",
+- "allowlist-item=I420AlphaToARGBMatrix",
+- "allowlist-item=I420AlphaToARGBMatrixFilter",
+- "allowlist-item=I420ToARGBMatrix",
+- "allowlist-item=I420ToARGBMatrixFilter",
+- "allowlist-item=I420ToRGB24Matrix",
+- "allowlist-item=I420ToRGB24MatrixFilter",
+- "allowlist-item=I420ToRGB565Matrix",
+- "allowlist-item=I420ToRGBAMatrix",
+- "allowlist-item=I422AlphaToARGBMatrix",
+- "allowlist-item=I422AlphaToARGBMatrixFilter",
+- "allowlist-item=I422ToARGBMatrix",
+- "allowlist-item=I422ToARGBMatrixFilter",
+- "allowlist-item=I422ToRGB24MatrixFilter",
+- "allowlist-item=I422ToRGB565Matrix",
+- "allowlist-item=I422ToRGBAMatrix",
+- "allowlist-item=I444AlphaToARGBMatrix",
+- "allowlist-item=I444ToARGBMatrix",
+- "allowlist-item=I444ToRGB24Matrix",
+- "allowlist-item=ScalePlane",
+- "allowlist-item=ScalePlane_12",
+- "allowlist-item=YuvConstants",
+- "allowlist-item=kYuv2020Constants",
+- "allowlist-item=kYuvF709Constants",
+- "allowlist-item=kYuvH709Constants",
+- "allowlist-item=kYuvI601Constants",
+- "allowlist-item=kYuvJPEGConstants",
+- "allowlist-item=kYuvV2020Constants",
+- "allowlist-item=kYvu2020Constants",
+- "allowlist-item=kYvuF709Constants",
+- "allowlist-item=kYvuH709Constants",
+- "allowlist-item=kYvuI601Constants",
+- "allowlist-item=kYvuJPEGConstants",
+- "allowlist-item=kYvuV2020Constants",
+ ]
+ }
+
+--- a/build/rust/rust_bindgen.gni
++++ b/build/rust/rust_bindgen.gni
+@@ -18,7 +18,7 @@ if (host_os == "win") {
+
+ # On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in
+ # ../lib.
+-_libclang_path = rust_bindgen_root
++_libclang_path = clang_base_path
+ if (host_os == "win") {
+ _libclang_path += "/bin"
+ } else {
diff --git a/chromium-127-clang17-traitors.patch b/chromium-127-clang17-traitors.patch
new file mode 100644
index 0000000..b8ff763
--- /dev/null
+++ b/chromium-127-clang17-traitors.patch
@@ -0,0 +1,285 @@
+author: Andres Salomon <dilinger@debian.org>
+
+Work around the following:
+
+In file included from ../../mojo/public/cpp/bindings/lib/native_s:32
+truct_serialization.cc:5:
+In file included from ../../mojo/public/cpp/bindings/lib/native_struct_serialization.h:13:
+In file included from ../../base/check_op.h:9:
+In file included from /usr/bin/../include/c++/v1/string:545:
+In file included from /usr/bin/../include/c++/v1/__functional/hash.h:24:
+In file included from /usr/bin/../include/c++/v1/__utility/pair.h:16:
+In file included from /usr/bin/../include/c++/v1/__fwd/get.h:16:
+In file included from /usr/bin/../include/c++/v1/__fwd/subrange.h:20:
+In file included from /usr/bin/../include/c++/v1/__iterator/concepts.h:34:
+/usr/bin/../include/c++/v1/__memory/pointer_traits.h:118:22: error: implicit instantiation of undefined template 'std::__pointer_traits_element_type<IPC::MessageAttachment::Type, false>'
+ typedef typename __pointer_traits_element_type<pointer>::type element_type;
+ ^
+../../base/types/to_address.h:32:40: note: in instantiation of template class 'std::pointer_traits<IPC::MessageAttachment::Type>' requested here
+ requires requires(const P& p) { std::pointer_traits<P>::to_address(p); } ||
+ ^
+../../base/types/to_address.h:32:35: note: in instantiation of requirement here
+../../mojo/public/cpp/bindings/lib/native_struct_serialization.cc requires requires(const P& p) { std::pointer_traits<P>::to_address(p); } ||
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+../../base/types/to_address.h:32:12: note: while substituting template arguments into constraint expression here
+ requires requires(const P& p) { std::pointer_traits<P>::to_address(p); } ||
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+../../mojo/public/cpp/bindings/type_converter.h:103:26: note: while checking constraint satisfaction for template 'to_address<IPC::MessageAttachment::Type>' required here
+ { mojo::ConvertTo<T>(base::to_address(obj)) } -> std::same_as<T>;
+ ^~~~
+
+
+This turns out to be a clang-16 bug, fixed in clang-18:
+https://github.com/llvm/llvm-project/issues/67449
+
+This is just the pointer_traits.h header from libc++-18-dev,
+with a minor tweak to get things building.
+
+--- /dev/null
++++ b/__memory/pointer_traits.h
+@@ -0,0 +1,245 @@
++// -*- C++ -*-
++//===----------------------------------------------------------------------===//
++//
++// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
++// See https://llvm.org/LICENSE.txt for license information.
++// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
++//
++//===----------------------------------------------------------------------===//
++
++#ifndef _LIBCPP___MEMORY_POINTER_TRAITS_H
++#define _LIBCPP___MEMORY_POINTER_TRAITS_H
++
++#include <__config>
++#include <__memory/addressof.h>
++#include <__type_traits/conditional.h>
++#include <__type_traits/conjunction.h>
++#include <__type_traits/decay.h>
++#include <__type_traits/is_class.h>
++#include <__type_traits/is_function.h>
++#include <__type_traits/is_void.h>
++#include <__type_traits/void_t.h>
++#include <__utility/declval.h>
++#include <cstddef>
++
++#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
++# pragma GCC system_header
++#endif
++
++_LIBCPP_BEGIN_NAMESPACE_STD
++
++template <class _Tp, class = void>
++struct __has_element_type : false_type {};
++
++template <class _Tp>
++struct __has_element_type<_Tp, __void_t<typename _Tp::element_type> > : true_type {};
++
++template <class _Ptr, bool = __has_element_type<_Ptr>::value>
++struct __pointer_traits_element_type {};
++
++template <class _Ptr>
++struct __pointer_traits_element_type<_Ptr, true> {
++ typedef _LIBCPP_NODEBUG typename _Ptr::element_type type;
++};
++
++template <template <class, class...> class _Sp, class _Tp, class... _Args>
++struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true> {
++ typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::element_type type;
++};
++
++template <template <class, class...> class _Sp, class _Tp, class... _Args>
++struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false> {
++ typedef _LIBCPP_NODEBUG _Tp type;
++};
++
++template <class _Tp, class = void>
++struct __has_difference_type : false_type {};
++
++template <class _Tp>
++struct __has_difference_type<_Tp, __void_t<typename _Tp::difference_type> > : true_type {};
++
++template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
++struct __pointer_traits_difference_type {
++ typedef _LIBCPP_NODEBUG ptrdiff_t type;
++};
++
++template <class _Ptr>
++struct __pointer_traits_difference_type<_Ptr, true> {
++ typedef _LIBCPP_NODEBUG typename _Ptr::difference_type type;
++};
++
++template <class _Tp, class _Up>
++struct __has_rebind {
++private:
++ template <class _Xp>
++ static false_type __test(...);
++ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
++ template <class _Xp>
++ static true_type __test(typename _Xp::template rebind<_Up>* = 0);
++ _LIBCPP_SUPPRESS_DEPRECATED_POP
++
++public:
++ static const bool value = decltype(__test<_Tp>(0))::value;
++};
++
++template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
++struct __pointer_traits_rebind {
++#ifndef _LIBCPP_CXX03_LANG
++ typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up> type;
++#else
++ typedef _LIBCPP_NODEBUG typename _Tp::template rebind<_Up>::other type;
++#endif
++};
++
++template <template <class, class...> class _Sp, class _Tp, class... _Args, class _Up>
++struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true> {
++#ifndef _LIBCPP_CXX03_LANG
++ typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
++#else
++ typedef _LIBCPP_NODEBUG typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
++#endif
++};
++
++template <template <class, class...> class _Sp, class _Tp, class... _Args, class _Up>
++struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false> {
++ typedef _Sp<_Up, _Args...> type;
++};
++
++template <class _Ptr, class = void>
++struct __pointer_traits_impl {};
++
++template <class _Ptr>
++struct __pointer_traits_impl<_Ptr, __void_t<typename __pointer_traits_element_type<_Ptr>::type> > {
++ typedef _Ptr pointer;
++ typedef typename __pointer_traits_element_type<pointer>::type element_type;
++ typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
++
++#ifndef _LIBCPP_CXX03_LANG
++ template <class _Up>
++ using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
++#else
++ template <class _Up>
++ struct rebind {
++ typedef typename __pointer_traits_rebind<pointer, _Up>::type other;
++ };
++#endif // _LIBCPP_CXX03_LANG
++
++private:
++ struct __nat {};
++
++public:
++ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
++ pointer_to(__conditional_t<is_void<element_type>::value, __nat, element_type>& __r) {
++ return pointer::pointer_to(__r);
++ }
++};
++
++template <class _Ptr>
++struct _LIBCPP_TEMPLATE_VIS pointer_traits : __pointer_traits_impl<_Ptr> {};
++
++template <class _Tp>
++struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*> {
++ typedef _Tp* pointer;
++ typedef _Tp element_type;
++ typedef ptrdiff_t difference_type;
++
++#ifndef _LIBCPP_CXX03_LANG
++ template <class _Up>
++ using rebind = _Up*;
++#else
++ template <class _Up>
++ struct rebind {
++ typedef _Up* other;
++ };
++#endif
++
++private:
++ struct __nat {};
++
++public:
++ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 static pointer
++ pointer_to(__conditional_t<is_void<element_type>::value, __nat, element_type>& __r) _NOEXCEPT {
++ return std::addressof(__r);
++ }
++};
++
++#ifndef _LIBCPP_CXX03_LANG
++template <class _From, class _To>
++using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>;
++#else
++template <class _From, class _To>
++using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>::other;
++#endif
++
++// to_address
++
++template <class _Pointer, class = void>
++struct __to_address_helper;
++
++template <class _Tp>
++_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __to_address(_Tp* __p) _NOEXCEPT {
++ static_assert(!is_function<_Tp>::value, "_Tp is a function type");
++ return __p;
++}
++
++template <class _Pointer, class = void>
++struct _HasToAddress : false_type {};
++
++template <class _Pointer>
++struct _HasToAddress<_Pointer, decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>())) >
++ : true_type {};
++
++template <class _Pointer, class = void>
++struct _HasArrow : false_type {};
++
++template <class _Pointer>
++struct _HasArrow<_Pointer, decltype((void)std::declval<const _Pointer&>().operator->()) > : true_type {};
++
++template <class _Pointer>
++struct _IsFancyPointer {
++ static const bool value = _HasArrow<_Pointer>::value || _HasToAddress<_Pointer>::value;
++};
++
++// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers
++template <class _Pointer, class = __enable_if_t< _And<is_class<_Pointer>, _IsFancyPointer<_Pointer> >::value > >
++_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
++ decay_t<decltype(__to_address_helper<_Pointer>::__call(std::declval<const _Pointer&>()))>
++ __to_address(const _Pointer& __p) _NOEXCEPT {
++ return __to_address_helper<_Pointer>::__call(__p);
++}
++
++template <class _Pointer, class>
++struct __to_address_helper {
++ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static decltype(std::__to_address(
++ std::declval<const _Pointer&>().operator->()))
++ __call(const _Pointer& __p) _NOEXCEPT {
++ return std::__to_address(__p.operator->());
++ }
++};
++
++template <class _Pointer>
++struct __to_address_helper<_Pointer,
++ decltype((void)pointer_traits<_Pointer>::to_address(std::declval<const _Pointer&>()))> {
++ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR static decltype(pointer_traits<_Pointer>::to_address(
++ std::declval<const _Pointer&>()))
++ __call(const _Pointer& __p) _NOEXCEPT {
++ return pointer_traits<_Pointer>::to_address(__p);
++ }
++};
++
++#if _LIBCPP_STD_VER >= 20
++template <class _Tp>
++inline _LIBCPP_HIDE_FROM_ABI constexpr auto to_address(_Tp* __p) noexcept {
++ return std::__to_address(__p);
++}
++
++template <class _Pointer>
++inline _LIBCPP_HIDE_FROM_ABI constexpr auto to_address(const _Pointer& __p) noexcept
++ -> decltype(std::__to_address(__p)) {
++ return std::__to_address(__p);
++}
++#endif
++
++_LIBCPP_END_NAMESPACE_STD
++
++#endif // _LIBCPP___MEMORY_POINTER_TRAITS_H
diff --git a/chromium-127-constexpr.patch b/chromium-127-constexpr.patch
new file mode 100644
index 0000000..01149f2
--- /dev/null
+++ b/chromium-127-constexpr.patch
@@ -0,0 +1,93 @@
+author: Andres Salomon <dilinger@debian.org>
+
+../../services/network/shared_dictionary/simple_url_pattern_matcher.cc:31:34: error: constexpr variable 'kDefaultOptions' must be initialized by a constant expression
+ 31 | constexpr liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
+ | ^ ~~~~~~~~~~~~~~~~~~~~~~
+ 32 | .prefix_list = "",
+ | ~~~~~~~~~~~~~~~~~~
+ 33 | .sensitive = true,
+ | ~~~~~~~~~~~~~~~~~~
+ 34 | .strict = true};
+ | ~~~~~~~~~~~~~~~
+
+--- a/services/network/shared_dictionary/simple_url_pattern_matcher.cc
++++ b/services/network/shared_dictionary/simple_url_pattern_matcher.cc
+@@ -28,17 +28,17 @@ namespace network {
+ namespace {
+
+ // https://urlpattern.spec.whatwg.org/#default-options
+-constexpr liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
++const liburlpattern::Options kDefaultOptions = {.delimiter_list = "",
+ .prefix_list = "",
+ .sensitive = true,
+ .strict = true};
+ // https://urlpattern.spec.whatwg.org/#hostname-options
+-constexpr liburlpattern::Options kHostnameOptions = {.delimiter_list = ".",
++const liburlpattern::Options kHostnameOptions = {.delimiter_list = ".",
+ .prefix_list = "",
+ .sensitive = true,
+ .strict = true};
+ // https://urlpattern.spec.whatwg.org/#pathname-options
+-constexpr liburlpattern::Options kPathnameOptions = {.delimiter_list = "/",
++const liburlpattern::Options kPathnameOptions = {.delimiter_list = "/",
+ .prefix_list = "/",
+ .sensitive = true,
+ .strict = true};
+--- a/components/autofill/core/browser/data_model/autofill_i18n_api.h
++++ b/components/autofill/core/browser/data_model/autofill_i18n_api.h
+@@ -16,8 +16,8 @@ namespace autofill::i18n_model_definitio
+ // Country code that represents autofill's legacy address hierarchy model as
+ // stored `kAutofillModelRules`. As a workaround for GCC we declare the
+ // std::string constexpr first.
+-constexpr inline std::string kLegacyHierarchyCountryCodeString{"XX"};
+-constexpr AddressCountryCode kLegacyHierarchyCountryCode =
++const inline std::string kLegacyHierarchyCountryCodeString{"XX"};
++const AddressCountryCode kLegacyHierarchyCountryCode =
+ AddressCountryCode(kLegacyHierarchyCountryCodeString);
+
+ // Creates an instance of the address hierarchy model corresponding to the
+--- a/components/omnibox/browser/on_device_tail_model_service.cc
++++ b/components/omnibox/browser/on_device_tail_model_service.cc
+@@ -26,7 +26,7 @@
+
+ namespace {
+ // Constants for TFlite model validation.
+-constexpr std::string kTestPrefix = "google m";
++const std::string kTestPrefix = "google m";
+ constexpr std::string_view kModelValidationSwitchName =
+ "omnibox-on-device-tail-model-validation";
+
+--- a/chrome/browser/ui/lens/lens_overlay_url_builder.cc
++++ b/chrome/browser/ui/lens/lens_overlay_url_builder.cc
+@@ -78,7 +78,7 @@ inline constexpr char kXSRFTokenQueryPar
+ inline constexpr char kSecActQueryParamKey[] = "sec_act";
+
+ // The list of query parameters to ignore when comparing search URLs.
+-inline constexpr std::string kIgnoredSearchUrlQueryParameters[] = {
++inline const std::string kIgnoredSearchUrlQueryParameters[] = {
+ kViewportWidthQueryParamKey, kViewportHeightQueryParamKey,
+ kXSRFTokenQueryParamKey, kSecActQueryParamKey};
+
+--- a/content/public/test/prefetch_test_util.h
++++ b/content/public/test/prefetch_test_util.h
+@@ -15,7 +15,7 @@ namespace content::test {
+
+ using PrefetchContainerIdForTesting =
+ base::StrongAlias<class PrefetchContainerIdForTestingTag, std::string>;
+-static constexpr PrefetchContainerIdForTesting
++static const PrefetchContainerIdForTesting
+ InvalidPrefetchContainerIdForTesting = PrefetchContainerIdForTesting("");
+
+ class TestPrefetchWatcherImpl;
+--- a/components/history_embeddings/ml_answerer.cc
++++ b/components/history_embeddings/ml_answerer.cc
+@@ -24,7 +24,7 @@
+
+ namespace {
+
+-static constexpr std::string kPassageIdToken = "ID";
++static const std::string kPassageIdToken = "ID";
+
+ std::string GetPassageIdStr(size_t id) {
+ return base::StringPrintf("%04d", static_cast<int>(id));
+
diff --git a/chromium-127-rust-clanglib.patch b/chromium-127-rust-clanglib.patch
new file mode 100644
index 0000000..e06bb20
--- /dev/null
+++ b/chromium-127-rust-clanglib.patch
@@ -0,0 +1,22 @@
+diff -up chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me chromium-127.0.6533.72/build/rust/rust_bindgen.gni
+--- chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me 2024-07-25 16:11:18.754551595 +0200
++++ chromium-127.0.6533.72/build/rust/rust_bindgen.gni 2024-07-25 16:11:33.997837660 +0200
+@@ -22,7 +22,7 @@ _libclang_path = rust_bindgen_root
+ if (host_os == "win") {
+ _libclang_path += "/bin"
+ } else {
+- _libclang_path += "/lib"
++ _libclang_path += "/lib64"
+ }
+
+ # Template to build Rust/C bindings with bindgen.
+@@ -195,6 +195,8 @@
+ # causes bindgen not to emit function bindings. Override it.
+ if (!is_win) {
+ args += [ "-fvisibility=default" ]
++ args += [ "-I/usr/include/c++/v1" ]
++ args += [ "-I/usr/lib64/clang/" + clang_version + "/include" ]
+ }
+
+ if (is_win) {
+
diff --git a/chromium-91-java-only-allowed-in-android-builds.patch b/chromium-91-java-only-allowed-in-android-builds.patch
new file mode 100644
index 0000000..58d9369
--- /dev/null
+++ b/chromium-91-java-only-allowed-in-android-builds.patch
@@ -0,0 +1,16 @@
+References: https://bugs.chromium.org/p/chromium/issues/detail?id=1192875
+
+Index: chromium-91.0.4472.57/third_party/closure_compiler/compiler.py
+===================================================================
+--- chromium-91.0.4472.57.orig/third_party/closure_compiler/compiler.py
++++ chromium-91.0.4472.57/third_party/closure_compiler/compiler.py
+@@ -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
diff --git a/chromium-disable-GlobalMediaControlsCastStartStop.patch b/chromium-disable-GlobalMediaControlsCastStartStop.patch
new file mode 100644
index 0000000..16c0cec
--- /dev/null
+++ b/chromium-disable-GlobalMediaControlsCastStartStop.patch
@@ -0,0 +1,13 @@
+Index: chromium-123.0.6312.46/chrome/browser/media/router/media_router_feature.cc
+===================================================================
+--- chromium-123.0.6312.46.orig/chrome/browser/media/router/media_router_feature.cc
++++ chromium-123.0.6312.46/chrome/browser/media/router/media_router_feature.cc
+@@ -59,7 +59,7 @@ BASE_FEATURE(kFallbackToAudioTabMirrorin
+ #if BUILDFLAG(IS_CHROMEOS)
+ base::FEATURE_DISABLED_BY_DEFAULT);
+ #else
+- base::FEATURE_ENABLED_BY_DEFAULT);
++ base::FEATURE_DISABLED_BY_DEFAULT);
+ #endif // BUILDFLAG(IS_CHROMEOS)
+
+ BASE_FEATURE(kCastMirroringPlayoutDelay,
diff --git a/chromium-libusb_interrupt_event_handler.patch b/chromium-libusb_interrupt_event_handler.patch
new file mode 100644
index 0000000..0def4a3
--- /dev/null
+++ b/chromium-libusb_interrupt_event_handler.patch
@@ -0,0 +1,15 @@
+diff -up chromium-48.0.2564.116/services/device/usb/usb_context.cc.modern-libusbx chromium-48.0.2564.116/device/usb/usb_context.cc
+--- chromium-48.0.2564.116/services/device/usb/usb_context.cc.modern-libusbx 2016-02-24 10:21:10.534996028 -0500
++++ chromium-48.0.2564.116/services/device/usb/usb_context.cc 2016-02-24 10:22:28.270499864 -0500
+@@ -57,7 +57,11 @@ void UsbContext::UsbEventHandler::Run()
+
+ void UsbContext::UsbEventHandler::Stop() {
+ base::subtle::Release_Store(&running_, 0);
++#ifdef LIBUSB_API_VERSION >= 0x01000105
++ libusb_interrupt_event_handler(context_);
++#else
+ libusb_interrupt_handle_event(context_);
++#endif
+ }
+
+ UsbContext::UsbContext(PlatformUsbContext context) : context_(context) {
diff --git a/chromium-master-prefs-path.patch b/chromium-master-prefs-path.patch
new file mode 100644
index 0000000..f9e6b07
--- /dev/null
+++ b/chromium-master-prefs-path.patch
@@ -0,0 +1,16 @@
+Index: chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc
+===================================================================
+--- chromium-115.0.5790.32.orig/chrome/browser/first_run/first_run_internal_linux.cc
++++ chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc
+@@ -21,10 +21,7 @@ bool IsOrganicFirstRun() {
+ base::FilePath InitialPrefsPath() {
+ // The standard location of the initial prefs is next to the chrome binary.
+ base::FilePath dir_exe;
+- if (!base::PathService::Get(base::DIR_EXE, &dir_exe)) {
+- return base::FilePath();
+- }
+-
++ dir_exe = base::FilePath("/etc/chromium");
+ return installer::InitialPreferences::Path(dir_exe);
+ }
+
diff --git a/chromium-norar.patch b/chromium-norar.patch
new file mode 100644
index 0000000..fe384ce
--- /dev/null
+++ b/chromium-norar.patch
@@ -0,0 +1,12 @@
+diff -up chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
+--- chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar 2024-02-07 19:49:25.000000000 +0100
++++ chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc 2024-02-11 18:55:29.964450604 +0100
+@@ -79,8 +79,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 --git a/chromium-prop-codecs.patch b/chromium-prop-codecs.patch
new file mode 100644
index 0000000..09e2119
--- /dev/null
+++ b/chromium-prop-codecs.patch
@@ -0,0 +1,17 @@
+Index: chromium-106.0.5249.91/media/BUILD.gn
+===================================================================
+--- chromium-106.0.5249.91.orig/media/BUILD.gn
++++ chromium-106.0.5249.91/media/BUILD.gn
+@@ -64,12 +64,6 @@ buildflag_header("media_buildflags") {
+ }
+ }
+
+-if (proprietary_codecs && media_use_ffmpeg) {
+- assert(
+- ffmpeg_branding != "Chromium",
+- "proprietary codecs and ffmpeg_branding set to Chromium are incompatible")
+-}
+-
+ # Common configuration for targets in the media directory; these must not be
+ # exported since things like USE_NEON and USE_CRAS have different meanings
+ # elsewhere in the code base.
diff --git a/chromium-symbolic.svg b/chromium-symbolic.svg
new file mode 100644
index 0000000..1b47e00
--- /dev/null
+++ b/chromium-symbolic.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg version="1.1" id="svg44" width="511.98489" height="511.98489" viewBox="0 0 511.98489 511.98489" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
+ <defs id="defs18">
+ <linearGradient xlink:href="#linearGradient4975" id="linearGradient4633" gradientUnits="userSpaceOnUse" gradientTransform="matrix(231.62575,0,0,231.62472,111.11013,159.99363)" x2="0.5565635" x1="0.46521288" y1="-0.67390651" y2="0.81129867"/>
+ <linearGradient id="linearGradient4975">
+ <stop style="stop-color:#1972e7" offset="0" id="stop4971"/>
+ <stop style="stop-color:#1969d5" offset="1" id="stop4973"/>
+ </linearGradient>
+ <linearGradient xlink:href="#3" id="linearGradient1331" x1="101.74381" y1="33.726189" x2="101.59915" y2="135.466" gradientUnits="userSpaceOnUse" gradientTransform="matrix(3.7794235,0,0,3.7794067,0.00151555,0.00377865)"/>
+ <linearGradient id="3" x2="1" gradientTransform="matrix(61.286,0,0,61.286,29.399,42.333)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" id="stop1397" style="stop-color:#afccfb"/>
+ <stop offset="1" id="stop1399" style="stop-color:#8bb5f8"/>
+ </linearGradient>
+ <linearGradient xlink:href="#1" id="linearGradient2962" gradientUnits="userSpaceOnUse" gradientTransform="matrix(94.931559,164.42687,-164.4276,94.931137,97.555991,173.61083)" x2="1.7695541" x1="0.018202547" y1="-0.51170158" y2="0.4994337"/>
+ <linearGradient id="1" x2="1" gradientTransform="matrix(25.118,43.506,-43.506,25.118,25.812,45.935)" gradientUnits="userSpaceOnUse">
+ <stop offset="0" id="stop3122" style="stop-color:#659cf6"/>
+ <stop offset="1" id="stop3124" style="stop-color:#4285f4"/>
+ </linearGradient>
+ <linearGradient xlink:href="#2" id="linearGradient2688" x1="67.452377" y1="40.320694" x2="67.733002" y2="95.25" gradientUnits="userSpaceOnUse" gradientTransform="matrix(3.7794235,0,0,3.7794067,0.00150043,0.00377865)"/>
+ <linearGradient id="2">
+ <stop style="stop-color:#3680f0" offset="0" id="stop2682"/>
+ <stop style="stop-color:#2678ec" offset="1" id="stop2684"/>
+ </linearGradient>
+ </defs>
+ <path d="m 255.99319,255.99433 110.85049,63.99671 -110.85049,191.99385 c 141.38068,0 255.9917,-114.61051 255.9917,-255.99056 0,-46.64165 -12.53559,-90.3316 -34.33115,-127.99716 h -221.6632 z" id="path34-4" style="fill:url(#linearGradient1331)"/>
+ <path d="M 255.99054,0 C 161.2404,0 78.576848,51.513314 34.31224,128.0274 l 110.82781,191.96363 110.85049,-63.9967 V 127.99717 h 221.6632 C 433.38157,51.501975 350.72936,0 255.99054,0 Z" id="path36-1" style="fill:url(#linearGradient4633)"/>
+ <path d="m 0.00151177,255.99433 c 0,141.38005 114.60723823,255.99056 255.99168823,255.99056 L 366.84368,319.99103 255.9932,255.99433 145.14271,319.99103 34.314897,128.0274 C 12.531434,165.68239 0,209.35646 0,255.99056" id="path38-7" style="fill:url(#linearGradient2962)"/>
+ <path d="m 383.99094,255.99433 c 0,70.69003 -57.30741,127.99717 -127.99775,127.99717 -70.69034,0 -127.99773,-57.30714 -127.99773,-127.99717 0,-70.69002 57.30739,-127.99716 127.99773,-127.99716 70.69034,0 127.99775,57.30714 127.99775,127.99716" fill="#ffffff" id="path40"/>
+ <path d="m 359.99158,255.99433 c 0,57.43565 -46.56249,103.99794 -103.99839,103.99794 -57.4359,0 -103.9984,-46.56229 -103.9984,-103.99794 0,-57.43564 46.5625,-103.99793 103.9984,-103.99793 57.4359,0 103.99839,46.56229 103.99839,103.99793" id="path42-5" style="fill:url(#linearGradient2688)"/>
+</svg>
diff --git a/chromium.spec b/chromium.spec
new file mode 100644
index 0000000..d2e7206
--- /dev/null
+++ b/chromium.spec
@@ -0,0 +1,955 @@
+# Bring your own API key for downstream distro
+# This key is only for openEuler
+# https://www.chromium.org/developers/how-tos/api-keys/
+%global api_key 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
+
+%define outputdir out
+%define __provides_exclude ^lib.*\\.so.*$
+
+%bcond_without clang
+%bcond_with lto
+%bcond_with gtk4
+%bcond_without qt
+%ifarch x86_64
+%bcond_without swiftshader
+%endif
+%bcond_with system_harfbuzz
+%bcond_with system_freetype
+%bcond_with arm_bti
+%bcond_with system_icu
+%bcond_without pipewire
+%bcond_without system_ffmpeg
+%bcond_with system_zlib
+%bcond_with system_vpx
+%bcond_with system_avif
+%bcond_with system_re2
+%bcond_with system_webp
+%bcond_with system_zstd
+
+# Enable esbuild
+%global esbuild 1
+# When will gn fix this?
+# https://bugs.chromium.org/p/gn/issues/detail?id=360
+%global bootstrap 0
+
+Name: chromium
+Version: 128.0.6613.119
+Release: 1
+Summary: A WebKit (Blink) powered web browser.
+Url: http://www.chromium.org/Home
+License: BSD-3-Clause AND LGPL-2.1-or-later
+
+# Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
+# https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz
+Source0: chromium-%{version}.tar.xz
+Source1: master_preferences
+Source2: chrome-wrapper
+Source3: chromium-symbolic.svg
+Source4: INSTALL.sh
+
+# esbuild binary
+%if 0%{?esbuild}
+Source101: esbuild.tar.gz
+%endif
+
+Patch0: chromium-libusb_interrupt_event_handler.patch
+Patch2: chromium-master-prefs-path.patch
+Patch3: fix_building_widevinecdm_with_chromium.patch
+Patch6: gcc-enable-lto.patch
+# Do not use unrar code, it is non-free
+Patch7: chromium-norar.patch
+Patch9: system-libdrm.patch
+# other distro patchset
+Patch15: chromium-125-compiler.patch
+Patch40: chromium-91-java-only-allowed-in-android-builds.patch
+Patch98: chromium-102-regex_pattern-array.patch
+Patch202: chromium-prop-codecs.patch
+Patch203: chromium-106-ffmpeg-duration.patch
+Patch205: chromium-disable-GlobalMediaControlsCastStartStop.patch
+Patch240: chromium-117-string-convert.patch
+Patch248: chromium-119-assert.patch
+Patch256: chromium-120-make_unique-struct.patch
+Patch261: chromium-121-rust-clang_lib.patch
+Patch311: chromium-125-disable-FFmpegAllowLists.patch
+Patch322: chromium-125-lp155-typename.patch
+Patch337: chromium-123-missing-QtGui.patch
+Patch359: chromium-126-quiche-interator.patch
+Patch360: chromium-127-bindgen.patch
+Patch361: chromium-127-rust-clanglib.patch
+Patch362: chromium-127-clang17-traitors.patch
+Patch363: chromium-127-constexpr.patch
+
+# filter_labels_{include,exclude} was added to gn in Feb 2024
+# https://gn.googlesource.com/gn/+/e05c0aa00938adc0797bda1e8f2c15675aa13c30%5E%21/
+Patch500: gn-funcs.patch
+# ERROR at //build/config/BUILDCONFIG.gn:543:5: Dependency not allowed.
+# The item //third_party/webrtc/modules/audio_device:audio_device_name
+# can not depend on //third_party/abseil-cpp/absl/strings:string_view
+# because it is not in //third_party/abseil-cpp/absl/strings:string_view's visibility list
+Patch501: gn-absl.patch
+# ../build/rust/std/remap_alloc.cc:147:5: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
+Patch502: use-of-undeclared-identifier-memset.patch
+# ../base/containers/span.h:1155:9: error: call to function 'memmove' that is neither visible in the template definition nor found by argument-dependent lookup
+Patch503: 0001-Fix-error-call-to-function-memmove-that-is-neither-v.patch
+# ../mojo/public/cpp/bindings/lib/multiplex_router.cc:897:24: error: no matching member function for call to 'emplace'
+Patch504: emplace.patch
+# ../chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h:188:19: error: static assertion expression is not an integral constant expression
+Patch505: bubble-contents.patch
+# ../components/enterprise/connectors/common.h:144:8: error: no template named 'optional' in namespace 'std'
+Patch506: 0001-Fix-no-template-named-optional-in-namespace-std.patch
+
+# Disable swiftshader on aarch64
+# ld.lld: error: undefined symbol: llvm::MCSymbolizer::~MCSymbolizer()
+# >>> referenced by AArch64ExternalSymbolizer.cpp
+# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(llvm::AArch64ExternalSymbolizer::~AArch64ExternalSymbolizer())
+# >>> referenced by AArch64ExternalSymbolizer.cpp
+# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(vtable for llvm::AArch64ExternalSymbolizer)
+#
+# ld.lld: error: undefined symbol: llvm::MCExternalSymbolizer::tryAddingPcLoadReferenceComment(llvm::raw_ostream&, long, unsigned long)
+# >>> referenced by AArch64ExternalSymbolizer.cpp
+# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(vtable for llvm::AArch64ExternalSymbolizer)
+%ifarch aarch64
+Patch600: swiftshader.patch
+Patch601: swiftshader-2.patch
+%endif
+
+# RISC-V Support
+Patch1001: riscv-sandbox.patch
+Patch1002: riscv-dav1d.patch
+Patch1003: riscv-swiftshader.patch
+Patch1004: riscv-v8.patch
+Patch1005: riscv-cpuinfo.patch
+
+
+BuildRequires: SDL-devel
+BuildRequires: bison
+BuildRequires: cups-devel
+BuildRequires: desktop-file-utils
+BuildRequires: elfutils
+BuildRequires: flex
+BuildRequires: git
+%if ! %{bootstrap}
+BuildRequires: gn
+%else
+BuildRequires: libstdc++-static
+%endif
+BuildRequires: gperf
+BuildRequires: hicolor-icon-theme
+BuildRequires: golang
+# Java used during build
+BuildRequires: java-17-openjdk-headless
+BuildRequires: libcap-devel
+BuildRequires: libgcrypt-devel
+BuildRequires: gsm-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng-devel
+BuildRequires: nasm
+BuildRequires: ncurses-devel
+BuildRequires: ninja-build >= 1.7.2
+BuildRequires: nodejs >= 8.0
+BuildRequires: pam-devel
+BuildRequires: pkgconfig
+BuildRequires: python3
+BuildRequires: python3-setuptools
+BuildRequires: python3-six
+BuildRequires: snappy-devel
+BuildRequires: util-linux
+BuildRequires: perl(Switch)
+BuildRequires: pkgconfig(alsa)
+BuildRequires: pkgconfig(bzip2)
+BuildRequires: pkgconfig(cairo) >= 1.6
+BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(dri)
+BuildRequires: pkgconfig(expat)
+BuildRequires: pkgconfig(flac++)
+BuildRequires: pkgconfig(gbm)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(hunspell)
+BuildRequires: pkgconfig(imlib2)
+BuildRequires: pkgconfig(jack)
+BuildRequires: pkgconfig(kadm-client)
+BuildRequires: pkgconfig(kdb)
+BuildRequires: pkgconfig(krb5)
+BuildRequires: pkgconfig(libcrypto)
+BuildRequires: pkgconfig(libcurl)
+BuildRequires: pkgconfig(libdrm)
+BuildRequires: pkgconfig(libelf)
+BuildRequires: pkgconfig(libevdev)
+BuildRequires: pkgconfig(libevent)
+BuildRequires: pkgconfig(libexif)
+BuildRequires: pkgconfig(libffi)
+BuildRequires: pkgconfig(libpci)
+BuildRequires: pkgconfig(libpulse)
+BuildRequires: pkgconfig(libssl)
+BuildRequires: pkgconfig(libudev)
+BuildRequires: pkgconfig(libusb-1.0)
+BuildRequires: pkgconfig(libva)
+%if %{with system_webp}
+BuildRequires: pkgconfig(libwebp) >= 0.4.0
+%endif
+%if %{with system_zstd}
+BuildRequires: pkgconfig(libzstd)
+%endif
+BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5
+BuildRequires: pkgconfig(libxslt)
+BuildRequires: pkgconfig(minizip)
+BuildRequires: pkgconfig(nspr) >= 4.9.5
+BuildRequires: pkgconfig(nss) >= 3.26
+BuildRequires: pkgconfig(ogg)
+BuildRequires: pkgconfig(openssl)
+BuildRequires: pkgconfig(opus) >= 1.3.1
+BuildRequires: pkgconfig(python3)
+BuildRequires: pkgconfig(slang)
+BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(theora) >= 1.1
+BuildRequires: pkgconfig(vdpau)
+BuildRequires: pkgconfig(vorbis)
+BuildRequires: pkgconfig(wayland-client)
+BuildRequires: pkgconfig(wayland-cursor)
+BuildRequires: pkgconfig(wayland-scanner)
+BuildRequires: pkgconfig(wayland-server)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xcb-dri3)
+BuildRequires: pkgconfig(xcb-proto)
+BuildRequires: pkgconfig(xcomposite)
+BuildRequires: pkgconfig(xcursor)
+BuildRequires: pkgconfig(xdamage)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xfixes)
+BuildRequires: pkgconfig(xi)
+BuildRequires: pkgconfig(xkbcommon) >= 1.0.0
+BuildRequires: pkgconfig(xrandr)
+BuildRequires: pkgconfig(xrender)
+BuildRequires: pkgconfig(xscrnsaver)
+BuildRequires: pkgconfig(xshmfence)
+BuildRequires: pkgconfig(xt)
+BuildRequires: pkgconfig(xtst)
+BuildRequires: cargo
+BuildRequires: rust
+BuildRequires: rust-bindgen
+Requires: xdg-utils
+Recommends: google-noto-emoji-fonts
+
+Conflicts: chromium-browser
+Provides: %{name}-suid-helper = %{version}
+Provides: chromium-browser = %{version}
+Obsoletes: %{name}-suid-helper < %{version}
+Obsoletes: chromium-browser < %{version}
+
+ExclusiveArch: x86_64 aarch64 riscv64
+
+%if %{with pipewire}
+BuildRequires: pkgconfig(libpipewire-0.3)
+BuildRequires: pkgconfig(libspa-0.2)
+%endif
+%if %{with system_harfbuzz}
+BuildRequires: pkgconfig(harfbuzz) > 2.3.0
+%endif
+%if %{with system_icu}
+BuildRequires: pkgconfig(icu-i18n) >= 67.0
+%endif
+%if %{with system_vpx}
+BuildRequires: pkgconfig(vpx)
+%endif
+%if %{with system_freetype}
+BuildRequires: pkgconfig(freetype2)
+%endif
+%if %{with system_zlib}
+BuildRequires: pkgconfig(zlib)
+%endif
+%if %{with gtk4}
+BuildRequires: pkgconfig(atk-bridge-2.0)
+BuildRequires: pkgconfig(gtk4)
+%else
+BuildRequires: pkgconfig(gtk+-3.0)
+%endif
+%if %{with qt}
+BuildRequires: pkgconfig(Qt5Core)
+BuildRequires: pkgconfig(Qt5Widgets)
+%endif
+%if %{with system_ffmpeg}
+BuildRequires: pkgconfig(libavcodec)
+BuildRequires: pkgconfig(libavfilter)
+BuildRequires: pkgconfig(libavformat) >= 58
+BuildRequires: pkgconfig(libavutil)
+%endif
+%if %{with system_avif}
+#BuildRequires: pkgconfig(libavif)
+#BuildRequires: pkgconfig(libyuv)
+%endif
+%if %{with system_re2}
+BuildRequires: pkgconfig(re2) >= 11
+%endif
+%if %{with clang}
+BuildRequires: clang llvm lld
+BuildRequires: libstdc++-devel libstdc++-static
+BuildRequires: compiler-rt
+%endif
+%if %{without clang}
+BuildRequires: gcc
+BuildRequires: gcc-c++
+%endif
+
+%description
+Chromium is an open-source web browser, powered by WebKit (Blink).
+
+%package -n chromedriver
+Summary: WebDriver for Google Chrome/Chromium
+Requires: %{name} = %{version}
+
+%description -n chromedriver
+WebDriver is an open source tool for automated testing of webapps across many
+browsers. It provides capabilities for navigating to web pages, user input,
+JavaScript execution, and more. ChromeDriver is a standalone server which
+implements WebDriver's wire protocol for Chromium. It is being developed by
+members of the Chromium and WebDriver teams.
+
+%prep
+# download source0
+cd %{_sourcedir}
+rm -f %{SOURCE0}
+wget -q https://user-repo.openeuler.openatom.cn/lfs-tar/chromium/chromium-%{version}.tar.xz
+cd -
+
+#%{__cat} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} > %{SOURCE0}
+
+%setup -q -n chromium-%{version}
+
+%autopatch -p1
+
+# Change shebang in all relevant files in this directory and all subdirectories
+# See `man find` for how the `-exec command {} +` syntax works
+find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +
+
+# Hard code extra version
+sed -i 's/getenv("CHROME_VERSION_EXTRA")/"openEuler Project"/' chrome/common/channel_info_posix.cc
+
+%build
+rm third_party/devtools-frontend/src/third_party/esbuild/esbuild
+tar -xf %{SOURCE101}
+pushd esbuild
+gflags="-mod=vendor -gcflags=all='-N -l'"
+GO_FLAGS="${gflags}" make
+cp -a esbuild ../third_party/devtools-frontend/src/third_party/esbuild/esbuild
+popd
+
+#correct path for nodejs binary
+mkdir -p third_party/node/linux/node-linux-x64/bin
+rm -f third_party/node/linux/node-linux-x64/bin/node
+ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
+
+# Get rid of the pre-built eu-strip binary, it is x86_64 and of mysterious origin
+rm -rf buildtools/third_party/eu-strip/bin/eu-strip
+# Replace it with a symlink to copy
+ln -s %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip
+
+# need for error: the option `Z` is only accepted on the nightly compiler
+export RUSTC_BOOTSTRAP=1
+
+# set rustc version
+rustc_version="$(rustc --version | cut -d' ' -f2)"
+# set rust bindgen root
+rust_bindgen_root="%{_prefix}"
+
+export RUSTFLAGS
+
+# python3
+mkdir -p $HOME/bin
+export PYTHON=python3
+ln -sfn %{_bindir}/$PYTHON $HOME/bin/python
+export PATH="$HOME/bin/:$PATH"
+
+# use alternative wrapper
+rm chrome/installer/linux/common/wrapper
+cp %{SOURCE2} chrome/installer/linux/common/wrapper
+
+# set clang version
+#global clang_maj_ver %%(clang --version | sed -n 's/clang version //p' | cut -d. -f1)
+#if %{?clang_maj_ver} >= 17
+# This is for >= 24.03 LTS, return example: 17
+clang_version="$(clang --version | sed -n 's/clang version //p' | cut -d. -f1)"
+#else
+# This is for < 24.03 LTS, return example: 17.0.6
+#clang_version="$(clang --version | awk '/clang version/{print $3}')"
+#endif
+clang_base_path="$(clang --version | grep InstalledDir | cut -d' ' -f2 | sed 's#/bin##')"
+
+# Remove bundled libs
+keeplibs=(
+ base/third_party/cityhash
+ base/third_party/double_conversion
+ base/third_party/icu
+ base/third_party/nspr
+ base/third_party/superfasthash
+ base/third_party/symbolize
+ base/third_party/xdg_user_dirs
+ buildtools/third_party/eu-strip
+ buildtools/third_party/libc++
+ buildtools/third_party/libc++abi
+ buildtools/third_party/libunwind
+ chrome/third_party/mozilla_security_manager
+ courgette/third_party
+ net/third_party/mozilla_security_manager
+ net/third_party/nss
+ net/third_party/quic
+ net/third_party/uri_template
+ third_party/abseil-cpp
+ third_party/abseil-cpp/absl
+ third_party/abseil-cpp/absl/algorithm
+ third_party/abseil-cpp/absl/base
+ third_party/abseil-cpp/absl/flags
+ third_party/abseil-cpp/absl/functional
+ third_party/abseil-cpp/absl/strings
+ third_party/abseil-cpp/absl/types
+ third_party/angle
+ third_party/angle/src/common/third_party/xxhash
+ third_party/angle/src/third_party/ceval
+ third_party/angle/src/third_party/libXNVCtrl
+ third_party/angle/src/third_party/volk
+ third_party/anonymous_tokens
+ third_party/apple_apsl
+ third_party/axe-core
+ third_party/bidimapper
+ third_party/blink
+ third_party/boringssl
+ third_party/boringssl/src/third_party/fiat
+ third_party/breakpad
+ third_party/breakpad/breakpad/src/third_party/curl
+ third_party/brotli
+ third_party/catapult
+ third_party/catapult/common/py_vulcanize/third_party/rcssmin
+ third_party/catapult/common/py_vulcanize/third_party/rjsmin
+ third_party/catapult/third_party/beautifulsoup4
+ third_party/catapult/third_party/html5lib-1.1/
+ third_party/catapult/third_party/html5lib-python
+ third_party/catapult/third_party/polymer
+ third_party/catapult/third_party/six
+ third_party/catapult/tracing/third_party/d3
+ third_party/catapult/tracing/third_party/gl-matrix
+ third_party/catapult/tracing/third_party/jpeg-js
+ third_party/catapult/tracing/third_party/jszip
+ third_party/catapult/tracing/third_party/mannwhitneyu
+ third_party/catapult/tracing/third_party/oboe
+ third_party/catapult/tracing/third_party/pako
+ third_party/ced
+ third_party/cld_3
+ third_party/closure_compiler
+ third_party/content_analysis_sdk
+ third_party/cpuinfo
+ third_party/crashpad
+ third_party/crashpad/crashpad/third_party/lss
+ third_party/crashpad/crashpad/third_party/zlib
+ third_party/crabbyavif
+ third_party/crc32c
+ third_party/cros_system_api
+ third_party/d3
+ third_party/dav1d
+ third_party/dawn
+ third_party/dawn/third_party
+ third_party/depot_tools
+ third_party/devscripts
+ third_party/devtools-frontend
+ third_party/devtools-frontend/src/front_end/third_party
+ third_party/devtools-frontend/src/front_end/third_party/acorn
+ third_party/devtools-frontend/src/front_end/third_party/axe-core
+ third_party/devtools-frontend/src/front_end/third_party/chromium
+ third_party/devtools-frontend/src/front_end/third_party/codemirror
+ third_party/devtools-frontend/src/front_end/third_party/diff
+ third_party/devtools-frontend/src/front_end/third_party/i18n
+ third_party/devtools-frontend/src/front_end/third_party/intl-messageformat
+ third_party/devtools-frontend/src/front_end/third_party/lighthouse
+ third_party/devtools-frontend/src/front_end/third_party/lodash-isequal
+ third_party/devtools-frontend/src/front_end/third_party/marked
+ third_party/devtools-frontend/src/front_end/third_party/puppeteer
+ third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt
+ third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/parsel-js
+ third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs
+ third_party/devtools-frontend/src/front_end/third_party/wasmparser
+ third_party/devtools-frontend/src/third_party
+ third_party/distributed_point_functions
+ third_party/dom_distiller_js
+ third_party/eigen3
+ third_party/emoji-segmenter
+ third_party/farmhash
+ third_party/fdlibm
+ third_party/fft2d
+ third_party/flatbuffers
+ third_party/fp16
+ third_party/fusejs/dist
+ third_party/fxdiv
+ third_party/gemmlowp
+ third_party/google_input_tools
+ third_party/google_input_tools/third_party/closure_library
+ third_party/google_input_tools/third_party/closure_library/third_party/closure
+ third_party/googletest
+ third_party/highway
+ third_party/hunspell
+ third_party/iccjpeg
+ third_party/inspector_protocol
+ third_party/ipcz
+ third_party/jinja2
+ third_party/jsoncpp
+ third_party/jstemplate
+ third_party/khronos
+ third_party/lens_server_proto
+ third_party/leveldatabase
+ third_party/libaddressinput
+ third_party/libaom
+ third_party/libaom/source/libaom/third_party/fastfeat
+ third_party/libaom/source/libaom/third_party/SVT-AV1
+ third_party/libaom/source/libaom/third_party/vector
+ third_party/libaom/source/libaom/third_party/x86inc
+ third_party/libgav1
+ third_party/libjingle
+ third_party/libphonenumber
+ third_party/libsecret
+ third_party/libsrtp
+ third_party/libsync
+ third_party/libudev
+ third_party/liburlpattern
+ third_party/libva_protected_content
+ third_party/libwebm
+ third_party/libx11/src
+ third_party/libxcb-keysyms/keysyms
+ third_party/libxml/chromium
+ third_party/libzip
+ third_party/lit
+ third_party/lottie
+ third_party/lss
+ third_party/lzma_sdk
+ third_party/mako
+ third_party/markupsafe
+ third_party/material_color_utilities
+ third_party/mesa
+ third_party/metrics_proto
+ third_party/minigbm
+ third_party/modp_b64
+ third_party/nasm
+ third_party/nearby
+ third_party/node
+ third_party/omnibox_proto
+ third_party/one_euro_filter
+ third_party/openscreen
+ third_party/openscreen/src/third_party/tinycbor/src/src
+ third_party/ots
+ third_party/pdfium
+ third_party/pdfium/third_party/agg23
+ third_party/pdfium/third_party/bigint
+ third_party/pdfium/third_party/freetype
+ third_party/pdfium/third_party/lcms
+ third_party/pdfium/third_party/libopenjpeg
+ third_party/pdfium/third_party/libtiff
+ third_party/perfetto
+ third_party/perfetto/protos/third_party/chromium
+ third_party/perfetto/protos/third_party/simpleperf
+ third_party/pffft
+ third_party/ply
+ third_party/polymer
+ third_party/private-join-and-compute
+ third_party/private_membership
+ third_party/protobuf
+ third_party/pthreadpool
+ third_party/puffin
+ third_party/pyjson5
+ third_party/pyyaml
+ third_party/qcms
+ third_party/rnnoise
+ third_party/rust
+ third_party/ruy
+ third_party/s2cellid
+ third_party/securemessage
+ third_party/selenium-atoms
+ third_party/sentencepiece
+ third_party/sentencepiece/src/third_party/darts_clone
+ third_party/shell-encryption
+ third_party/simplejson
+ third_party/skia
+ third_party/skia/include/third_party/vulkan/
+ third_party/skia/third_party/vulkan
+ third_party/smhasher
+ third_party/spirv-headers
+ third_party/spirv-tools
+ third_party/sqlite
+ third_party/swiftshader
+ third_party/swiftshader/third_party/astc-encoder
+ third_party/swiftshader/third_party/llvm-10.0
+ third_party/swiftshader/third_party/llvm-16.0
+ third_party/swiftshader/third_party/llvm-subzero
+ third_party/swiftshader/third_party/marl
+ third_party/swiftshader/third_party/SPIRV-Headers
+ third_party/swiftshader/third_party/SPIRV-Tools
+ third_party/swiftshader/third_party/subzero
+ third_party/tensorflow_models
+ third_party/tensorflow-text
+ third_party/tflite
+ third_party/tflite/src/third_party/eigen3
+ third_party/tflite/src/third_party/fft2d
+ third_party/tflite/src/third_party/xla/third_party/tsl
+ third_party/tflite/src/third_party/xla/xla/tsl/util
+ third_party/tflite/src/third_party/xla/xla/tsl/framework
+ third_party/ukey2
+ third_party/utf
+ third_party/vulkan
+ third_party/wayland
+ third_party/webdriver
+ third_party/webgpu-cts
+ third_party/webrtc
+ third_party/webrtc/common_audio/third_party/ooura
+ third_party/webrtc/common_audio/third_party/spl_sqrt_floor
+ third_party/webrtc/modules/third_party/fft
+ third_party/webrtc/modules/third_party/g711
+ third_party/webrtc/modules/third_party/g722
+ third_party/webrtc/rtc_base/third_party/base64
+ third_party/webrtc/rtc_base/third_party/sigslot
+ third_party/webrtc/rtc_tools
+ third_party/widevine
+ third_party/woff2
+ third_party/wuffs
+ third_party/x11proto
+ third_party/xcbproto
+ third_party/xnnpack
+ third_party/zlib/google
+ third_party/zxcvbn-cpp
+ url/third_party/mozilla
+ v8/src/third_party/siphash
+ v8/src/third_party/utf8-decoder
+ v8/src/third_party/valgrind
+ v8/third_party/glibc
+ v8/third_party/inspector_protocol
+ v8/third_party/v8/builtins
+ v8/third_party/v8/codegen
+)
+
+%if ! %{with system_harfbuzz}
+keeplibs+=( third_party/harfbuzz-ng )
+%endif
+%if ! %{with system_freetype}
+keeplibs+=( third_party/freetype )
+%endif
+%if ! %{with system_icu}
+keeplibs+=( third_party/icu )
+%endif
+%if ! %{with system_ffmpeg}
+keeplibs+=( third_party/ffmpeg )
+%endif
+%if ! %{with system_zlib}
+keeplibs+=( third_party/zlib )
+%endif
+%if ! %{with system_vpx}
+keeplibs+=(
+ third_party/libvpx
+ third_party/libvpx/source/libvpx/third_party/x86inc
+)
+%endif
+%if !%{with system_avif}
+keeplibs+=( third_party/libyuv )
+keeplibs+=( third_party/libavif )
+%endif
+%if !%{with system_webp} || !%{with system_avif}
+keeplibs+=( third_party/libwebp )
+%endif
+keeplibs+=(
+ third_party/speech-dispatcher
+ third_party/usb_ids
+ third_party/xdg-utils
+)
+%if ! %{with system_re2}
+keeplibs+=( third_party/re2 )
+%endif
+%if ! %{with system_zlib}
+keeplibs+=( third_party/zlib )
+%endif
+keeplibs+=( third_party/lit )
+keeplibs+=( third_party/rust/chromium_crates_io )
+keeplibs+=( third_party/rust/cxx )
+%if ! %{with system_zstd}
+keeplibs+=( third_party/zstd )
+%endif
+build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove
+
+# GN sets lto on its own and we need just ldflag options, not cflags
+%define _lto_cflags %{nil}
+%undefine _debugsource_packages
+%if %{with clang}
+export CC=clang
+export CXX=clang++
+export AR=llvm-ar
+export NM=llvm-nm
+export RANLIB=llvm-ranlib
+%else
+export CC=gcc
+export CXX=g++
+export AR=ar
+export NM=nm
+export RANLIB=ranlib
+%endif
+
+# REDUCE DEBUG as it gets TOO large
+ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g / /g' -e 's/ -g / /g' -e 's/ -g$//g'`"
+export CXXFLAGS="${ARCH_FLAGS} -Wno-return-type"
+# extra flags to reduce warnings that aren't very useful
+export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations"
+# ignore warnings for minor mistakes that are too common
+export CXXFLAGS="${CXXFLAGS} -Wno-return-type -Wno-parentheses -Wno-misleading-indentation"
+# ignore warnings that are not supported well until gcc 8
+# ignore warnings due to gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84055)
+export CXXFLAGS="${CXXFLAGS} -Wno-attributes -Wno-ignored-attributes"
+# ingore new gcc 8 warnings that aren't yet handled upstream
+export CXXFLAGS="${CXXFLAGS} -Wno-address -Wno-dangling-else -D_GNU_SOURCE"
+export CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS}
+# for wayland
+export CXXFLAGS="${CXXFLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon -I/usr/include/opus"
+%if %{with clang}
+export LDFLAGS="${LDFLAGS} -Wl,--build-id=sha1"
+export CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument -Wno-unknown-warning-option"
+%endif
+%ifarch aarch64
+%if %{without clang}
+export CXXFLAGS="${CXXFLAGS} -flax-vector-conversions -fno-omit-frame-pointer"
+%else
+export CXXFLAGS="${CXXFLAGS} -flax-vector-conversions=all"
+%endif
+%endif
+%if %{without clang}
+export CXXFLAGS="${CXXFLAGS} -Wno-unused-but-set-variable -Wno-packed-not-aligned"
+%endif
+export CFLAGS="${CXXFLAGS}"
+%if %{without clang}
+export CXXFLAGS="${CXXFLAGS} -Wno-subobject-linkage -Wno-class-memaccess"
+%endif
+export CXXFLAGS="${CXXFLAGS} -Wno-invalid-offsetof -fpermissive"
+%if %{with lto} && %{without clang}
+# reduce the threads for linking even more due to LTO eating ton of memory
+_link_threads=$(((%{jobs} - 2)))
+test "$_link_threads" -le 0 && _link_threads=1
+export LDFLAGS="-flto=$_link_threads --param lto-max-streaming-parallelism=1"
+%endif
+
+# Set system libraries to be used
+gn_system_libraries=(
+ flac
+ fontconfig
+ libdrm
+ libevent
+ libjpeg
+ libpng
+ libxslt
+ libusb
+ libxml
+ opus
+ snappy
+)
+%if %{with system_harfbuzz}
+gn_system_libraries+=( harfbuzz-ng )
+%endif
+%if %{with system_freetype}
+gn_system_libraries+=( freetype )
+%endif
+%if %{with system_icu}
+gn_system_libraries+=( icu )
+%endif
+%if %{with system_vpx}
+gn_system_libraries+=( libvpx )
+%endif
+%if %{with system_ffmpeg}
+gn_system_libraries+=( ffmpeg )
+%endif
+%if %{with system_re2}
+gn_system_libraries+=( re2 )
+%endif
+%if %{with system_webp}
+gn_system_libraries+=( libwebp )
+%endif
+%if %{with system_zlib}
+gn_system_libraries+=( zlib )
+%endif
+%if %{with system_zstd}
+gn_system_libraries+=( zstd )
+%endif
+build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]}
+
+# Configuration for GN
+# Available options: out/Release/gn args --list out/Release/
+gn_conf=""
+gn_conf+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
+gn_conf+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
+gn_conf+=" use_custom_libcxx=false"
+%ifarch x86_64
+gn_conf+=" host_cpu=\"x64\""
+%endif
+%ifarch riscv64
+gn_conf+=" host_cpu=\"riscv64\""
+%endif
+gn_conf+=" is_debug=false"
+gn_conf+=" dcheck_always_on=false"
+gn_conf+=" enable_nacl=false"
+%if %{with swiftshader}
+gn_conf+=" use_swiftshader_with_subzero=true"
+%endif
+%ifarch aarch64
+gn_conf+=" enable_swiftshader=false"
+gn_conf+=" dawn_use_swiftshader=false"
+%endif
+gn_conf+=" is_component_ffmpeg=true"
+gn_conf+=" use_cups=true"
+gn_conf+=" use_aura=true"
+gn_conf+=" symbol_level=1"
+gn_conf+=" blink_symbol_level=0"
+gn_conf+=" use_kerberos=true"
+gn_conf+=" enable_vr=false"
+gn_conf+=" optimize_webui=false"
+gn_conf+=" enable_reading_list=false"
+gn_conf+=" use_pulseaudio=true link_pulseaudio=true"
+gn_conf+=" is_component_build=false"
+gn_conf+=" use_sysroot=false"
+gn_conf+=" fatal_linker_warnings=false"
+gn_conf+=" use_allocator_shim=true"
+gn_conf+=" use_partition_alloc=true"
+gn_conf+=" disable_fieldtrial_testing_config=true"
+gn_conf+=" use_gnome_keyring=false"
+gn_conf+=" use_unofficial_version_number=false"
+%ifnarch riscv64
+gn_conf+=" use_vaapi=true"
+%endif
+gn_conf+=" use_sysroot=false"
+gn_conf+=" treat_warnings_as_errors=false"
+gn_conf+=" enable_widevine=false"
+gn_conf+=" use_dbus=true"
+gn_conf+=" media_use_openh264=false"
+gn_conf+=" rtc_use_h264=false"
+gn_conf+=" use_v8_context_snapshot=true"
+gn_conf+=" v8_use_external_startup_data=true"
+gn_conf+=" safe_browsing_use_unrar=false"
+%if %{with gtk4}
+gn_conf+=" gtk_version=4"
+%endif
+%if %{without qt}
+gn_conf+=" use_qt=false"
+%else
+gn_conf+=" moc_qt5_path=\"%{_libdir}/qt5/bin\""
+%endif
+# See dependency logic in third_party/BUILD.gn
+%if %{with system_harfbuzz}
+gn_conf+=" use_system_harfbuzz=true"
+%endif
+%if %{with system_freetype}
+gn_conf+=" use_system_freetype=true"
+%endif
+gn_conf+=" enable_hangout_services_extension=true"
+gn_conf+=" enable_vulkan=true"
+%if %{with pipewire}
+gn_conf+=" rtc_use_pipewire=true rtc_link_pipewire=true"
+%endif
+%if %{with clang}
+gn_conf+=" is_clang=true clang_version=\"$clang_version\" clang_base_path=\"$clang_base_path\" clang_use_chrome_plugins=false"
+%if %{with lto} && %{with clang}
+gn_conf+=" use_thin_lto=true"
+%endif
+gn_conf+=" use_lld=true"
+%else
+gn_conf+=" is_clang=false"
+%ifnarch riscv64 aarch64
+gn_conf+=" use_gold=true"
+%endif
+%endif
+%if %{with lto} && %{without clang}
+gn_conf+=" gcc_lto=true"
+%endif
+%if %{with system_icu}
+gn_conf+=" icu_use_data_file=false"
+%endif
+gn_conf+=" rust_sysroot_absolute=\"%{_prefix}\""
+gn_conf+=" rustc_version=\"$rustc_version\""
+gn_conf+=" rust_bindgen_root=\"$rust_bindgen_root\""
+
+# The proprietary codecs just force the chromium to say they can use it and
+# offload the actual computation to the ffmpeg, otherwise the chromium
+# won't be able to load the codec even if the library can handle it
+gn_conf+=" proprietary_codecs=true"
+gn_conf+=" ffmpeg_branding=\"Chrome\""
+
+%ifarch aarch64
+gn_conf+=" host_cpu=\"arm64\""
+%if %{with arm_bti}
+gn_conf+=" arm_control_flow_integrity=\"standard\""
+%else
+gn_conf+=" arm_control_flow_integrity=\"none\""
+%endif
+%endif
+
+gn_conf+=" google_api_key=\"%{api_key}\""
+
+gn_conf+=" use_system_libffi=true"
+
+
+%if %{bootstrap}
+tools/gn/bootstrap/bootstrap.py --gn-gen-args="${gn_conf}"
+%else
+mkdir -p %{outputdir} && cp -a %{_bindir}/gn %{outputdir}/
+%endif
+
+# GN does not support passing cflags:
+# https://bugs.chromium.org/p/chromium/issues/detail?id=642016
+%{outputdir}/gn gen --args="${gn_conf}" %{outputdir}
+
+%{!?njobs:%global njobs %{_smp_build_ncpus}}
+ninja -v -j%njobs -C %{outputdir} chrome chromedriver
+
+%install
+bash %{SOURCE4} -s %{buildroot} -l %{_libdir} %{!?with_system_icu:-i true} -o %{outputdir}
+# chromedriver
+cp -a %{outputdir}/chromedriver.unstripped %{buildroot}%{_libdir}/chromium/chromedriver
+ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver
+# link to browser plugin path.
+mkdir -p %{buildroot}%{_libdir}/browser-plugins
+ln -s %{_libdir}/browser-plugins %{buildroot}%{_libdir}/chromium/plugins
+# Install the master_preferences file
+mkdir -p %{buildroot}%{_sysconfdir}/chromium
+install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/chromium
+# Compat link
+ln -s %{_bindir}/chromium-browser %{buildroot}%{_bindir}/chromium
+# Policy dirs
+mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies
+mkdir %{buildroot}%{_sysconfdir}/chromium/policies/managed
+mkdir %{buildroot}%{_sysconfdir}/chromium/policies/recommended
+chmod -w %{buildroot}%{_sysconfdir}/chromium/policies/managed
+mkdir -p %{buildroot}%{_datadir}/chromium/extensions
+mkdir -p %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts
+# SVG
+install -Dm 0644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/chromium-browser.svg
+
+%files
+%license LICENSE
+%doc AUTHORS
+%{_datadir}/chromium
+%dir %{_sysconfdir}/chromium
+%dir %{_sysconfdir}/chromium/policies
+%dir %{_sysconfdir}/chromium/policies/managed
+%dir %{_sysconfdir}/chromium/policies/recommended
+%dir %{_sysconfdir}/chromium/native-messaging-hosts
+%config %{_sysconfdir}/chromium/master_preferences
+%{_libdir}/chromium
+%{_datadir}/applications/*.desktop
+%{_datadir}/metainfo/chromium-browser.appdata.xml
+%{_datadir}/icons/hicolor
+%exclude %{_libdir}/chromium/chromedriver
+%{_bindir}/chromium-browser
+%{_bindir}/chromium
+%{_mandir}/man1/chromium-browser.1*
+
+%files -n chromedriver
+%{_libdir}/chromium/chromedriver
+%{_bindir}/chromedriver
+
+%changelog
+* Wed Oct 09 2024 misaka00251 <liuxin@iscas.ac.cn> - 128.0.6613.119-1
+- Upgrade to version 128
+
+* Tue Jul 02 2024 misaka0251 <liuxin@iscas.ac.cn> - 125.0.6422.141-1
+- Upgrade to version 125
+
+* Wed Mar 06 2024 misaka00251 <liuxin@iscas.ac.cn> - 119.0.6045.159-1
+- Upgrade to version 119
+
+* Wed Dec 30 2020 Jeffery.Gao <gaojianxing@huawei.com> - 87.0.4280.88-1
+- Package init
diff --git a/emplace.patch b/emplace.patch
new file mode 100644
index 0000000..8c16e27
--- /dev/null
+++ b/emplace.patch
@@ -0,0 +1,79 @@
+Index: chromium-128.0.6613.113/components/viz/service/display/surface_aggregator.h
+===================================================================
+--- chromium-128.0.6613.113.orig/components/viz/service/display/surface_aggregator.h
++++ chromium-128.0.6613.113/components/viz/service/display/surface_aggregator.h
+@@ -131,13 +131,18 @@ class VIZ_SERVICE_EXPORT SurfaceAggregat
+ struct PrewalkResult;
+
+ struct AggregateStatistics {
+- int prewalked_surface_count = 0;
+- int copied_surface_count = 0;
++ AggregateStatistics()
++ : prewalked_surface_count(0),
++ copied_surface_count(0),
++ has_pixel_moving_filter(false),
++ has_unembedded_pass(false) {}
++ int prewalked_surface_count;
++ int copied_surface_count;
+ // True if the current frame contains a pixel-moving foreground filter
+ // render pass.
+- bool has_pixel_moving_filter = false;
++ bool has_pixel_moving_filter;
+ // True if the current frame contains a unembedded render pass.
+- bool has_unembedded_pass = false;
++ bool has_unembedded_pass;
+
+ base::TimeDelta prewalk_time;
+ base::TimeDelta copy_time;
+Index: chromium-128.0.6613.113/gpu/command_buffer/service/shared_image/shared_image_backing.h
+===================================================================
+--- chromium-128.0.6613.113.orig/gpu/command_buffer/service/shared_image/shared_image_backing.h
++++ chromium-128.0.6613.113/gpu/command_buffer/service/shared_image/shared_image_backing.h
+@@ -389,7 +389,7 @@ class GPU_GLES2_EXPORT SharedImageBackin
+ private:
+ class ScopedWriteUMA {
+ public:
+- ScopedWriteUMA() = default;
++ ScopedWriteUMA() : content_consumed_(false) {}
+
+ ScopedWriteUMA(const ScopedWriteUMA&) = delete;
+ ScopedWriteUMA& operator=(const ScopedWriteUMA&) = delete;
+@@ -403,7 +403,7 @@ class GPU_GLES2_EXPORT SharedImageBackin
+ void SetConsumed() { content_consumed_ = true; }
+
+ private:
+- bool content_consumed_ = false;
++ bool content_consumed_;
+ };
+
+ const Mailbox mailbox_;
+Index: chromium-128.0.6613.113/mojo/public/cpp/bindings/lib/multiplex_router.h
+===================================================================
+--- chromium-128.0.6613.113.orig/mojo/public/cpp/bindings/lib/multiplex_router.h
++++ chromium-128.0.6613.113/mojo/public/cpp/bindings/lib/multiplex_router.h
+@@ -315,8 +315,9 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS
+ // are not managed by the MultiplexRouter and thus are not relevant here.
+ struct ExclusiveSyncWaitInfo {
+ InterfaceId interface_id = kInvalidInterfaceId;
+- uint64_t request_id = 0;
+- bool finished = false;
++ uint64_t request_id;
++ bool finished;
++ ExclusiveSyncWaitInfo() : request_id(0), finished(false) {}
+ };
+ std::optional<ExclusiveSyncWaitInfo> exclusive_sync_wait_;
+
+Index: chromium-128.0.6613.113/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.h
+===================================================================
+--- chromium-128.0.6613.113.orig/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.h
++++ chromium-128.0.6613.113/third_party/blink/renderer/modules/media_controls/elements/media_control_timeline_element.h
+@@ -51,7 +51,8 @@ class MediaControlTimelineElement : publ
+ // Struct used to track the current live time.
+ struct LiveAnchorTime {
+ base::TimeTicks clock_time_;
+- double media_time_ = 0;
++ double media_time_;
++ LiveAnchorTime() : media_time_(0) {}
+ };
+
+ void DefaultEventHandler(Event&) override;
diff --git a/fix_building_widevinecdm_with_chromium.patch b/fix_building_widevinecdm_with_chromium.patch
new file mode 100644
index 0000000..24f3d5e
--- /dev/null
+++ b/fix_building_widevinecdm_with_chromium.patch
@@ -0,0 +1,11 @@
+Index: chromium-79.0.3941.4/third_party/widevine/cdm/widevine_cdm_version.h
+===================================================================
+--- chromium-79.0.3941.4.orig/third_party/widevine/cdm/widevine_cdm_version.h
++++ chromium-79.0.3941.4/third_party/widevine/cdm/widevine_cdm_version.h
+@@ -11,5 +11,6 @@
+ // If the Widevine CDM is available define the following:
+ // - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available
+ // as a string, e.g., "1.0.123.456").
++#define WIDEVINE_CDM_VERSION_STRING "unknown"
+
+ #endif // WIDEVINE_CDM_VERSION_H_
diff --git a/gcc-enable-lto.patch b/gcc-enable-lto.patch
new file mode 100644
index 0000000..f64eeaf
--- /dev/null
+++ b/gcc-enable-lto.patch
@@ -0,0 +1,70 @@
+Index: chromium-120.0.6099.18/build/config/BUILDCONFIG.gn
+===================================================================
+--- chromium-120.0.6099.18.orig/build/config/BUILDCONFIG.gn
++++ chromium-120.0.6099.18/build/config/BUILDCONFIG.gn
+@@ -135,6 +135,8 @@ declare_args() {
+ # set "is_official_build" to true for any build intended to ship to end-users.
+ is_official_build = false
+
++ gcc_lto = false
++
+ # Set to true when compiling with the Clang compiler.
+ is_clang = current_os != "linux" ||
+ (current_cpu != "s390x" && current_cpu != "s390" &&
+@@ -354,6 +356,12 @@ default_compiler_configs = [
+ "//build/config/sanitizers:default_sanitizer_flags",
+ ]
+
++if (gcc_lto) {
++ default_compiler_configs += [
++ "//build/config/compiler:gcc_lto",
++ ]
++}
++
+ if (is_win) {
+ default_compiler_configs += [
+ "//build/config/win:default_cfg_compiler",
+Index: chromium-120.0.6099.18/build/config/compiler/BUILD.gn
+===================================================================
+--- chromium-120.0.6099.18.orig/build/config/compiler/BUILD.gn
++++ chromium-120.0.6099.18/build/config/compiler/BUILD.gn
+@@ -2342,6 +2342,10 @@ if (is_win) {
+ common_optimize_on_cflags += [ "-fno-math-errno" ]
+ }
+
++config("gcc_lto") {
++ cflags = [ "-flto" ]
++}
++
+ config("default_stack_frames") {
+ if (!is_win) {
+ if (enable_frame_pointers) {
+Index: chromium-120.0.6099.18/sandbox/linux/BUILD.gn
+===================================================================
+--- chromium-120.0.6099.18.orig/sandbox/linux/BUILD.gn
++++ chromium-120.0.6099.18/sandbox/linux/BUILD.gn
+@@ -253,6 +253,9 @@ component("seccomp_bpf") {
+ "//build:chromeos_buildflags",
+ "//sandbox:sandbox_buildflags",
+ ]
++ if (gcc_lto) {
++ configs -= [ "//build/config/compiler:gcc_lto" ]
++ }
+
+ if (is_android) {
+ sources += [
+Index: chromium-120.0.6099.18/base/BUILD.gn
+===================================================================
+--- chromium-120.0.6099.18.orig/base/BUILD.gn
++++ chromium-120.0.6099.18/base/BUILD.gn
+@@ -3561,6 +3561,10 @@
+ sources += [ "location_unittest.cc" ]
+ }
+
++ if (gcc_lto) {
++ configs -= [ "//build/config/compiler:gcc_lto" ]
++ }
++
+ if (build_rust_base_conversions) {
+ sources += [
+ "containers/span_rust_unittest.cc",
diff --git a/gn-absl.patch b/gn-absl.patch
new file mode 100644
index 0000000..20d1202
--- /dev/null
+++ b/gn-absl.patch
@@ -0,0 +1,174 @@
+ERROR at //build/config/BUILDCONFIG.gn:533:5: Dependency not allowed.
+ target(_target_type, target_name) {
+ ^----------------------------------
+The item //third_party/webrtc/pc:media_protocol_names
+can not depend on //third_party/abseil-cpp/absl/strings:string_view
+because it is not in //third_party/abseil-cpp/absl/strings:string_view's visibility list: [
+ //third_party/abseil-cpp/*
+ //third_party/googletest/*
+ //third_party/webrtc/rtc_tools:frame_analyzer
+ //third_party/webrtc/rtc_tools:rtp_generator
+ //third_party/webrtc/rtc_tools:video_replay
+ //chromecast/internal/*
+ //libassistant/*
+ //components/optimization_guide/internal/*
+]
+
+
+Absl used to have absl_deps, but that got removed with:
+commit 99c519b3fdac0cbedaecead04a841e89a5f0f69b
+Author: Florent Castelli <orphis@webrtc.org>
+Date: Thu May 23 11:21:53 2024 +0000
+
+ Mass removal of absl_deps in all BUILD.gn files
+
+Newer gn is fine with s/absl_deps/deps/, but bookworm's gn
+requires manually changing the visibility of all the absl
+libs.
+
+--- a/third_party/abseil-cpp/absl/strings/BUILD.gn
++++ b/third_party/abseil-cpp/absl/strings/BUILD.gn
+@@ -8,6 +8,7 @@ import("//third_party/abseil-cpp/absl.gn
+ absl_source_set("string_view") {
+ sources = [ "string_view.cc" ]
+ public = [ "string_view.h" ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base",
+ "//third_party/abseil-cpp/absl/base:config",
+@@ -58,6 +59,7 @@ absl_source_set("strings") {
+ "strip.h",
+ "substitute.h",
+ ]
++ visibility = [ "*" ]
+ public_deps = [
+ # string_view.h was once part of :strings, so string_view.h is
+ # re-exported for backwards compatibility.
+--- a/third_party/abseil-cpp/absl/types/BUILD.gn
++++ b/third_party/abseil-cpp/absl/types/BUILD.gn
+@@ -61,6 +61,7 @@ absl_test("span_test") {
+ absl_source_set("optional") {
+ sources = [ "internal/optional.h" ]
+ public = [ "optional.h" ]
++ visibility = [ "*" ]
+ public_deps = [
+ ":bad_optional_access",
+ "//third_party/abseil-cpp/absl/base:base_internal",
+@@ -90,6 +91,7 @@ absl_source_set("bad_variant_access") {
+ absl_source_set("variant") {
+ sources = [ "internal/variant.h" ]
+ public = [ "variant.h" ]
++ visibility = [ "*" ]
+ public_deps = [
+ ":bad_variant_access",
+ "//third_party/abseil-cpp/absl/base:base_internal",
+--- a/third_party/abseil-cpp/absl/meta/BUILD.gn
++++ b/third_party/abseil-cpp/absl/meta/BUILD.gn
+@@ -6,6 +6,7 @@ import("//third_party/abseil-cpp/absl.gn
+
+ absl_source_set("type_traits") {
+ public = [ "type_traits.h" ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base:config",
+ "//third_party/abseil-cpp/absl/base:core_headers",
+--- a/third_party/abseil-cpp/absl/base/BUILD.gn
++++ b/third_party/abseil-cpp/absl/base/BUILD.gn
+@@ -39,6 +39,7 @@ absl_source_set("no_destructor") {
+ absl_source_set("nullability") {
+ sources = [ "internal/nullability_impl.h" ]
+ public = [ "nullability.h" ]
++ visibility = [ "*" ]
+ deps = [
+ ":config",
+ ":core_headers",
+@@ -82,6 +83,7 @@ absl_source_set("config") {
+ "options.h",
+ "policy_checks.h",
+ ]
++ visibility = [ "*" ]
+ }
+
+ absl_source_set("cycleclock_internal") {
+@@ -117,6 +119,7 @@ absl_source_set("core_headers") {
+ "port.h",
+ "thread_annotations.h",
+ ]
++ visibility = [ "*" ]
+ public_deps = [ ":config" ]
+ }
+
+--- a/third_party/abseil-cpp/absl/algorithm/BUILD.gn
++++ b/third_party/abseil-cpp/absl/algorithm/BUILD.gn
+@@ -6,11 +6,13 @@ import("//third_party/abseil-cpp/absl.gn
+
+ absl_source_set("algorithm") {
+ public = [ "algorithm.h" ]
++ visibility = [ "*" ]
+ deps = [ "//third_party/abseil-cpp/absl/base:config" ]
+ }
+
+ absl_source_set("container") {
+ public = [ "container.h" ]
++ visibility = [ "*" ]
+ deps = [
+ ":algorithm",
+ "//third_party/abseil-cpp/absl/base:config",
+--- a/third_party/abseil-cpp/absl/container/BUILD.gn
++++ b/third_party/abseil-cpp/absl/container/BUILD.gn
+@@ -50,6 +50,7 @@ absl_source_set("inlined_vector_internal
+
+ absl_source_set("inlined_vector") {
+ public = [ "inlined_vector.h" ]
++ visibility = [ "*" ]
+ deps = [
+ ":inlined_vector_internal",
+ "//third_party/abseil-cpp/absl/algorithm",
+--- a/third_party/abseil-cpp/absl/numeric/BUILD.gn
++++ b/third_party/abseil-cpp/absl/numeric/BUILD.gn
+@@ -9,6 +9,7 @@ absl_source_set("bits") {
+ "bits.h",
+ "internal/bits.h",
+ ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base:config",
+ "//third_party/abseil-cpp/absl/base:core_headers",
+--- a/third_party/abseil-cpp/absl/functional/BUILD.gn
++++ b/third_party/abseil-cpp/absl/functional/BUILD.gn
+@@ -7,6 +7,7 @@ import("//third_party/abseil-cpp/absl.gn
+ absl_source_set("any_invocable") {
+ sources = [ "internal/any_invocable.h" ]
+ public = [ "any_invocable.h" ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base:base_internal",
+ "//third_party/abseil-cpp/absl/base:config",
+@@ -34,6 +35,7 @@ absl_test("any_invocable_test") {
+ absl_source_set("bind_front") {
+ sources = [ "internal/front_binder.h" ]
+ public = [ "bind_front.h" ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base:base_internal",
+ "//third_party/abseil-cpp/absl/container:compressed_tuple",
+--- a/third_party/abseil-cpp/absl/memory/BUILD.gn
++++ b/third_party/abseil-cpp/absl/memory/BUILD.gn
+@@ -6,6 +6,7 @@ import("//third_party/abseil-cpp/absl.gn
+
+ absl_source_set("memory") {
+ public = [ "memory.h" ]
++ visibility = [ "*" ]
+ deps = [
+ "//third_party/abseil-cpp/absl/base:core_headers",
+ "//third_party/abseil-cpp/absl/meta:type_traits",
+--- a/third_party/abseil-cpp/absl/cleanup/BUILD.gn
++++ b/third_party/abseil-cpp/absl/cleanup/BUILD.gn
+@@ -16,6 +16,7 @@ absl_source_set("cleanup_internal") {
+
+ absl_source_set("cleanup") {
+ public = [ "cleanup.h" ]
++ visibility = [ "*" ]
+ deps = [
+ ":cleanup_internal",
+ "//third_party/abseil-cpp/absl/base:config",
diff --git a/gn-funcs.patch b/gn-funcs.patch
new file mode 100644
index 0000000..41f8e9f
--- /dev/null
+++ b/gn-funcs.patch
@@ -0,0 +1,80 @@
+author: Andres Salomon <dilinger@debian.org>
+
+filter_labels_{include,exclude} was added to gn in Feb 2024
+(https://gn.googlesource.com/gn/+/e05c0aa00938adc0797bda1e8f2c15675aa13c30%5E%21/),
+so obviously bookworm's gn doesn't have it.
+
+The old webrtc code just hardcoded abseil-cpp:absl if building
+with chromium, which is simple enough..
+
+--- a/third_party/webrtc/webrtc.gni
++++ b/third_party/webrtc/webrtc.gni
+@@ -677,16 +677,13 @@ template("rtc_source_set") {
+ "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
+
+ # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
+- if (build_with_chromium && defined(deps)) {
+- absl_dependencies =
+- filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
+- if (absl_dependencies != []) {
+- filtered_deps =
+- filter_labels_exclude(deps, [ "//third_party/abseil-cpp/*" ])
+- deps = []
+- deps = filtered_deps
++ if (build_with_chromium) {
++ if (!defined(deps)) {
++ deps = []
++ }
+ deps += [ "//third_party/abseil-cpp:absl" ]
+- }
++ } else {
++ assert("not building with chromium??")
+ }
+ }
+ }
+@@ -769,16 +766,13 @@ template("rtc_static_library") {
+ "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
+
+ # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
+- if (build_with_chromium && defined(deps)) {
+- absl_dependencies =
+- filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
+- if (absl_dependencies != []) {
+- filtered_deps =
+- filter_labels_exclude(deps, [ "//third_party/abseil-cpp/*" ])
+- deps = []
+- deps = filtered_deps
++ if (build_with_chromium) {
++ if (!defined(deps)) {
++ deps = []
++ }
+ deps += [ "//third_party/abseil-cpp:absl" ]
+- }
++ } else {
++ assert("not building with chromium??")
+ }
+ }
+ }
+@@ -911,16 +905,13 @@ template("rtc_library") {
+ "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
+
+ # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
+- if (build_with_chromium && defined(deps)) {
+- absl_dependencies =
+- filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
+- if (absl_dependencies != []) {
+- filtered_deps =
+- filter_labels_exclude(deps, [ "//third_party/abseil-cpp/*" ])
+- deps = []
+- deps = filtered_deps
++ if (build_with_chromium) {
++ if (!defined(deps)) {
++ deps = []
++ }
+ deps += [ "//third_party/abseil-cpp:absl" ]
+- }
++ } else {
++ assert("not building with chromium??")
+ }
+ }
+ }
diff --git a/master_preferences b/master_preferences
new file mode 100644
index 0000000..fb74807
--- /dev/null
+++ b/master_preferences
@@ -0,0 +1,30 @@
+{
+ "homepage": "https://www.openeuler.org/",
+ "homepage_is_newtabpage": false,
+ "distribution": {
+ "skip_first_run_ui": true,
+ "alternate_shortcut_text": false,
+ "oem_bubble": true,
+ "chrome_shortcut_icon_index": 0,
+ "create_all_shortcuts": true,
+ "show_welcome_page": true,
+ "system_level": false,
+ "verbose_logging": false,
+ "make_chrome_default": false,
+ "make_chrome_default_for_user": false
+ },
+ "download": {
+ "extensions_to_open": "ymp"
+ },
+ "browser": {
+ "show_home_button": true,
+ "check_default_browser": false,
+ "custom_chrome_frame": true
+ },
+ "bookmark_bar": {
+ "show_on_all_tabs": true
+ },
+ "first_run_tabs": [
+ "https://www.openeuler.org/"
+ ]
+ }
diff --git a/riscv-cpuinfo.patch b/riscv-cpuinfo.patch
new file mode 100644
index 0000000..0509ae2
--- /dev/null
+++ b/riscv-cpuinfo.patch
@@ -0,0 +1,32 @@
+Index: chromium-124.0.6367.201/third_party/cpuinfo/BUILD.gn
+===================================================================
+--- chromium-124.0.6367.201.orig/third_party/cpuinfo/BUILD.gn
++++ chromium-124.0.6367.201/third_party/cpuinfo/BUILD.gn
+@@ -123,6 +123,12 @@ source_set("cpu_specific") {
+ ]
+ }
+
++ if (current_cpu == "riscv64") {
++ sources = [
++ "src/src/riscv/uarch.c",
++ ]
++ }
++
+ # Because "init.c" is reused again, but only has sources in the corresponding
+ # build config.
+ deps = [ ":x86_cache" ]
+@@ -209,6 +215,14 @@ source_set("cpu_and_os_specific") {
+ }
+ }
+
++ if (is_linux && current_cpu == "riscv64") {
++ sources = [
++ "src/src/riscv/linux/init.c",
++ "src/src/riscv/linux/riscv-hw.c",
++ "src/src/riscv/linux/riscv-isa.c",
++ ]
++ }
++
+ if (is_android && (current_cpu == "x86" || current_cpu == "x64")) {
+ sources = [
+ "src/src/x86/linux/cpuinfo.c",
diff --git a/riscv-dav1d.patch b/riscv-dav1d.patch
new file mode 100644
index 0000000..e20413d
--- /dev/null
+++ b/riscv-dav1d.patch
@@ -0,0 +1,53 @@
+Index: chromium-113.0.5672.92/third_party/dav1d/config/linux/riscv64/config.h
+===================================================================
+--- /dev/null
++++ chromium-113.0.5672.92/third_party/dav1d/config/linux/riscv64/config.h
+@@ -0,0 +1,48 @@
++/*
++ * Autogenerated by the Meson build system.
++ * Do not edit, your changes will be lost.
++ */
++
++#pragma once
++
++#define ARCH_AARCH64 0
++
++#define ARCH_ARM 0
++
++#define ARCH_PPC64LE 0
++
++#define ARCH_X86 0
++
++#define ARCH_X86_32 0
++
++#define ARCH_X86_64 0
++
++#define CONFIG_16BPC 1
++
++#define CONFIG_8BPC 1
++
++// #define CONFIG_LOG 1 -- Logging is controlled by Chromium
++
++#define ENDIANNESS_BIG 0
++
++#define HAVE_ASM 0
++
++#define HAVE_AS_FUNC 0
++
++#define HAVE_C11_GENERIC 1
++
++#define HAVE_CLOCK_GETTIME 1
++
++#define HAVE_DLSYM 1
++
++#define HAVE_GETAUXVAL 1
++
++#define HAVE_POSIX_MEMALIGN 1
++
++// #define HAVE_PTHREAD_GETAFFINITY_NP 1 -- Controlled by Chomium
++
++// #define HAVE_PTHREAD_SETAFFINITY_NP 1 -- Controlled by Chomium
++
++#define HAVE_UNISTD_H 1
++
++#define TRIM_DSP_FUNCTIONS 1
diff --git a/riscv-sandbox.patch b/riscv-sandbox.patch
new file mode 100644
index 0000000..a73aa9d
--- /dev/null
+++ b/riscv-sandbox.patch
@@ -0,0 +1,2043 @@
+Index: chromium-122.0.6261.128/sandbox/features.gni
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/features.gni
++++ chromium-122.0.6261.128/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 == "riscv64")
+
+ # 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
+Index: chromium-122.0.6261.128/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
++++ chromium-122.0.6261.128/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(__riscv)
++
++#include <asm/unistd.h>
++#define MIN_SYSCALL 0u
++#define MAX_PUBLIC_SYSCALL __NR_syscalls
++#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
++
+ #else
+ #error "Unsupported architecture"
+ #endif
+Index: chromium-122.0.6261.128/sandbox/linux/bpf_dsl/seccomp_macros.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/bpf_dsl/seccomp_macros.h
++++ chromium-122.0.6261.128/sandbox/linux/bpf_dsl/seccomp_macros.h
+@@ -343,6 +343,48 @@ 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(__riscv)
++struct regs_struct {
++ unsigned long regs[32];
++};
++
++#define SECCOMP_ARCH AUDIT_ARCH_RISCV64
++
++#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.__gregs[_reg])
++
++#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, REG_A0)
++#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, REG_A0+7)
++#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.__gregs[REG_PC]
++#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, REG_A0)
++#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, REG_A0+1)
++#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, REG_A0+2)
++#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, REG_A0+3)
++#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, REG_A0+4)
++#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, REG_A0+5)
++#define SECCOMP_PARM7(_ctx) SECCOMP_REG(_ctx, REG_A0+6)
++
++#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).regs[REG_A0]
++#define SECCOMP_PT_SYSCALL(_regs) (_regs).regs[REG_A0+7]
++#define SECCOMP_PT_IP(_regs) (_regs).regs[REG_PC]
++#define SECCOMP_PT_PARM1(_regs) (_regs).regs[REG_A0]
++#define SECCOMP_PT_PARM2(_regs) (_regs).regs[REG_A0+1]
++#define SECCOMP_PT_PARM3(_regs) (_regs).regs[REG_A0+2]
++#define SECCOMP_PT_PARM4(_regs) (_regs).regs[REG_A0+3]
++#define SECCOMP_PT_PARM5(_regs) (_regs).regs[REG_A0+4]
++#define SECCOMP_PT_PARM6(_regs) (_regs).regs[REG_A0+5]
++#define SECCOMP_PT_PARM7(_regs) (_regs).regs[REG_A0+6]
+ #else
+ #error Unsupported target platform
+
+Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+@@ -60,6 +60,9 @@ bool IsBaselinePolicyAllowed(int sysno)
+ #if defined(__mips__)
+ SyscallSets::IsMipsPrivate(sysno) ||
+ #endif
++#if defined(__riscv)
++ SyscallSets::IsRiscvPrivate(sysno) ||
++#endif
+ SyscallSets::IsAllowedOperationOnFd(sysno);
+ // clang-format on
+ }
+@@ -193,7 +196,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ return RestrictFcntlCommands();
+ #endif
+
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ // fork() is never used as a system call (clone() is used instead), but we
+ // have seen it in fallback code on Android.
+ if (sysno == __NR_fork) {
+@@ -255,7 +258,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ }
+
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ if (sysno == __NR_mmap)
+ return RestrictMmapFlags();
+ #endif
+@@ -276,7 +279,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ return RestrictPrctl();
+
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ if (sysno == __NR_socketpair) {
+ // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
+ static_assert(AF_UNIX == PF_UNIX,
+@@ -366,7 +369,7 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ // Allow creating pipes, but don't allow weird flags to pipe2().
+ // O_NOTIFICATION_PIPE (== O_EXCL) can be used to create
+ // "notification pipes", which are rarely used.
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ if (sysno == __NR_pipe) {
+ return Allow();
+ }
+Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -37,6 +37,7 @@
+
+ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
+ !defined(__arm__) && !defined(__aarch64__) && \
++ !defined(__riscv) && \
+ !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.
+@@ -463,8 +464,10 @@ ResultExpr RestrictPtrace() {
+ #endif
+ return Switch(request)
+ .Cases({
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA,
++#endif
++#if !defined(__aarch64__)
+ PTRACE_GETREGSET,
+ #endif
+ #if defined(__arm__)
+Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -103,7 +103,7 @@ bool SyscallSets::IsUmask(int sysno) {
+ // Both EPERM and ENOENT are valid errno unless otherwise noted in comment.
+ bool SyscallSets::IsFileSystem(int sysno) {
+ switch (sysno) {
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_access: // EPERM not a valid errno.
+ case __NR_chmod:
+ case __NR_chown:
+@@ -136,7 +136,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(__riscv)
+ case __NR_newfstatat: // fstatat(). EPERM not a valid errno.
+ #elif defined(__i386__) || defined(__arm__) || \
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
+@@ -241,7 +241,7 @@ bool SyscallSets::IsAllowedFileSystemAcc
+ case __NR_oldfstat:
+ #endif
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_sync_file_range: // EPERM not a valid errno.
+ #elif defined(__arm__)
+ case __NR_arm_sync_file_range: // EPERM not a valid errno.
+@@ -260,7 +260,7 @@ bool SyscallSets::IsDeniedFileSystemAcce
+ #if defined(__i386__) || defined(__arm__)
+ case __NR_fchown32:
+ #endif
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_getdents: // EPERM not a valid errno.
+ #endif
+ case __NR_getdents64: // EPERM not a valid errno.
+@@ -339,7 +339,7 @@ bool SyscallSets::IsProcessPrivilegeChan
+ bool SyscallSets::IsProcessGroupOrSession(int sysno) {
+ switch (sysno) {
+ case __NR_setpgid:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_getpgrp:
+ #endif
+ case __NR_setsid:
+@@ -373,7 +373,7 @@ bool SyscallSets::IsAllowedSignalHandlin
+ case __NR_rt_sigqueueinfo:
+ case __NR_rt_sigsuspend:
+ case __NR_rt_tgsigqueueinfo:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_signalfd:
+ #endif
+ case __NR_signalfd4:
+@@ -397,12 +397,12 @@ bool SyscallSets::IsAllowedOperationOnFd
+ switch (sysno) {
+ case __NR_close:
+ case __NR_dup:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_dup2:
+ #endif
+ case __NR_dup3:
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_shutdown:
+ #endif
+ return true;
+@@ -441,7 +441,7 @@ bool SyscallSets::IsAllowedProcessStartO
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_fork:
+ #endif
+ #if defined(__i386__) || defined(__x86_64__)
+@@ -452,7 +452,7 @@ bool SyscallSets::IsAllowedProcessStartO
+ #endif
+ case __NR_set_tid_address:
+ case __NR_unshare:
+-#if !defined(__mips__) && !defined(__aarch64__)
++#if !defined(__mips__) && !defined(__aarch64__) && !defined(__riscv)
+ case __NR_vfork:
+ #endif
+ default:
+@@ -477,7 +477,7 @@ bool SyscallSets::IsAllowedFutex(int sys
+
+ bool SyscallSets::IsAllowedEpoll(int sysno) {
+ switch (sysno) {
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_epoll_create:
+ case __NR_epoll_wait:
+ #endif
+@@ -499,7 +499,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(__riscv)
+ case __NR_accept:
+ case __NR_accept4:
+ case __NR_bind:
+@@ -553,7 +553,7 @@ bool SyscallSets::IsAllowedAddressSpaceA
+ case __NR_mincore:
+ case __NR_mlockall:
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_mmap:
+ #endif
+ #if defined(__i386__) || defined(__arm__) || \
+@@ -586,7 +586,7 @@ bool SyscallSets::IsAllowedGeneralIo(int
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
+ case __NR__llseek:
+ #endif
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_poll:
+ #endif
+ case __NR_ppoll:
+@@ -607,7 +607,7 @@ bool SyscallSets::IsAllowedGeneralIo(int
+ case __NR_recv:
+ #endif
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_recvfrom: // Could specify source.
+ case __NR_recvmsg: // Could specify source.
+ #endif
+@@ -622,7 +622,7 @@ bool SyscallSets::IsAllowedGeneralIo(int
+ case __NR_send:
+ #endif
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_sendmsg: // Could specify destination.
+ case __NR_sendto: // Could specify destination.
+ #endif
+@@ -671,7 +671,7 @@ bool SyscallSets::IsSeccomp(int sysno) {
+ bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
+ switch (sysno) {
+ case __NR_sched_yield:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_pause:
+ #endif
+ case __NR_nanosleep:
+@@ -755,7 +755,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(__riscv)
+ case __NR_migrate_pages:
+ #endif
+ case __NR_move_pages:
+@@ -790,7 +790,7 @@ bool SyscallSets::IsGlobalProcessEnviron
+ switch (sysno) {
+ case __NR_acct: // Privileged.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_getrlimit:
+ #endif
+ #if defined(__i386__) || defined(__arm__)
+@@ -825,7 +825,7 @@ bool SyscallSets::IsDebug(int sysno) {
+
+ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
+ switch (sysno) {
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR__sysctl:
+ case __NR_sysfs:
+ #endif
+@@ -843,7 +843,7 @@ bool SyscallSets::IsGlobalSystemStatus(i
+
+ bool SyscallSets::IsEventFd(int sysno) {
+ switch (sysno) {
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_eventfd:
+ #endif
+ case __NR_eventfd2:
+@@ -895,6 +895,7 @@ bool SyscallSets::IsKeyManagement(int sy
+ }
+
+ #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
++ defined(__riscv) || \
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ bool SyscallSets::IsSystemVSemaphores(int sysno) {
+ switch (sysno) {
+@@ -914,7 +915,7 @@ bool SyscallSets::IsSystemVSemaphores(in
+ #endif
+
+ #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
+- defined(__aarch64__) || \
++ defined(__aarch64__) || defined(__riscv) || \
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ // These give a lot of ambient authority and bypass the setuid sandbox.
+ bool SyscallSets::IsSystemVSharedMemory(int sysno) {
+@@ -931,6 +932,7 @@ bool SyscallSets::IsSystemVSharedMemory(
+ #endif
+
+ #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
++ defined(__riscv) || \
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ bool SyscallSets::IsSystemVMessageQueue(int sysno) {
+ switch (sysno) {
+@@ -962,6 +964,7 @@ bool SyscallSets::IsSystemVIpc(int sysno
+
+ bool SyscallSets::IsAnySystemV(int sysno) {
+ #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
++ defined(__riscv) || \
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
+ return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
+ IsSystemVSharedMemory(sysno);
+@@ -999,7 +1002,7 @@ bool SyscallSets::IsAdvancedScheduler(in
+ bool SyscallSets::IsInotify(int sysno) {
+ switch (sysno) {
+ case __NR_inotify_add_watch:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_inotify_init:
+ #endif
+ case __NR_inotify_init1:
+@@ -1134,7 +1137,7 @@ bool SyscallSets::IsMisc(int sysno) {
+ #if defined(__x86_64__)
+ case __NR_tuxcall:
+ #endif
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_vserver:
+ #endif
+ return true;
+@@ -1193,6 +1196,18 @@ bool SyscallSets::IsMipsMisc(int sysno)
+ }
+ #endif // defined(__mips__)
+
++#if defined(__riscv)
++bool SyscallSets::IsRiscvPrivate(int sysno) {
++ switch (sysno) {
++ case __NR_riscv_hwprobe:
++ case __NR_riscv_flush_icache:
++ return true;
++ default:
++ return false;
++ }
++}
++#endif // defined(__riscv)
++
+ bool SyscallSets::IsGoogle3Threading(int sysno) {
+ switch (sysno) {
+ case __NR_getitimer:
+Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
+@@ -52,7 +52,7 @@ class SANDBOX_EXPORT SyscallSets {
+ #endif
+
+ #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ static bool IsNetworkSocketInformation(int sysno);
+ #endif
+
+@@ -79,18 +79,21 @@ class SANDBOX_EXPORT SyscallSets {
+ static bool IsAsyncIo(int sysno);
+ static bool IsKeyManagement(int sysno);
+ #if 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(__riscv)
+ static bool IsSystemVSemaphores(int sysno);
+ #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(__riscv)
+ // These give a lot of ambient authority and bypass the setuid sandbox.
+ static bool IsSystemVSharedMemory(int sysno);
+ #endif
+
+ #if 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(__riscv)
+ static bool IsSystemVMessageQueue(int sysno);
+ #endif
+
+@@ -117,6 +120,9 @@ class SANDBOX_EXPORT SyscallSets {
+ static bool IsMipsPrivate(int sysno);
+ static bool IsMipsMisc(int sysno);
+ #endif // defined(__mips__)
++#if defined(__riscv)
++ static bool IsRiscvPrivate(int sysno);
++#endif
+ static bool IsGoogle3Threading(int sysno);
+ };
+
+Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf/syscall.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf/syscall.cc
++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf/syscall.cc
+@@ -18,7 +18,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_RISCV_FAMILY)
+ // Number that's not currently used by any Linux kernel ABIs.
+ const int kInvalidSyscallNumber = 0x351d3;
+ #else
+@@ -308,6 +308,28 @@ asm(// We need to be able to tell the ke
+ "2:ret\n"
+ ".cfi_endproc\n"
+ ".size SyscallAsm, .-SyscallAsm\n"
++#elif defined(__riscv)
++ ".text\n"
++ ".align 2\n"
++ ".type SyscallAsm, %function\n"
++ "SyscallAsm:\n"
++ ".cfi_startproc\n"
++ "bgez a0,1f\n"
++ "lla a0,2f\n"
++ "j 2f\n"
++ "1:mv a7, a0\n"
++ "ld a0, (a1)\n"
++ "ld a2, 16(a1)\n"
++ "ld a3, 24(a1)\n"
++ "ld a4, 32(a1)\n"
++ "ld a5, 40(a1)\n"
++ "ld a6, 48(a1)\n"
++ "ld a1, 8(a1)\n"
++ // Enter the kernel
++ "scall\n"
++ "2:ret\n"
++ ".cfi_endproc\n"
++ ".size SyscallAsm, .-SyscallAsm\n"
+ #endif
+ ); // asm
+
+@@ -319,6 +341,10 @@ intptr_t SyscallAsm(intptr_t nr, const i
+ extern "C" {
+ intptr_t SyscallAsm(intptr_t nr, const intptr_t args[8]);
+ }
++#elif defined(__riscv)
++extern "C" {
++intptr_t SyscallAsm(intptr_t nr, const intptr_t args[7]);
++}
+ #endif
+
+ } // namespace
+@@ -351,6 +377,10 @@ intptr_t Syscall::Call(int nr,
+ // where that makes sense.
+ #if defined(__mips__)
+ const intptr_t args[8] = {p0, p1, p2, p3, p4, p5, p6, p7};
++#elif defined(__riscv)
++ DCHECK_EQ(p7, 0) << " Support for syscalls with more than seven arguments "
++ "not added for this architecture";
++ const intptr_t args[7] = {p0, p1, p2, p3, p4, p5, p6};
+ #else
+ DCHECK_EQ(p6, 0) << " Support for syscalls with more than six arguments not "
+ "added for this architecture";
+@@ -425,6 +455,8 @@ intptr_t Syscall::Call(int nr,
+ ret = inout;
+ }
+
++#elif defined(__riscv)
++ intptr_t ret = SyscallAsm(nr, args);
+ #else
+ #error "Unimplemented architecture"
+ #endif
+Index: chromium-122.0.6261.128/sandbox/linux/services/credentials.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/services/credentials.cc
++++ chromium-122.0.6261.128/sandbox/linux/services/credentials.cc
+@@ -80,7 +80,7 @@ bool ChrootToSafeEmptyDir() {
+ pid_t pid = -1;
+ alignas(16) char stack_buf[PTHREAD_STACK_MIN];
+ #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
+- defined(ARCH_CPU_MIPS_FAMILY)
++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY)
+ // The stack grows downward.
+ void* stack = stack_buf + sizeof(stack_buf);
+ #else
+Index: chromium-122.0.6261.128/sandbox/linux/services/syscall_wrappers.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/services/syscall_wrappers.cc
++++ chromium-122.0.6261.128/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_RISCV_FAMILY)
+ // CONFIG_CLONE_BACKWARDS defined.
+ return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid);
+ #endif
+Index: chromium-122.0.6261.128/sandbox/linux/syscall_broker/broker_process.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/syscall_broker/broker_process.cc
++++ chromium-122.0.6261.128/sandbox/linux/syscall_broker/broker_process.cc
+@@ -122,44 +122,46 @@ bool BrokerProcess::IsSyscallBrokerable(
+ // and are default disabled in Android. So, we should refuse to broker them
+ // to be consistent with the platform's restrictions.
+ switch (sysno) {
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_access:
+ #endif
+ case __NR_faccessat:
+ case __NR_faccessat2:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_ACCESS);
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_mkdir:
+ #endif
+ case __NR_mkdirat:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_MKDIR);
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_open:
+ #endif
+ case __NR_openat:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_OPEN);
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_readlink:
+ #endif
+ case __NR_readlinkat:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_READLINK);
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_rename:
+ #endif
++#ifdef __NR_renameat
+ case __NR_renameat:
++#endif
+ case __NR_renameat2:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_RENAME);
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_rmdir:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_RMDIR);
+ #endif
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_stat:
+ case __NR_lstat:
+ #endif
+@@ -169,7 +171,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(__riscv)
+ case __NR_newfstatat:
+ #endif
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT);
+@@ -184,7 +186,7 @@ bool BrokerProcess::IsSyscallBrokerable(
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT);
+ #endif
+
+-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+ case __NR_unlink:
+ return !fast_check || policy_->allowed_command_set.test(COMMAND_UNLINK);
+ #endif
+Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_seccomp.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_seccomp.h
++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_seccomp.h
+@@ -39,6 +39,10 @@
+ #define EM_AARCH64 183
+ #endif
+
++#ifndef EM_RISCV
++#define EM_RISCV 243
++#endif
++
+ #ifndef __AUDIT_ARCH_64BIT
+ #define __AUDIT_ARCH_64BIT 0x80000000
+ #endif
+@@ -71,6 +75,10 @@
+ #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
+ #endif
+
++#ifndef AUDIT_ARCH_RISCV64
++#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
++#endif
++
+ // For prctl.h
+ #ifndef PR_SET_SECCOMP
+ #define PR_SET_SECCOMP 22
+Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_signal.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_signal.h
++++ chromium-122.0.6261.128/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(__riscv)
+
+ #define LINUX_SIGHUP 1
+ #define LINUX_SIGINT 2
+Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_stat.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_stat.h
++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_stat.h
+@@ -150,7 +150,7 @@ struct kernel_stat {
+ int st_blocks;
+ int st_pad4[14];
+ };
+-#elif defined(__aarch64__)
++#elif defined(__aarch64__) || defined(__riscv)
+ struct kernel_stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_syscalls.h
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_syscalls.h
++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_syscalls.h
+@@ -35,5 +35,9 @@
+ #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
+ #endif
+
++#if defined(__riscv) && __riscv_xlen == 64
++#include "sandbox/linux/system_headers/riscv64_linux_syscalls.h"
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
+
+Index: chromium-122.0.6261.128/sandbox/linux/system_headers/riscv64_linux_syscalls.h
+===================================================================
+--- /dev/null
++++ chromium-122.0.6261.128/sandbox/linux/system_headers/riscv64_linux_syscalls.h
+@@ -0,0 +1,1226 @@
++// Copyright 2014 The Chromium Authors
++// 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_RISCV64_LINUX_SYSCALLS_H_
++#define SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_
++
++#include <asm-generic/unistd.h>
++
++#if !defined(__NR_io_setup)
++#define __NR_io_setup 0
++#endif
++
++#if !defined(__NR_io_destroy)
++#define __NR_io_destroy 1
++#endif
++
++#if !defined(__NR_io_submit)
++#define __NR_io_submit 2
++#endif
++
++#if !defined(__NR_io_cancel)
++#define __NR_io_cancel 3
++#endif
++
++#if !defined(__NR_io_getevents)
++#define __NR_io_getevents 4
++#endif
++
++#if !defined(__NR_setxattr)
++#define __NR_setxattr 5
++#endif
++
++#if !defined(__NR_lsetxattr)
++#define __NR_lsetxattr 6
++#endif
++
++#if !defined(__NR_fsetxattr)
++#define __NR_fsetxattr 7
++#endif
++
++#if !defined(__NR_getxattr)
++#define __NR_getxattr 8
++#endif
++
++#if !defined(__NR_lgetxattr)
++#define __NR_lgetxattr 9
++#endif
++
++#if !defined(__NR_fgetxattr)
++#define __NR_fgetxattr 10
++#endif
++
++#if !defined(__NR_listxattr)
++#define __NR_listxattr 11
++#endif
++
++#if !defined(__NR_llistxattr)
++#define __NR_llistxattr 12
++#endif
++
++#if !defined(__NR_flistxattr)
++#define __NR_flistxattr 13
++#endif
++
++#if !defined(__NR_removexattr)
++#define __NR_removexattr 14
++#endif
++
++#if !defined(__NR_lremovexattr)
++#define __NR_lremovexattr 15
++#endif
++
++#if !defined(__NR_fremovexattr)
++#define __NR_fremovexattr 16
++#endif
++
++#if !defined(__NR_getcwd)
++#define __NR_getcwd 17
++#endif
++
++#if !defined(__NR_lookup_dcookie)
++#define __NR_lookup_dcookie 18
++#endif
++
++#if !defined(__NR_eventfd2)
++#define __NR_eventfd2 19
++#endif
++
++#if !defined(__NR_epoll_create1)
++#define __NR_epoll_create1 20
++#endif
++
++#if !defined(__NR_epoll_ctl)
++#define __NR_epoll_ctl 21
++#endif
++
++#if !defined(__NR_epoll_pwait)
++#define __NR_epoll_pwait 22
++#endif
++
++#if !defined(__NR_dup)
++#define __NR_dup 23
++#endif
++
++#if !defined(__NR_dup3)
++#define __NR_dup3 24
++#endif
++
++#if !defined(__NR_fcntl)
++#define __NR_fcntl 25
++#endif
++
++#if !defined(__NR_inotify_init1)
++#define __NR_inotify_init1 26
++#endif
++
++#if !defined(__NR_inotify_add_watch)
++#define __NR_inotify_add_watch 27
++#endif
++
++#if !defined(__NR_inotify_rm_watch)
++#define __NR_inotify_rm_watch 28
++#endif
++
++#if !defined(__NR_ioctl)
++#define __NR_ioctl 29
++#endif
++
++#if !defined(__NR_ioprio_set)
++#define __NR_ioprio_set 30
++#endif
++
++#if !defined(__NR_ioprio_get)
++#define __NR_ioprio_get 31
++#endif
++
++#if !defined(__NR_flock)
++#define __NR_flock 32
++#endif
++
++#if !defined(__NR_mknodat)
++#define __NR_mknodat 33
++#endif
++
++#if !defined(__NR_mkdirat)
++#define __NR_mkdirat 34
++#endif
++
++#if !defined(__NR_unlinkat)
++#define __NR_unlinkat 35
++#endif
++
++#if !defined(__NR_symlinkat)
++#define __NR_symlinkat 36
++#endif
++
++#if !defined(__NR_linkat)
++#define __NR_linkat 37
++#endif
++
++#if !defined(__NR_renameat)
++#define __NR_renameat 38
++#endif
++
++#if !defined(__NR_umount2)
++#define __NR_umount2 39
++#endif
++
++#if !defined(__NR_mount)
++#define __NR_mount 40
++#endif
++
++#if !defined(__NR_pivot_root)
++#define __NR_pivot_root 41
++#endif
++
++#if !defined(__NR_nfsservctl)
++#define __NR_nfsservctl 42
++#endif
++
++#if !defined(__NR_statfs)
++#define __NR_statfs 43
++#endif
++
++#if !defined(__NR_fstatfs)
++#define __NR_fstatfs 44
++#endif
++
++#if !defined(__NR_truncate)
++#define __NR_truncate 45
++#endif
++
++#if !defined(__NR_ftruncate)
++#define __NR_ftruncate 46
++#endif
++
++#if !defined(__NR_fallocate)
++#define __NR_fallocate 47
++#endif
++
++#if !defined(__NR_faccessat)
++#define __NR_faccessat 48
++#endif
++
++#if !defined(__NR_chdir)
++#define __NR_chdir 49
++#endif
++
++#if !defined(__NR_fchdir)
++#define __NR_fchdir 50
++#endif
++
++#if !defined(__NR_chroot)
++#define __NR_chroot 51
++#endif
++
++#if !defined(__NR_fchmod)
++#define __NR_fchmod 52
++#endif
++
++#if !defined(__NR_fchmodat)
++#define __NR_fchmodat 53
++#endif
++
++#if !defined(__NR_fchownat)
++#define __NR_fchownat 54
++#endif
++
++#if !defined(__NR_fchown)
++#define __NR_fchown 55
++#endif
++
++#if !defined(__NR_openat)
++#define __NR_openat 56
++#endif
++
++#if !defined(__NR_close)
++#define __NR_close 57
++#endif
++
++#if !defined(__NR_vhangup)
++#define __NR_vhangup 58
++#endif
++
++#if !defined(__NR_pipe2)
++#define __NR_pipe2 59
++#endif
++
++#if !defined(__NR_quotactl)
++#define __NR_quotactl 60
++#endif
++
++#if !defined(__NR_getdents64)
++#define __NR_getdents64 61
++#endif
++
++#if !defined(__NR_lseek)
++#define __NR_lseek 62
++#endif
++
++#if !defined(__NR_read)
++#define __NR_read 63
++#endif
++
++#if !defined(__NR_write)
++#define __NR_write 64
++#endif
++
++#if !defined(__NR_readv)
++#define __NR_readv 65
++#endif
++
++#if !defined(__NR_writev)
++#define __NR_writev 66
++#endif
++
++#if !defined(__NR_pread64)
++#define __NR_pread64 67
++#endif
++
++#if !defined(__NR_pwrite64)
++#define __NR_pwrite64 68
++#endif
++
++#if !defined(__NR_preadv)
++#define __NR_preadv 69
++#endif
++
++#if !defined(__NR_pwritev)
++#define __NR_pwritev 70
++#endif
++
++#if !defined(__NR_sendfile)
++#define __NR_sendfile 71
++#endif
++
++#if !defined(__NR_pselect6)
++#define __NR_pselect6 72
++#endif
++
++#if !defined(__NR_ppoll)
++#define __NR_ppoll 73
++#endif
++
++#if !defined(__NR_signalfd4)
++#define __NR_signalfd4 74
++#endif
++
++#if !defined(__NR_vmsplice)
++#define __NR_vmsplice 75
++#endif
++
++#if !defined(__NR_splice)
++#define __NR_splice 76
++#endif
++
++#if !defined(__NR_tee)
++#define __NR_tee 77
++#endif
++
++#if !defined(__NR_readlinkat)
++#define __NR_readlinkat 78
++#endif
++
++#if !defined(__NR_newfstatat)
++#define __NR_newfstatat 79
++#endif
++
++#if !defined(__NR_fstat)
++#define __NR_fstat 80
++#endif
++
++#if !defined(__NR_sync)
++#define __NR_sync 81
++#endif
++
++#if !defined(__NR_fsync)
++#define __NR_fsync 82
++#endif
++
++#if !defined(__NR_fdatasync)
++#define __NR_fdatasync 83
++#endif
++
++#if !defined(__NR_sync_file_range)
++#define __NR_sync_file_range 84
++#endif
++
++#if !defined(__NR_timerfd_create)
++#define __NR_timerfd_create 85
++#endif
++
++#if !defined(__NR_timerfd_settime)
++#define __NR_timerfd_settime 86
++#endif
++
++#if !defined(__NR_timerfd_gettime)
++#define __NR_timerfd_gettime 87
++#endif
++
++#if !defined(__NR_utimensat)
++#define __NR_utimensat 88
++#endif
++
++#if !defined(__NR_acct)
++#define __NR_acct 89
++#endif
++
++#if !defined(__NR_capget)
++#define __NR_capget 90
++#endif
++
++#if !defined(__NR_capset)
++#define __NR_capset 91
++#endif
++
++#if !defined(__NR_personality)
++#define __NR_personality 92
++#endif
++
++#if !defined(__NR_exit)
++#define __NR_exit 93
++#endif
++
++#if !defined(__NR_exit_group)
++#define __NR_exit_group 94
++#endif
++
++#if !defined(__NR_waitid)
++#define __NR_waitid 95
++#endif
++
++#if !defined(__NR_set_tid_address)
++#define __NR_set_tid_address 96
++#endif
++
++#if !defined(__NR_unshare)
++#define __NR_unshare 97
++#endif
++
++#if !defined(__NR_futex)
++#define __NR_futex 98
++#endif
++
++#if !defined(__NR_set_robust_list)
++#define __NR_set_robust_list 99
++#endif
++
++#if !defined(__NR_get_robust_list)
++#define __NR_get_robust_list 100
++#endif
++
++#if !defined(__NR_nanosleep)
++#define __NR_nanosleep 101
++#endif
++
++#if !defined(__NR_getitimer)
++#define __NR_getitimer 102
++#endif
++
++#if !defined(__NR_setitimer)
++#define __NR_setitimer 103
++#endif
++
++#if !defined(__NR_kexec_load)
++#define __NR_kexec_load 104
++#endif
++
++#if !defined(__NR_init_module)
++#define __NR_init_module 105
++#endif
++
++#if !defined(__NR_delete_module)
++#define __NR_delete_module 106
++#endif
++
++#if !defined(__NR_timer_create)
++#define __NR_timer_create 107
++#endif
++
++#if !defined(__NR_timer_gettime)
++#define __NR_timer_gettime 108
++#endif
++
++#if !defined(__NR_timer_getoverrun)
++#define __NR_timer_getoverrun 109
++#endif
++
++#if !defined(__NR_timer_settime)
++#define __NR_timer_settime 110
++#endif
++
++#if !defined(__NR_timer_delete)
++#define __NR_timer_delete 111
++#endif
++
++#if !defined(__NR_clock_settime)
++#define __NR_clock_settime 112
++#endif
++
++#if !defined(__NR_clock_gettime)
++#define __NR_clock_gettime 113
++#endif
++
++#if !defined(__NR_clock_getres)
++#define __NR_clock_getres 114
++#endif
++
++#if !defined(__NR_clock_nanosleep)
++#define __NR_clock_nanosleep 115
++#endif
++
++#if !defined(__NR_syslog)
++#define __NR_syslog 116
++#endif
++
++#if !defined(__NR_ptrace)
++#define __NR_ptrace 117
++#endif
++
++#if !defined(__NR_sched_setparam)
++#define __NR_sched_setparam 118
++#endif
++
++#if !defined(__NR_sched_setscheduler)
++#define __NR_sched_setscheduler 119
++#endif
++
++#if !defined(__NR_sched_getscheduler)
++#define __NR_sched_getscheduler 120
++#endif
++
++#if !defined(__NR_sched_getparam)
++#define __NR_sched_getparam 121
++#endif
++
++#if !defined(__NR_sched_setaffinity)
++#define __NR_sched_setaffinity 122
++#endif
++
++#if !defined(__NR_sched_getaffinity)
++#define __NR_sched_getaffinity 123
++#endif
++
++#if !defined(__NR_sched_yield)
++#define __NR_sched_yield 124
++#endif
++
++#if !defined(__NR_sched_get_priority_max)
++#define __NR_sched_get_priority_max 125
++#endif
++
++#if !defined(__NR_sched_get_priority_min)
++#define __NR_sched_get_priority_min 126
++#endif
++
++#if !defined(__NR_sched_rr_get_interval)
++#define __NR_sched_rr_get_interval 127
++#endif
++
++#if !defined(__NR_restart_syscall)
++#define __NR_restart_syscall 128
++#endif
++
++#if !defined(__NR_kill)
++#define __NR_kill 129
++#endif
++
++#if !defined(__NR_tkill)
++#define __NR_tkill 130
++#endif
++
++#if !defined(__NR_tgkill)
++#define __NR_tgkill 131
++#endif
++
++#if !defined(__NR_sigaltstack)
++#define __NR_sigaltstack 132
++#endif
++
++#if !defined(__NR_rt_sigsuspend)
++#define __NR_rt_sigsuspend 133
++#endif
++
++#if !defined(__NR_rt_sigaction)
++#define __NR_rt_sigaction 134
++#endif
++
++#if !defined(__NR_rt_sigprocmask)
++#define __NR_rt_sigprocmask 135
++#endif
++
++#if !defined(__NR_rt_sigpending)
++#define __NR_rt_sigpending 136
++#endif
++
++#if !defined(__NR_rt_sigtimedwait)
++#define __NR_rt_sigtimedwait 137
++#endif
++
++#if !defined(__NR_rt_sigqueueinfo)
++#define __NR_rt_sigqueueinfo 138
++#endif
++
++#if !defined(__NR_rt_sigreturn)
++#define __NR_rt_sigreturn 139
++#endif
++
++#if !defined(__NR_setpriority)
++#define __NR_setpriority 140
++#endif
++
++#if !defined(__NR_getpriority)
++#define __NR_getpriority 141
++#endif
++
++#if !defined(__NR_reboot)
++#define __NR_reboot 142
++#endif
++
++#if !defined(__NR_setregid)
++#define __NR_setregid 143
++#endif
++
++#if !defined(__NR_setgid)
++#define __NR_setgid 144
++#endif
++
++#if !defined(__NR_setreuid)
++#define __NR_setreuid 145
++#endif
++
++#if !defined(__NR_setuid)
++#define __NR_setuid 146
++#endif
++
++#if !defined(__NR_setresuid)
++#define __NR_setresuid 147
++#endif
++
++#if !defined(__NR_getresuid)
++#define __NR_getresuid 148
++#endif
++
++#if !defined(__NR_setresgid)
++#define __NR_setresgid 149
++#endif
++
++#if !defined(__NR_getresgid)
++#define __NR_getresgid 150
++#endif
++
++#if !defined(__NR_setfsuid)
++#define __NR_setfsuid 151
++#endif
++
++#if !defined(__NR_setfsgid)
++#define __NR_setfsgid 152
++#endif
++
++#if !defined(__NR_times)
++#define __NR_times 153
++#endif
++
++#if !defined(__NR_setpgid)
++#define __NR_setpgid 154
++#endif
++
++#if !defined(__NR_getpgid)
++#define __NR_getpgid 155
++#endif
++
++#if !defined(__NR_getsid)
++#define __NR_getsid 156
++#endif
++
++#if !defined(__NR_setsid)
++#define __NR_setsid 157
++#endif
++
++#if !defined(__NR_getgroups)
++#define __NR_getgroups 158
++#endif
++
++#if !defined(__NR_setgroups)
++#define __NR_setgroups 159
++#endif
++
++#if !defined(__NR_uname)
++#define __NR_uname 160
++#endif
++
++#if !defined(__NR_sethostname)
++#define __NR_sethostname 161
++#endif
++
++#if !defined(__NR_setdomainname)
++#define __NR_setdomainname 162
++#endif
++
++#if !defined(__NR_getrlimit)
++#define __NR_getrlimit 163
++#endif
++
++#if !defined(__NR_setrlimit)
++#define __NR_setrlimit 164
++#endif
++
++#if !defined(__NR_getrusage)
++#define __NR_getrusage 165
++#endif
++
++#if !defined(__NR_umask)
++#define __NR_umask 166
++#endif
++
++#if !defined(__NR_prctl)
++#define __NR_prctl 167
++#endif
++
++#if !defined(__NR_getcpu)
++#define __NR_getcpu 168
++#endif
++
++#if !defined(__NR_gettimeofday)
++#define __NR_gettimeofday 169
++#endif
++
++#if !defined(__NR_settimeofday)
++#define __NR_settimeofday 170
++#endif
++
++#if !defined(__NR_adjtimex)
++#define __NR_adjtimex 171
++#endif
++
++#if !defined(__NR_getpid)
++#define __NR_getpid 172
++#endif
++
++#if !defined(__NR_getppid)
++#define __NR_getppid 173
++#endif
++
++#if !defined(__NR_getuid)
++#define __NR_getuid 174
++#endif
++
++#if !defined(__NR_geteuid)
++#define __NR_geteuid 175
++#endif
++
++#if !defined(__NR_getgid)
++#define __NR_getgid 176
++#endif
++
++#if !defined(__NR_getegid)
++#define __NR_getegid 177
++#endif
++
++#if !defined(__NR_gettid)
++#define __NR_gettid 178
++#endif
++
++#if !defined(__NR_sysinfo)
++#define __NR_sysinfo 179
++#endif
++
++#if !defined(__NR_mq_open)
++#define __NR_mq_open 180
++#endif
++
++#if !defined(__NR_mq_unlink)
++#define __NR_mq_unlink 181
++#endif
++
++#if !defined(__NR_mq_timedsend)
++#define __NR_mq_timedsend 182
++#endif
++
++#if !defined(__NR_mq_timedreceive)
++#define __NR_mq_timedreceive 183
++#endif
++
++#if !defined(__NR_mq_notify)
++#define __NR_mq_notify 184
++#endif
++
++#if !defined(__NR_mq_getsetattr)
++#define __NR_mq_getsetattr 185
++#endif
++
++#if !defined(__NR_msgget)
++#define __NR_msgget 186
++#endif
++
++#if !defined(__NR_msgctl)
++#define __NR_msgctl 187
++#endif
++
++#if !defined(__NR_msgrcv)
++#define __NR_msgrcv 188
++#endif
++
++#if !defined(__NR_msgsnd)
++#define __NR_msgsnd 189
++#endif
++
++#if !defined(__NR_semget)
++#define __NR_semget 190
++#endif
++
++#if !defined(__NR_semctl)
++#define __NR_semctl 191
++#endif
++
++#if !defined(__NR_semtimedop)
++#define __NR_semtimedop 192
++#endif
++
++#if !defined(__NR_semop)
++#define __NR_semop 193
++#endif
++
++#if !defined(__NR_shmget)
++#define __NR_shmget 194
++#endif
++
++#if !defined(__NR_shmctl)
++#define __NR_shmctl 195
++#endif
++
++#if !defined(__NR_shmat)
++#define __NR_shmat 196
++#endif
++
++#if !defined(__NR_shmdt)
++#define __NR_shmdt 197
++#endif
++
++#if !defined(__NR_socket)
++#define __NR_socket 198
++#endif
++
++#if !defined(__NR_socketpair)
++#define __NR_socketpair 199
++#endif
++
++#if !defined(__NR_bind)
++#define __NR_bind 200
++#endif
++
++#if !defined(__NR_listen)
++#define __NR_listen 201
++#endif
++
++#if !defined(__NR_accept)
++#define __NR_accept 202
++#endif
++
++#if !defined(__NR_connect)
++#define __NR_connect 203
++#endif
++
++#if !defined(__NR_getsockname)
++#define __NR_getsockname 204
++#endif
++
++#if !defined(__NR_getpeername)
++#define __NR_getpeername 205
++#endif
++
++#if !defined(__NR_sendto)
++#define __NR_sendto 206
++#endif
++
++#if !defined(__NR_recvfrom)
++#define __NR_recvfrom 207
++#endif
++
++#if !defined(__NR_setsockopt)
++#define __NR_setsockopt 208
++#endif
++
++#if !defined(__NR_getsockopt)
++#define __NR_getsockopt 209
++#endif
++
++#if !defined(__NR_shutdown)
++#define __NR_shutdown 210
++#endif
++
++#if !defined(__NR_sendmsg)
++#define __NR_sendmsg 211
++#endif
++
++#if !defined(__NR_recvmsg)
++#define __NR_recvmsg 212
++#endif
++
++#if !defined(__NR_readahead)
++#define __NR_readahead 213
++#endif
++
++#if !defined(__NR_brk)
++#define __NR_brk 214
++#endif
++
++#if !defined(__NR_munmap)
++#define __NR_munmap 215
++#endif
++
++#if !defined(__NR_mremap)
++#define __NR_mremap 216
++#endif
++
++#if !defined(__NR_add_key)
++#define __NR_add_key 217
++#endif
++
++#if !defined(__NR_request_key)
++#define __NR_request_key 218
++#endif
++
++#if !defined(__NR_keyctl)
++#define __NR_keyctl 219
++#endif
++
++#if !defined(__NR_clone)
++#define __NR_clone 220
++#endif
++
++#if !defined(__NR_execve)
++#define __NR_execve 221
++#endif
++
++#if !defined(__NR_mmap)
++#define __NR_mmap 222
++#endif
++
++#if !defined(__NR_fadvise64)
++#define __NR_fadvise64 223
++#endif
++
++#if !defined(__NR_swapon)
++#define __NR_swapon 224
++#endif
++
++#if !defined(__NR_swapoff)
++#define __NR_swapoff 225
++#endif
++
++#if !defined(__NR_mprotect)
++#define __NR_mprotect 226
++#endif
++
++#if !defined(__NR_msync)
++#define __NR_msync 227
++#endif
++
++#if !defined(__NR_mlock)
++#define __NR_mlock 228
++#endif
++
++#if !defined(__NR_munlock)
++#define __NR_munlock 229
++#endif
++
++#if !defined(__NR_mlockall)
++#define __NR_mlockall 230
++#endif
++
++#if !defined(__NR_munlockall)
++#define __NR_munlockall 231
++#endif
++
++#if !defined(__NR_mincore)
++#define __NR_mincore 232
++#endif
++
++#if !defined(__NR_madvise)
++#define __NR_madvise 233
++#endif
++
++#if !defined(__NR_remap_file_pages)
++#define __NR_remap_file_pages 234
++#endif
++
++#if !defined(__NR_mbind)
++#define __NR_mbind 235
++#endif
++
++#if !defined(__NR_get_mempolicy)
++#define __NR_get_mempolicy 236
++#endif
++
++#if !defined(__NR_set_mempolicy)
++#define __NR_set_mempolicy 237
++#endif
++
++#if !defined(__NR_migrate_pages)
++#define __NR_migrate_pages 238
++#endif
++
++#if !defined(__NR_move_pages)
++#define __NR_move_pages 239
++#endif
++
++#if !defined(__NR_rt_tgsigqueueinfo)
++#define __NR_rt_tgsigqueueinfo 240
++#endif
++
++#if !defined(__NR_perf_event_open)
++#define __NR_perf_event_open 241
++#endif
++
++#if !defined(__NR_accept4)
++#define __NR_accept4 242
++#endif
++
++#if !defined(__NR_recvmmsg)
++#define __NR_recvmmsg 243
++#endif
++
++#if !defined(__NR_riscv_hwprobe)
++#define __NR_riscv_hwprobe 258
++#endif
++
++#if !defined(__NR_riscv_flush_icache)
++#define __NR_riscv_flush_icache 259
++#endif
++
++#if !defined(__NR_wait4)
++#define __NR_wait4 260
++#endif
++
++#if !defined(__NR_prlimit64)
++#define __NR_prlimit64 261
++#endif
++
++#if !defined(__NR_fanotify_init)
++#define __NR_fanotify_init 262
++#endif
++
++#if !defined(__NR_fanotify_mark)
++#define __NR_fanotify_mark 263
++#endif
++
++#if !defined(__NR_name_to_handle_at)
++#define __NR_name_to_handle_at 264
++#endif
++
++#if !defined(__NR_open_by_handle_at)
++#define __NR_open_by_handle_at 265
++#endif
++
++#if !defined(__NR_clock_adjtime)
++#define __NR_clock_adjtime 266
++#endif
++
++#if !defined(__NR_syncfs)
++#define __NR_syncfs 267
++#endif
++
++#if !defined(__NR_setns)
++#define __NR_setns 268
++#endif
++
++#if !defined(__NR_sendmmsg)
++#define __NR_sendmmsg 269
++#endif
++
++#if !defined(__NR_process_vm_readv)
++#define __NR_process_vm_readv 270
++#endif
++
++#if !defined(__NR_process_vm_writev)
++#define __NR_process_vm_writev 271
++#endif
++
++#if !defined(__NR_kcmp)
++#define __NR_kcmp 272
++#endif
++
++#if !defined(__NR_finit_module)
++#define __NR_finit_module 273
++#endif
++
++#if !defined(__NR_sched_setattr)
++#define __NR_sched_setattr 274
++#endif
++
++#if !defined(__NR_sched_getattr)
++#define __NR_sched_getattr 275
++#endif
++
++#if !defined(__NR_renameat2)
++#define __NR_renameat2 276
++#endif
++
++#if !defined(__NR_seccomp)
++#define __NR_seccomp 277
++#endif
++
++#if !defined(__NR_getrandom)
++#define __NR_getrandom 278
++#endif
++
++#if !defined(__NR_memfd_create)
++#define __NR_memfd_create 279
++#endif
++
++#if !defined(__NR_bpf)
++#define __NR_bpf 280
++#endif
++
++#if !defined(__NR_execveat)
++#define __NR_execveat 281
++#endif
++
++#if !defined(__NR_userfaultfd)
++#define __NR_userfaultfd 282
++#endif
++
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
++#if !defined(__NR_mlock2)
++#define __NR_mlock2 284
++#endif
++
++#if !defined(__NR_copy_file_range)
++#define __NR_copy_file_range 285
++#endif
++
++#if !defined(__NR_preadv2)
++#define __NR_preadv2 286
++#endif
++
++#if !defined(__NR_pwritev2)
++#define __NR_pwritev2 287
++#endif
++
++#if !defined(__NR_pkey_mprotect)
++#define __NR_pkey_mprotect 288
++#endif
++
++#if !defined(__NR_pkey_alloc)
++#define __NR_pkey_alloc 289
++#endif
++
++#if !defined(__NR_pkey_free)
++#define __NR_pkey_free 290
++#endif
++
++#if !defined(__NR_statx)
++#define __NR_statx 291
++#endif
++
++#if !defined(__NR_io_pgetevents)
++#define __NR_io_pgetevents 292
++#endif
++
++#if !defined(__NR_rseq)
++#define __NR_rseq 293
++#endif
++
++#if !defined(__NR_kexec_file_load)
++#define __NR_kexec_file_load 294
++#endif
++
++#if !defined(__NR_pidfd_send_signal)
++#define __NR_pidfd_send_signal 424
++#endif
++
++#if !defined(__NR_io_uring_setup)
++#define __NR_io_uring_setup 425
++#endif
++
++#if !defined(__NR_io_uring_enter)
++#define __NR_io_uring_enter 426
++#endif
++
++#if !defined(__NR_io_uring_register)
++#define __NR_io_uring_register 427
++#endif
++
++#if !defined(__NR_open_tree)
++#define __NR_open_tree 428
++#endif
++
++#if !defined(__NR_move_mount)
++#define __NR_move_mount 429
++#endif
++
++#if !defined(__NR_fsopen)
++#define __NR_fsopen 430
++#endif
++
++#if !defined(__NR_fsconfig)
++#define __NR_fsconfig 431
++#endif
++
++#if !defined(__NR_fsmount)
++#define __NR_fsmount 432
++#endif
++
++#if !defined(__NR_fspick)
++#define __NR_fspick 433
++#endif
++
++#if !defined(__NR_pidfd_open)
++#define __NR_pidfd_open 434
++#endif
++
++#if !defined(__NR_clone3)
++#define __NR_clone3 435
++#endif
++
++#if !defined(__NR_close_range)
++#define __NR_close_range 436
++#endif
++
++#if !defined(__NR_openat2)
++#define __NR_openat2 437
++#endif
++
++#if !defined(__NR_pidfd_getfd)
++#define __NR_pidfd_getfd 438
++#endif
++
++#if !defined(__NR_faccessat2)
++#define __NR_faccessat2 439
++#endif
++
++#if !defined(__NR_process_madvise)
++#define __NR_process_madvise 440
++#endif
++
++#if !defined(__NR_epoll_pwait2)
++#define __NR_epoll_pwait2 441
++#endif
++
++#if !defined(__NR_mount_setattr)
++#define __NR_mount_setattr 442
++#endif
++
++#if !defined(__NR_quotactl_path)
++#define __NR_quotactl_path 443
++#endif
++
++#if !defined(__NR_landlock_create_ruleset)
++#define __NR_landlock_create_ruleset 444
++#endif
++
++#if !defined(__NR_landlock_add_rule)
++#define __NR_landlock_add_rule 445
++#endif
++
++#if !defined(__NR_landlock_restrict_self)
++#define __NR_landlock_restrict_self 446
++#endif
++
++#endif // SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_cdm_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_cdm_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_cdm_policy_linux.cc
+@@ -33,7 +33,7 @@ ResultExpr CdmProcessPolicy::EvaluateSys
+ case __NR_ftruncate:
+ case __NR_fallocate:
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_getrlimit:
+ #endif
+ #if defined(__i386__) || defined(__arm__)
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
+@@ -38,7 +38,7 @@ ResultExpr CrosAmdGpuProcessPolicy::Eval
+ case __NR_sched_setscheduler:
+ case __NR_sysinfo:
+ case __NR_uname:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_readlink:
+ case __NR_stat:
+ #endif
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_gpu_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_gpu_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_gpu_policy_linux.cc
+@@ -73,7 +73,7 @@ ResultExpr GpuProcessPolicy::EvaluateSys
+ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
+ case __NR_ftruncate64:
+ #endif
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_getdents:
+ #endif
+ case __NR_getdents64:
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_network_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_network_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_network_policy_linux.cc
+@@ -255,7 +255,7 @@ ResultExpr NetworkProcessPolicy::Evaluat
+ case __NR_fdatasync:
+ case __NR_fsync:
+ case __NR_mremap:
+-#if !defined(__aarch64__)
++#if !defined(__aarch64__) && !defined(__riscv)
+ case __NR_getdents:
+ #endif
+ case __NR_getdents64:
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
+@@ -33,7 +33,7 @@ ResultExpr PrintCompositorProcessPolicy:
+ case __NR_fdatasync:
+ case __NR_fsync:
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined (__riscv)
+ case __NR_getrlimit:
+ #endif
+ #if defined(__i386__) || defined(__arm__)
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_renderer_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_renderer_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_renderer_policy_linux.cc
+@@ -82,7 +82,7 @@ ResultExpr RendererProcessPolicy::Evalua
+ case __NR_ftruncate64:
+ #endif
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_getrlimit:
+ case __NR_setrlimit:
+ // We allow setrlimit to dynamically adjust the address space limit as
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_service_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_service_policy_linux.cc
++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_service_policy_linux.cc
+@@ -26,7 +26,7 @@ ResultExpr ServiceProcessPolicy::Evaluat
+ return RestrictIoctl();
+ // Allow the system calls below.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+- defined(__aarch64__)
++ defined(__aarch64__) || defined(__riscv)
+ case __NR_getrlimit:
+ #endif
+ #if defined(__i386__) || defined(__arm__)
+Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_utility_policy_linux.cc
+===================================================================
+--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_utility_policy_linux.cc
++++ chromium-122.0.6261.128/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(__riscv)
+ case __NR_getrlimit:
+ #endif
+ #if defined(__i386__) || defined(__arm__)
diff --git a/riscv-swiftshader.patch b/riscv-swiftshader.patch
new file mode 100644
index 0000000..712e9d2
--- /dev/null
+++ b/riscv-swiftshader.patch
@@ -0,0 +1,25 @@
+Index: chromium-122.0.6261.111/third_party/swiftshader/src/Reactor/BUILD.gn
+===================================================================
+--- chromium-122.0.6261.111.orig/third_party/swiftshader/src/Reactor/BUILD.gn
++++ chromium-122.0.6261.111/third_party/swiftshader/src/Reactor/BUILD.gn
+@@ -307,7 +307,7 @@ if (supports_subzero) {
+
+ if (supports_llvm) {
+ swiftshader_source_set("swiftshader_llvm_reactor") {
+- llvm_dir = "../../third_party/llvm-10.0"
++ llvm_dir = "../../third_party/llvm-16.0"
+
+ deps = [
+ ":swiftshader_reactor_base",
+Index: chromium-122.0.6261.111/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn
+===================================================================
+--- chromium-122.0.6261.111.orig/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn
++++ chromium-122.0.6261.111/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn
+@@ -773,6 +773,7 @@ swiftshader_llvm_source_set("swiftshader
+ "llvm/lib/MC/MCContext.cpp",
+ "llvm/lib/MC/MCDXContainerStreamer.cpp",
+ "llvm/lib/MC/MCDXContainerWriter.cpp",
++ "llvm/lib/MC/MCDisassembler/MCDisassembler.cpp",
+ "llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp",
+ "llvm/lib/MC/MCDwarf.cpp",
+ "llvm/lib/MC/MCELFObjectTargetWriter.cpp",
diff --git a/riscv-v8.patch b/riscv-v8.patch
new file mode 100644
index 0000000..8fe236b
--- /dev/null
+++ b/riscv-v8.patch
@@ -0,0 +1,27 @@
+Index: chromium-128.0.6613.84/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv-inl.h
+===================================================================
+--- chromium-128.0.6613.84.orig/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv-inl.h
++++ chromium-128.0.6613.84/v8/src/wasm/baseline/riscv/liftoff-assembler-riscv-inl.h
+@@ -2368,6 +2368,22 @@ void LiftoffAssembler::CallFrameSetupStu
+ CallBuiltin(Builtin::kWasmLiftoffFrameSetup);
+ }
+
++bool LiftoffAssembler::emit_f16x8_splat(LiftoffRegister dst,
++ LiftoffRegister src) {
++ return false;
++}
++bool LiftoffAssembler::emit_f16x8_extract_lane(LiftoffRegister dst,
++ LiftoffRegister lhs,
++ uint8_t imm_lane_idx) {
++ return false;
++}
++bool LiftoffAssembler::emit_f16x8_replace_lane(LiftoffRegister dst,
++ LiftoffRegister src1,
++ LiftoffRegister src2,
++ uint8_t imm_lane_idx) {
++ return false;
++}
++
+ } // namespace v8::internal::wasm
+
+ #endif // V8_WASM_BASELINE_RISCV_LIFTOFF_ASSEMBLER_RISCV_INL_H_
diff --git a/sources b/sources
new file mode 100644
index 0000000..ae3fb2a
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+d41d8cd98f00b204e9800998ecf8427e chromium-128.0.6613.119.tar.xz
+894e63358d872de8161e0c5d99e4f051 esbuild.tar.gz
diff --git a/system-libdrm.patch b/system-libdrm.patch
new file mode 100644
index 0000000..1712411
--- /dev/null
+++ b/system-libdrm.patch
@@ -0,0 +1,42 @@
+Index: chromium-114.0.5735.90/build/linux/unbundle/libdrm.gn
+===================================================================
+--- chromium-114.0.5735.90.orig/build/linux/unbundle/libdrm.gn
++++ chromium-114.0.5735.90/build/linux/unbundle/libdrm.gn
+@@ -11,7 +11,10 @@ pkg_config("system_libdrm") {
+
+ shim_headers("libdrm_shim") {
+ root_path = "src/include"
+- headers = [ "drm.h" ]
++ headers = [
++ "drm.h",
++ "drm_fourcc.h",
++ ]
+ }
+
+ source_set("libdrm") {
+Index: chromium-114.0.5735.90/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+===================================================================
+--- chromium-114.0.5735.90.orig/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
++++ chromium-114.0.5735.90/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+@@ -18,7 +18,7 @@
+ #include "base/metrics/histogram_macros.h"
+ #include "base/ranges/algorithm.h"
+ #include "base/trace_event/typed_macros.h"
+-#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
++#include <drm_fourcc.h>
+ #include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
+ #include "third_party/skia/include/core/SkCanvas.h"
+ #include "third_party/skia/include/core/SkImage.h"
+Index: chromium-114.0.5735.90/media/gpu/chromeos/video_decoder_pipeline_unittest.cc
+===================================================================
+--- chromium-114.0.5735.90.orig/media/gpu/chromeos/video_decoder_pipeline_unittest.cc
++++ chromium-114.0.5735.90/media/gpu/chromeos/video_decoder_pipeline_unittest.cc
+@@ -25,7 +25,7 @@
+ #include "media/gpu/chromeos/dmabuf_video_frame_pool.h"
+ #include "testing/gmock/include/gmock/gmock.h"
+ #include "testing/gtest/include/gtest/gtest.h"
+-#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
++#include <drm_fourcc.h>
+
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+ // gn check does not account for BUILDFLAG(), so including this header will
diff --git a/use-of-undeclared-identifier-memset.patch b/use-of-undeclared-identifier-memset.patch
new file mode 100644
index 0000000..4f0d8d8
--- /dev/null
+++ b/use-of-undeclared-identifier-memset.patch
@@ -0,0 +1,31 @@
+From daa9f2af75e031f917c26446b6015eb96328c670 Mon Sep 17 00:00:00 2001
+From: Jose Dapena Paz <jdapena@igalia.com>
+Date: Fri, 26 Jul 2024 07:47:50 +0000
+Subject: [PATCH] IWYU: missing include for usage of memset in rust
+ remap_alloc.cc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Bug: 41455655
+Change-Id: I99b630d4801ba0695ea2aea924a1ae903670ba5c
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5735253
+Reviewed-by: Collin Baker <collinbaker@chromium.org>
+Commit-Queue: José Dapena Paz <jdapena@igalia.com>
+Cr-Commit-Position: refs/heads/main@{#1333406}
+---
+ build/rust/std/remap_alloc.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/rust/std/remap_alloc.cc b/build/rust/std/remap_alloc.cc
+index 0a87be2479ed22..eca8fa14863c59 100644
+--- a/build/rust/std/remap_alloc.cc
++++ b/build/rust/std/remap_alloc.cc
+@@ -3,6 +3,7 @@
+ // found in the LICENSE file.
+
+ #include <cstddef>
++#include <cstring>
+
+ #include "build/build_config.h"
+ #include "build/rust/std/alias.h"