backports/electron: upgrade to 27.1.0 #279
12 changed files with 97 additions and 649 deletions
|
@ -1,17 +1,16 @@
|
|||
# Contributor: Lauren N. Liberda <lauren@selfisekai.rocks>
|
||||
# Maintainer: Lauren N. Liberda <lauren@selfisekai.rocks>
|
||||
# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
pkgname=electron-tasje
|
||||
pkgver=0.5.7
|
||||
pkgver=0.7.0
|
||||
pkgrel=0
|
||||
pkgdesc="Tiny replacement for electron-builder"
|
||||
url="https://codeberg.org/selfisekai/electron_tasje/"
|
||||
arch="aarch64 x86_64" # only useful on platforms with electron
|
||||
license="Apache-2.0"
|
||||
makedepends="cargo"
|
||||
source="electron_tasje-$pkgver.tar.gz::https://codeberg.org/selfisekai/electron_tasje/archive/v$pkgver.tar.gz"
|
||||
license="Apache-2.0 OR MIT"
|
||||
makedepends="cargo cargo-auditable"
|
||||
source="electron_tasje-${_rev:-"$pkgver"}.tar.gz::https://codeberg.org/selfisekai/electron_tasje/archive/${_rev:-"v$pkgver"}.tar.gz"
|
||||
builddir="$srcdir/electron_tasje"
|
||||
|
||||
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
@ -20,7 +19,7 @@ prepare() {
|
|||
}
|
||||
|
||||
build() {
|
||||
cargo build --frozen --release
|
||||
cargo auditable build --frozen --release
|
||||
}
|
||||
|
||||
check() {
|
||||
|
@ -32,5 +31,5 @@ package() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
0fc47c25294a284ffcc9fc2440ac383c1b0796c75db9ee12902fc2614271bbb9a4abb9e42d2fa8d1ac5ff804acd251378b35d1b9aa4a00e2e9b927fa5c12c50c electron_tasje-0.5.7.tar.gz
|
||||
1f77dc8a5639c5e61952172b1b30c84cce41b5763d5ce96fa8fb2a02f8f8197a87dd3d9c047a90951d8ddc6f1542d8b0f8c33a3dad233d0868b82f19a765731d electron_tasje-0.7.0.tar.gz
|
||||
"
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
# Maintainer: lauren n. liberda <lauren@selfisekai.rocks>
|
||||
pkgname=electron
|
||||
pkgver=26.1.0
|
||||
pkgver=27.1.0
|
||||
_semver="${pkgver/_beta/-beta.}"
|
||||
pkgrel=0
|
||||
_chromium=116.0.5845.97
|
||||
_chromium=118.0.5993.144
|
||||
_depot_tools=b5509953468edd0906f2dc297886939abbd2bed5
|
||||
_extra_patches=chromium-116-patchset-2
|
||||
_extra_patches=118.0.5993.11
|
||||
pkgdesc="Electron cross-platform desktop toolkit"
|
||||
url="https://github.com/electron/electron"
|
||||
# aarch64 build failure
|
||||
arch="!aarch64 x86_64" # same as chromium
|
||||
arch="aarch64 x86_64" # same as chromium
|
||||
license="MIT"
|
||||
depends="gtk+3.0 so:libudev.so.1 xdg-utils"
|
||||
makedepends="
|
||||
|
@ -20,7 +20,7 @@ makedepends="
|
|||
bzip2-dev
|
||||
c-ares-dev
|
||||
cairo-dev
|
||||
clang-dev
|
||||
clang16-dev
|
||||
clang-extra-tools
|
||||
compiler-rt
|
||||
cups-dev
|
||||
|
@ -67,7 +67,7 @@ makedepends="
|
|||
libxslt-dev
|
||||
linux-headers
|
||||
lld
|
||||
llvm
|
||||
llvm16
|
||||
mesa-dev
|
||||
minizip-dev
|
||||
nghttp2-dev
|
||||
|
@ -86,6 +86,7 @@ makedepends="
|
|||
qt5-qtbase-dev
|
||||
re2-dev
|
||||
rsync
|
||||
rust
|
||||
samurai
|
||||
snappy-dev
|
||||
speex-dev
|
||||
|
@ -94,12 +95,12 @@ makedepends="
|
|||
xcb-proto
|
||||
yarn
|
||||
zlib-dev
|
||||
zstd
|
||||
zstd-dev
|
||||
"
|
||||
subpackages="$pkgname-lang $pkgname-dev"
|
||||
# the lower patches are specific to electron, the top ones are from the equivalent chromium version
|
||||
source="https://s3.sakamoto.pl/lnl-aports-snapshots/electron-$pkgver.tar.zst
|
||||
chromium-patches-$_extra_patches.tar.gz::https://github.com/stha09/chromium-patches/archive/refs/tags/$_extra_patches.tar.gz
|
||||
source="https://s3.sakamoto.pl/lnl-aports-snapshots/electron-$_semver-$_chromium.tar.zst
|
||||
https://gitlab.com/Matt.Jolly/chromium-patches/-/archive/$_extra_patches/chromium-patches-$_extra_patches.tar.gz
|
||||
chromium-revert-drop-of-system-java.patch
|
||||
chromium-use-alpine-target.patch
|
||||
fix-missing-cstdint-include-musl.patch
|
||||
|
@ -112,16 +113,16 @@ source="https://s3.sakamoto.pl/lnl-aports-snapshots/electron-$pkgver.tar.zst
|
|||
musl-v8-monotonic-pthread-cont_timedwait.patch
|
||||
no-execinfo.patch
|
||||
no-mallinfo.patch
|
||||
no-mte.patch
|
||||
no-res-ninit-nclose.patch
|
||||
no-sandbox-settls.patch
|
||||
revert-llvm16-linker-flag.patch
|
||||
tagging-ifuncs.patch
|
||||
temp-failure-retry.patch
|
||||
|
||||
icon.patch
|
||||
python-jinja-3.10.patch
|
||||
vector-const.patch
|
||||
webpack-hash.patch
|
||||
chromium-icu-74.patch
|
||||
|
||||
default.conf
|
||||
electron.desktop
|
||||
|
@ -129,6 +130,26 @@ source="https://s3.sakamoto.pl/lnl-aports-snapshots/electron-$pkgver.tar.zst
|
|||
"
|
||||
# tests are todo for some base checks
|
||||
options="!check net suid"
|
||||
builddir="$srcdir/electron-$_semver-$_chromium"
|
||||
|
||||
export PATH="$PATH:/usr/lib/qt5/bin"
|
||||
|
||||
# clang uses much less memory (and this doesn't support gcc)
|
||||
export CC=clang-16
|
||||
export CXX=clang++-16
|
||||
|
||||
# required to find the tools
|
||||
export AR=llvm16-ar
|
||||
export NM=llvm16-nm
|
||||
export LD=clang++-16
|
||||
|
||||
# less log spam, reproducible
|
||||
export CFLAGS="${CFLAGS/-g/} -O2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
||||
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
||||
export CPPFLAGS="${CPPFLAGS/-g/} -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
|
||||
|
||||
# breaks chromium-based stuff
|
||||
export CXXFLAGS="${CXXFLAGS/-D_GLIBCXX_ASSERTIONS=1}"
|
||||
|
||||
# creates a dist tarball that does not need to git clone everything at build time.
|
||||
snapshot() {
|
||||
|
@ -161,7 +182,7 @@ snapshot() {
|
|||
echo "solutions = [
|
||||
{
|
||||
\"name\": \"src/electron\",
|
||||
\"url\": \"file://$srcdir/electron@v$pkgver\",
|
||||
\"url\": \"file://$srcdir/electron@v$_semver\",
|
||||
\"deps_file\": \"DEPS\",
|
||||
\"managed\": False,
|
||||
\"custom_deps\": {
|
||||
|
@ -202,15 +223,15 @@ snapshot() {
|
|||
--output_name=src/chrome/android/profiles/afdo.prof \
|
||||
--gs_url_base=chromeos-prebuilt/afdo-job/llvm
|
||||
|
||||
mv src $pkgname-$pkgver
|
||||
mv src $pkgname-$_semver-$_chromium
|
||||
|
||||
# extra binaries are most likely things we don't want, so nuke them all
|
||||
for elf in $(scanelf -RA -F "%F" $pkgname-$pkgver); do
|
||||
for elf in $(scanelf -RA -F "%F" $pkgname-$_semver-$_chromium); do
|
||||
rm -f "$elf"
|
||||
done
|
||||
|
||||
msg "generating tarball.. (this takes a while)"
|
||||
tar -cf $pkgname-$pkgver.tar \
|
||||
tar -cf $pkgname-$_semver-$_chromium.tar \
|
||||
--exclude="ChangeLog*" \
|
||||
--exclude="testdata/*" \
|
||||
--exclude="test_data/*" \
|
||||
|
@ -218,9 +239,9 @@ snapshot() {
|
|||
--exclude-backups \
|
||||
--exclude-caches-all \
|
||||
--exclude-vcs \
|
||||
$pkgname-$pkgver
|
||||
$pkgname-$_semver-$_chromium
|
||||
|
||||
zstd --auto-threads=logical --ultra --long -22 -T0 -vv $pkgname-$pkgver.tar
|
||||
zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv $pkgname-$_semver-$_chromium.tar
|
||||
}
|
||||
|
||||
_extra_patch() {
|
||||
|
@ -233,8 +254,11 @@ prepare() {
|
|||
|
||||
default_prepare
|
||||
|
||||
_extra_patch 116-object_paint_properties_sparse-include
|
||||
_extra_patch 116-abseil-arm64
|
||||
_extra_patch 118-SensorReadingField-include
|
||||
_extra_patch 117-material-color-include
|
||||
_extra_patch 118-system-freetype
|
||||
_extra_patch 117-system-zstd
|
||||
_extra_patch 118-compiler
|
||||
|
||||
git init -q .
|
||||
|
||||
|
@ -252,7 +276,7 @@ prepare() {
|
|||
git config commit.gpgsign false
|
||||
git add LICENSE
|
||||
git commit -m "init"
|
||||
git tag "v$pkgver"
|
||||
git tag "v$_semver"
|
||||
git pack-refs
|
||||
yarn install --frozen-lockfile --no-scripts
|
||||
)
|
||||
|
@ -262,8 +286,6 @@ prepare() {
|
|||
./update_npm_deps
|
||||
)
|
||||
|
||||
# re2 - 2023.06 port
|
||||
# libavif - https://github.com/AOMediaCodec/libavif/commit/4d2776a3
|
||||
# libaom - https://aomedia.googlesource.com/aom/+/706ee36dcc82%5E%21/
|
||||
local use_system="
|
||||
dav1d
|
||||
|
@ -274,6 +296,7 @@ prepare() {
|
|||
harfbuzz-ng
|
||||
icu
|
||||
jsoncpp
|
||||
libavif
|
||||
libdrm
|
||||
libevent
|
||||
libjpeg
|
||||
|
@ -281,9 +304,11 @@ prepare() {
|
|||
libxml
|
||||
libxslt
|
||||
opus
|
||||
re2
|
||||
snappy
|
||||
woff2
|
||||
zlib
|
||||
zstd
|
||||
"
|
||||
|
||||
for _lib in $use_system libjpeg_turbo; do
|
||||
|
@ -333,25 +358,6 @@ _configure() {
|
|||
cd "$builddir"
|
||||
msg "Configuring build"
|
||||
|
||||
export PATH="$PATH:/usr/lib/qt5/bin"
|
||||
|
||||
# clang uses much less memory (and this doesn't support gcc)
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
|
||||
# required to find the tools
|
||||
export AR=llvm-ar
|
||||
export NM=llvm-nm
|
||||
export LD=clang++
|
||||
|
||||
# less log spam, reproducible
|
||||
export CFLAGS="${CFLAGS/-g/} -O2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
||||
export CXXFLAGS="${CXXFLAGS/-g/} -O2 -Wno-unknown-warning-option -Wno-builtin-macro-redefined -Wno-deprecated-declarations"
|
||||
export CPPFLAGS="${CPPFLAGS/-g/} -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
|
||||
|
||||
# breaks chromium-based stuff
|
||||
export CXXFLAGS="${CXXFLAGS/-D_GLIBCXX_ASSERTIONS=1}"
|
||||
|
||||
# shellcheck disable=2089
|
||||
local gn_config="
|
||||
clang_base_path=\"/usr\"
|
||||
|
@ -375,7 +381,7 @@ _configure() {
|
|||
|
||||
angle_enable_gl_null=false
|
||||
build_tflite_with_xnnpack=false
|
||||
build_with_tflite_lib=false
|
||||
build_with_tflite_lib=true
|
||||
disable_fieldtrial_testing_config=true
|
||||
enable_hangout_services_extension=true
|
||||
enable_library_cdms=false
|
||||
|
@ -398,7 +404,6 @@ _configure() {
|
|||
rtc_use_pipewire=true
|
||||
use_custom_libcxx=false
|
||||
use_dawn=false
|
||||
use_gnome_keyring=false
|
||||
use_pulseaudio=true
|
||||
use_sysroot=false
|
||||
use_system_cares=true
|
||||
|
@ -409,7 +414,6 @@ _configure() {
|
|||
use_system_libffi=true
|
||||
use_system_libjpeg=true
|
||||
use_system_nghttp2=true
|
||||
use_system_zlib=true
|
||||
use_vaapi=true
|
||||
"
|
||||
|
||||
|
@ -466,30 +470,30 @@ lang() {
|
|||
}
|
||||
|
||||
sha512sums="
|
||||
ddeb2b1ed6d0cf4d47cac2b9dce004811b9839be121ec06b6838563e71132b542464e117299d3f4dade336469407372f6f584590c23c0fa5337135c1357d6f47 electron-26.1.0.tar.zst
|
||||
bc81489d37186790ee1b423ada5d8275fe9c408d1be8635792f7d2984dfe847913b2c8847dd95caa2a7d388fc0914813ceb7f57b9ee2a4c417410f10f944e1a8 chromium-patches-chromium-116-patchset-2.tar.gz
|
||||
8a83b73d219fe607f8ba4a4203ec06c866c883f8056c17e67105162257eb263e26e5424cb2d8a56ab1a25a989cb20cd59c7a2132de587447c193c1b53b01e6c5 electron-27.1.0-118.0.5993.144.tar.zst
|
||||
194c3a7a0fa03a85df6fe52ece3d53d4d15b9d0cb440b56a2ccb1b5c0d3f6481b6f7287aa705c596ceea92d475677ddaf58926f3b31c03a3c20e80ad7e481ce7 chromium-patches-118.0.5993.11.tar.gz
|
||||
29bb685e03356a77df5fd347cdf55194cc8b3265c421cc76e54d64edefc329dbcb052deb26b22e8f587ce68456876c071de1b7d258dd0fcc6ee66c875ec4a020 chromium-revert-drop-of-system-java.patch
|
||||
fa291e941076146d0edd5b96c088240a44a6e0aca3dfc744929655607182d2dc47e6c35ecb419f7c623fcf7f26dc3c4dd924dbf5ed10c3b986283f5ef2f72573 chromium-use-alpine-target.patch
|
||||
9200f78bad70e95c648a5e8392d50642190600f655c6baa366ff6467ebad52d3b3f305dad58f3610da67136f4b723557653b174ec5c25be8d8737ee04d9ee09f fix-missing-cstdint-include-musl.patch
|
||||
33ee60863cc438ef57ffef92ba4cf67a856a5ffc16138bce241bcf87e47b15154aa86918e793c26f7ec4dc62a445257ad5673ed7001daf22c4043cf6cc57da7f gdbinit.patch
|
||||
8de65109ece27ea63bd469f2220c56b8c752ba0a50fdf390082a2d5ae74b8e010199126175569f6d5084270dd4e0571e68aec32c0bca8211a6699925b3a09124 import-version.patch
|
||||
8c458c76991131e54898e25346cd1798179726d6ea6ee7507f9474141f1d90155a750f2c208a513dd6846b429b38a26da9fbcae61e4888163c0d34ec79de4166 libstdc++13.patch
|
||||
49851d42ce8ccd533d01d1bb2477930802b0bcebab8dd52f2da292088378c6ed9b74146e7dad55edfe096281fc84b2c55abaf832744fd4553a97c38ed891df3a libstdc++13.patch
|
||||
0e991842e23a4b9133898125eeb39e45e3f86f886eef5d2f0d9a72ee143a3e124b3b4f60be94edd57ce4185bcd69704edb51f76d08fdb6207f5559a08dd41ab0 mman.patch
|
||||
50c274a420bb8a7f14fcb56e40920dac8f708792a4520789b4987facea459bef88113d5a2b60fa8c57bee6e92bff3617d6b73fa305c8c44614c638971cffd440 musl-sandbox.patch
|
||||
e7163ac5810ac85366cef2447412287c856e3d67c6b77f219a6e5a418b1965b98e449c409424ad0704a5bded9355dd0aec3dc4585918ce5a2ab36c079707afe2 musl-tid-caching.patch
|
||||
92eb002718026611f5542362ad69b67f0a398ff71b3fca5c05d55cb5c6f9f29334e5e127bb4860cfaa3fba0f0d4c901e2b98808217e7dc02e254a64a5c9521aa musl-v8-monotonic-pthread-cont_timedwait.patch
|
||||
8cc774e8d84e434960222c0497ad8193ae35c0732f98d3282d5fd4b4930f914809eec97832c199517ca89ca6b9d1d011db5ce533c40c68ce5fa464609d131a23 no-execinfo.patch
|
||||
b5479874d125ee95a311295f227f8881a83023ec34fded7a6160b3ae32ea3ba0f2b833a9fb264c57f3d22746b6d8b00bdc8eb2ff86c43c412d6d3b55ae15b16b no-mallinfo.patch
|
||||
8a52ff52201a5e20344f5497ee2ffef0520f7b2d934be92227e49c3f2c12a94c33650eefc88a0e451a6b81d44ce197db421aaec7388e6bb1cb525a43628779d3 no-mte.patch
|
||||
e4c4e5bc6f828f9c883dd418c0ba01887949c29c311f76206a1ec29f620b0c0ba0452949dc2778a9c46ea066405857536964a36436a68eecf7da7952736333cf no-res-ninit-nclose.patch
|
||||
6dc4d8dc92e685dace62265a1ddb3aebc558aed54d20ff6d36b030be0c48d7e84662326c31363612492574d9a03c62653cdc21a60995b97dee1d75cae86a9f9b no-sandbox-settls.patch
|
||||
b7f45dfbb3ddd186514b0e45f0d6c170b2c46e4e09d633e8a86ec80ae31f386ed02ffa1a18db2c49e324653941b72f09ca71b2c7478e6ef04d3875ec1909554b revert-llvm16-linker-flag.patch
|
||||
3cffb9ea335e4696260366175e79ececb648087bbb6b484ea65029c0298369aab29c30704eadae889a3c8e5112abf03f5a5e49a1574192c32e98cab8e9197026 tagging-ifuncs.patch
|
||||
e48693e6b7aeebf69a5acbf80d9a35defe4c23835121dfeb58b051ac7c527e758a41004f4d193274fe1b01c0bfb1dbc77b09cb6a404a3fdee507a2918afb0edb temp-failure-retry.patch
|
||||
905565c10f5e5600e7d4db965c892cc45009a258e9995da958974d838ace469e1db1019195307e8807860d5b55ba6bfeea478b1f39a9b99e82c619b2816a1a22 icon.patch
|
||||
e05180199ee1d559e4e577cedd3e589844ecf40d98a86321bf1bea5607b02eeb5feb486deddae40e1005b644550331f6b8500177aa7e79bcb3750d3c1ceb76c3 python-jinja-3.10.patch
|
||||
71571b15cf8bd6259b7fd22bea0e46b64890f3db776365de33fe539f26ce9ef99459e05c3dde9434c3657225bc67160abc915acd93033cb487c770c6a2a5975f vector-const.patch
|
||||
2aa340854316f1284217c0ca17cbf44953684ad6c7da90815117df30928612eb9fb9ffb734b948dfc309cd25d1a67cd57f77aac2d052a3dd9aca07a3a58cbb30 webpack-hash.patch
|
||||
738b0314e6fc9d73766d4d10709bc9063fea7de6a9da9b332fae5214d727d7e89ee669a3eca853ade69134404f57ba778cf1bada5a25042633720c5d71bb6889 default.conf
|
||||
4c540972fa12acd9f0aafb8dc7e9987c3d6e4f28ff679dde522ebcec2dc5ae1a62d9d255bed0a30b9c79ae3b90ab0f5b9ae1ef5b7bf338612e28d9ef70250ca3 chromium-icu-74.patch
|
||||
07e9203b05402f81c0ded5871a845e37bdc4c09b7bb2839312396f298a9ce8196e2c24508675e3d6f695f1e2b0ff1c2c64f4e9dfff3ff5359a87cb7b9b972393 default.conf
|
||||
191559fc7aa1ea0353c6fb0cc321ee1d5803a0e44848c8be941cfab96277b0de6a59962d373e2a2a1686c8f9be2bcf2d2f33706759a339a959e297d3f7fda463 electron.desktop
|
||||
ff1844036c8ae0a0a57a16211a816bc0ad550ccf6ea1cf718e228b8c95b9c4f5c9772d1a1a23638c0e140703a7b52874371e27a0d9d54a7b9468e5c384759be5 electron-launcher.sh
|
||||
"
|
||||
|
|
|
@ -1,219 +0,0 @@
|
|||
needed for libstdc++11 + clang only
|
||||
crbug: https://bugs.chromium.org/p/chromium/issues/detail?id=1189788
|
||||
--
|
||||
diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
|
||||
index 9ecaafe..839318a 100644
|
||||
--- a/sql/recover_module/btree.cc
|
||||
+++ b/sql/recover_module/btree.cc
|
||||
@@ -135,16 +135,25 @@
|
||||
"Move the destructor to the .cc file if it's non-trival");
|
||||
#endif // !DCHECK_IS_ON()
|
||||
|
||||
-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
|
||||
- : page_id_(db_reader->page_id()),
|
||||
- db_reader_(db_reader),
|
||||
- cell_count_(ComputeCellCount(db_reader)),
|
||||
- next_read_index_(0),
|
||||
- last_record_size_(0) {
|
||||
+void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
|
||||
+ DCHECK(db_reader);
|
||||
DCHECK(IsOnValidPage(db_reader));
|
||||
+ page_id_ = db_reader->page_id();
|
||||
+ db_reader_ = db_reader;
|
||||
+ cell_count_ = ComputeCellCount(db_reader);
|
||||
+ next_read_index_ = 0;
|
||||
+ last_record_size_ = 0;
|
||||
DCHECK(DatabasePageReader::IsValidPageId(page_id_));
|
||||
}
|
||||
|
||||
+void LeafPageDecoder::Reset() {
|
||||
+ db_reader_ = nullptr;
|
||||
+ page_id_ = 0;
|
||||
+ cell_count_ = 0;
|
||||
+ next_read_index_ = 0;
|
||||
+ last_record_size_ = 0;
|
||||
+}
|
||||
+
|
||||
bool LeafPageDecoder::TryAdvance() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK(CanAdvance());
|
||||
diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
|
||||
index d76d076..33114b0 100644
|
||||
--- a/sql/recover_module/btree.h
|
||||
+++ b/sql/recover_module/btree.h
|
||||
@@ -102,7 +102,7 @@
|
||||
//
|
||||
// |db_reader| must have been used to read an inner page of a table B-tree.
|
||||
// |db_reader| must outlive this instance.
|
||||
- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
|
||||
+ explicit LeafPageDecoder() noexcept = default;
|
||||
~LeafPageDecoder() noexcept = default;
|
||||
|
||||
LeafPageDecoder(const LeafPageDecoder&) = delete;
|
||||
@@ -150,6 +150,15 @@
|
||||
// read as long as CanAdvance() returns true.
|
||||
bool TryAdvance();
|
||||
|
||||
+ // Initialize with DatabasePageReader
|
||||
+ void Initialize(DatabasePageReader* db_reader);
|
||||
+
|
||||
+ // Reset internal DatabasePageReader
|
||||
+ void Reset();
|
||||
+
|
||||
+ // True if DatabasePageReader is valid
|
||||
+ bool IsValid() { return (db_reader_ != nullptr); }
|
||||
+
|
||||
// True if the given reader may point to an inner page in a table B-tree.
|
||||
//
|
||||
// The last ReadPage() call on |db_reader| must have succeeded.
|
||||
@@ -163,14 +172,14 @@
|
||||
static int ComputeCellCount(DatabasePageReader* db_reader);
|
||||
|
||||
// The number of the B-tree page this reader is reading.
|
||||
- const int64_t page_id_;
|
||||
+ int64_t page_id_;
|
||||
// Used to read the tree page.
|
||||
//
|
||||
// Raw pointer usage is acceptable because this instance's owner is expected
|
||||
// to ensure that the DatabasePageReader outlives this.
|
||||
- DatabasePageReader* const db_reader_;
|
||||
+ DatabasePageReader* db_reader_;
|
||||
// Caches the ComputeCellCount() value for this reader's page.
|
||||
- const int cell_count_ = ComputeCellCount(db_reader_);
|
||||
+ int cell_count_;
|
||||
|
||||
// The reader's cursor state.
|
||||
//
|
||||
diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
|
||||
index 0029ff9..42548bc 100644
|
||||
--- a/sql/recover_module/cursor.cc
|
||||
+++ b/sql/recover_module/cursor.cc
|
||||
@@ -26,7 +26,7 @@
|
||||
int VirtualCursor::First() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
inner_decoders_.clear();
|
||||
- leaf_decoder_ = nullptr;
|
||||
+ leaf_decoder_.Reset();
|
||||
|
||||
AppendPageDecoder(table_->root_page_id());
|
||||
return Next();
|
||||
@@ -36,18 +36,18 @@
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
record_reader_.Reset();
|
||||
|
||||
- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
|
||||
- if (leaf_decoder_.get()) {
|
||||
- if (!leaf_decoder_->CanAdvance()) {
|
||||
+ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
|
||||
+ if (leaf_decoder_.IsValid()) {
|
||||
+ if (!leaf_decoder_.CanAdvance()) {
|
||||
// The leaf has been exhausted. Remove it from the DFS stack.
|
||||
- leaf_decoder_ = nullptr;
|
||||
+ leaf_decoder_.Reset();
|
||||
continue;
|
||||
}
|
||||
- if (!leaf_decoder_->TryAdvance())
|
||||
+ if (!leaf_decoder_.TryAdvance())
|
||||
continue;
|
||||
|
||||
- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
|
||||
- leaf_decoder_->last_record_offset())) {
|
||||
+ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
|
||||
+ leaf_decoder_.last_record_offset())) {
|
||||
continue;
|
||||
}
|
||||
if (!record_reader_.Initialize())
|
||||
@@ -99,13 +99,13 @@
|
||||
int64_t VirtualCursor::RowId() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK(record_reader_.IsInitialized());
|
||||
- DCHECK(leaf_decoder_.get());
|
||||
- return leaf_decoder_->last_record_rowid();
|
||||
+ DCHECK(leaf_decoder_.IsValid());
|
||||
+ return leaf_decoder_.last_record_rowid();
|
||||
}
|
||||
|
||||
void VirtualCursor::AppendPageDecoder(int page_id) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- DCHECK(leaf_decoder_.get() == nullptr)
|
||||
+ DCHECK(!leaf_decoder_.IsValid())
|
||||
<< __func__
|
||||
<< " must only be called when the current path has no leaf decoder";
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
return;
|
||||
|
||||
if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
|
||||
- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
|
||||
+ leaf_decoder_.Initialize(&db_reader_);
|
||||
return;
|
||||
}
|
||||
|
||||
diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
|
||||
index afcd690..b15c31d 100644
|
||||
--- a/sql/recover_module/cursor.h
|
||||
+++ b/sql/recover_module/cursor.h
|
||||
@@ -129,7 +129,7 @@
|
||||
std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
|
||||
|
||||
// Decodes the leaf page containing records.
|
||||
- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
|
||||
+ LeafPageDecoder leaf_decoder_;
|
||||
|
||||
SEQUENCE_CHECKER(sequence_checker_);
|
||||
};
|
||||
diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
|
||||
index 58e75de..5fe9620 100644
|
||||
--- a/sql/recover_module/pager.cc
|
||||
+++ b/sql/recover_module/pager.cc
|
||||
@@ -23,8 +23,7 @@
|
||||
"ints are not appropriate for representing page IDs");
|
||||
|
||||
DatabasePageReader::DatabasePageReader(VirtualTable* table)
|
||||
- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
|
||||
- table_(table) {
|
||||
+ : page_data_(), table_(table) {
|
||||
DCHECK(table != nullptr);
|
||||
DCHECK(IsValidPageSize(table->page_size()));
|
||||
}
|
||||
@@ -57,8 +56,8 @@
|
||||
std::numeric_limits<int64_t>::max(),
|
||||
"The |read_offset| computation above may overflow");
|
||||
|
||||
- int sqlite_status =
|
||||
- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
|
||||
+ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
|
||||
+ const_cast<uint8_t*>(page_data_.data()));
|
||||
|
||||
// |page_id_| needs to be set to kInvalidPageId if the read failed.
|
||||
// Otherwise, future ReadPage() calls with the previous |page_id_| value
|
||||
diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
|
||||
index 0e388ddc..99314e3 100644
|
||||
--- a/sql/recover_module/pager.h
|
||||
+++ b/sql/recover_module/pager.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef SQL_RECOVER_MODULE_PAGER_H_
|
||||
#define SQL_RECOVER_MODULE_PAGER_H_
|
||||
|
||||
+#include <array>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
@@ -70,7 +71,7 @@
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK_NE(page_id_, kInvalidPageId)
|
||||
<< "Successful ReadPage() required before accessing pager state";
|
||||
- return page_data_.get();
|
||||
+ return page_data_.data();
|
||||
}
|
||||
|
||||
// The number of bytes in the page read by the last ReadPage() call.
|
||||
@@ -137,7 +138,7 @@
|
||||
int page_id_ = kInvalidPageId;
|
||||
// Stores the bytes of the last page successfully read by ReadPage().
|
||||
// The content is undefined if the last call to ReadPage() did not succeed.
|
||||
- const std::unique_ptr<uint8_t[]> page_data_;
|
||||
+ const std::array<uint8_t, kMaxPageSize> page_data_;
|
||||
// Raw pointer usage is acceptable because this instance's owner is expected
|
||||
// to ensure that the VirtualTable outlives this.
|
||||
VirtualTable* const table_;
|
20
backports/electron/chromium-icu-74.patch
Normal file
20
backports/electron/chromium-icu-74.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
See ICU change https://github.com/unicode-org/icu/commit/2e45e6ec0e84a1c01812015a254ea31b286316fb
|
||||
|
||||
Similar has happened in the past. See:
|
||||
https://chromium.googlesource.com/chromium/src/+/e60b571faa3f14dd9119a6792dccf12f8bf80192
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/text/text_break_iterator.cc b/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
index ddfbd51..247da06 100644
|
||||
--- a/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
+++ b/third_party/blink/renderer/platform/text/text_break_iterator.cc
|
||||
@@ -161,7 +161,9 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
-#if U_ICU_VERSION_MAJOR_NUM >= 58
|
||||
+#if U_ICU_VERSION_MAJOR_NUM >= 74
|
||||
+#define BA_LB_COUNT (U_LB_COUNT - 8)
|
||||
+#elif U_ICU_VERSION_MAJOR_NUM >= 58
|
||||
#define BA_LB_COUNT (U_LB_COUNT - 3)
|
||||
#else
|
||||
#define BA_LB_COUNT U_LB_COUNT
|
|
@ -2,4 +2,4 @@
|
|||
# the electron launcher.
|
||||
|
||||
# Options to pass to electron.
|
||||
ELECTRON_FLAGS="--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer"
|
||||
ELECTRON_FLAGS="--ozone-platform-hint=auto --enable-features=WebRTCPipeWireCapturer"
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
--- a/buildtools/third_party/libc++/__config_site
|
||||
+++ b/buildtools/third_party/libc++/__config_site
|
||||
@@ -49,3 +49,4 @@
|
||||
#define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
|
||||
|
||||
+#define _LIBCPP_HAS_MUSL_LIBC
|
||||
#endif // _LIBCPP_CONFIG_SITE
|
|
@ -51,16 +51,6 @@ missing libstdc++13 includes
|
|||
namespace ui {
|
||||
|
||||
// This Kalman filter is used to predict state in one axles.
|
||||
--- a/base/strings/string_piece.h
|
||||
+++ b/base/strings/string_piece.h
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include <algorithm>
|
||||
+#include <cstdint>
|
||||
#include <iosfwd>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
--- a/ui/events/types/scroll_types.h
|
||||
+++ b/ui/events/types/scroll_types.h
|
||||
@@ -5,6 +5,8 @@
|
||||
|
|
13
backports/electron/no-mte.patch
Normal file
13
backports/electron/no-mte.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
M115 needs ifuncs for this
|
||||
--
|
||||
--- a/base/allocator/partition_allocator/partition_alloc_config.h
|
||||
+++ b/base/allocator/partition_allocator/partition_alloc_config.h
|
||||
@@ -155,7 +155,7 @@
|
||||
#define PA_CONFIG_HAS_MEMORY_TAGGING() \
|
||||
(defined(ARCH_CPU_ARM64) && defined(__clang__) && \
|
||||
!defined(ADDRESS_SANITIZER) && \
|
||||
- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)))
|
||||
+ ((BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_ANDROID)))
|
||||
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
static_assert(sizeof(void*) == 8);
|
|
@ -1,14 +0,0 @@
|
|||
back in the day when net_unittests were ran, the block arena size was not big
|
||||
enough for some reason. should look at this again
|
||||
--
|
||||
--- a/net/third_party/quiche/src/quiche/quic/core/quic_one_block_arena.h
|
||||
+++ b/net/third_party/quiche/src/quiche/quic/core/quic_one_block_arena.h
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
// QuicConnections currently use around 1KB of polymorphic types which would
|
||||
// ordinarily be on the heap. Instead, store them inline in an arena.
|
||||
-using QuicConnectionArena = QuicOneBlockArena<1280>;
|
||||
+using QuicConnectionArena = QuicOneBlockArena<1504>;
|
||||
|
||||
} // namespace quic
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
From 54969766fd2029c506befc46e9ce14d67c7ed02a Mon Sep 17 00:00:00 2001
|
||||
From: Arthur Eubanks <aeubanks@google.com>
|
||||
Date: Tue, 25 Apr 2023 03:05:19 +0000
|
||||
Subject: [PATCH] Reland [clang] Disable autoupgrading debug info in ThinLTO
|
||||
builds
|
||||
|
||||
ThinLTO reads bitcode many times and attempts to upgrade the debug info every time. This is expensive since it calls the verifier. We don't need this given all LLVM bitcode producers are from the same version of LLVM.
|
||||
|
||||
For just the build step that runs ThinLTO and links official Chrome, measured 34T -> 32T instructions via perf stat.
|
||||
|
||||
Reland disables adding flag for ChromeOS since that toolchain is too old to have this flag.
|
||||
|
||||
Bug: 972449
|
||||
Change-Id: I44552dd6c9dc71683c002d0c885e78b2a4341659
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4470209
|
||||
Reviewed-by: Nico Weber <thakis@chromium.org>
|
||||
Commit-Queue: Arthur Eubanks <aeubanks@google.com>
|
||||
Cr-Commit-Position: refs/heads/main@{#1135007}
|
||||
---
|
||||
build/config/compiler/BUILD.gn | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
index 1c13bc80f0f..53db095c1b1 100644
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -685,7 +685,6 @@
|
||||
"/lldltocache:" +
|
||||
rebase_path("$root_out_dir/thinlto-cache", root_build_dir),
|
||||
"/lldltocachepolicy:$cache_policy",
|
||||
- "-mllvm:-disable-auto-upgrade-debug-info",
|
||||
]
|
||||
} else {
|
||||
ldflags += [ "-flto=thin" ]
|
||||
@@ -732,7 +731,6 @@
|
||||
# toolchain has this flag.
|
||||
# We only use one version of LLVM within a build so there's no need to
|
||||
# upgrade debug info, which can be expensive since it runs the verifier.
|
||||
- ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
for some reason this breaks and the fd returned after close() after a few
|
||||
cycles is still in the lock array.
|
||||
|
||||
so, just don't enforce or wrap anything.
|
||||
|
||||
note when testing this again: __close does not exist as a symbol in musl, so a
|
||||
manual dlsym workaround has to be performed to use this codepath.
|
||||
--- a/base/files/scoped_file_linux.cc
|
||||
+++ b/base/files/scoped_file_linux.cc
|
||||
@@ -77,15 +77,3 @@
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
-
|
||||
-extern "C" {
|
||||
-
|
||||
-int __close(int);
|
||||
-
|
||||
-__attribute__((visibility("default"), noinline)) int close(int fd) {
|
||||
- if (base::IsFDOwned(fd) && g_is_ownership_enforced)
|
||||
- CrashOnFdOwnershipViolation();
|
||||
- return __close(fd);
|
||||
-}
|
||||
-
|
||||
-} // extern "C"
|
|
@ -1,271 +0,0 @@
|
|||
From 89e6aa2c5346999aa4019eac9b08d79afe990766 Mon Sep 17 00:00:00 2001
|
||||
From: "lauren n. liberda" <lauren@selfisekai.rocks>
|
||||
Date: Sun, 20 Aug 2023 04:44:25 +0200
|
||||
Subject: [PATCH] Revert "Reland "Reland "mte: refactor the tagging functions
|
||||
to use ifuncs"""
|
||||
|
||||
This reverts commit b2c4ff8d5d8cdbf2487363a5b8d68b6485706069.
|
||||
---
|
||||
.../partition_allocator/partition_root.cc | 4 ++
|
||||
base/allocator/partition_allocator/tagging.cc | 56 ++++++-------------
|
||||
base/allocator/partition_allocator/tagging.h | 43 +++++++++-----
|
||||
.../partition_allocator/tagging_unittest.cc | 8 +++
|
||||
4 files changed, 60 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc
|
||||
index 3fc0b11fb7156..813afbf836098 100644
|
||||
--- a/base/allocator/partition_allocator/partition_root.cc
|
||||
+++ b/base/allocator/partition_allocator/partition_root.cc
|
||||
@@ -868,6 +868,10 @@ void PartitionRoot::Init(PartitionOptions opts) {
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Swaps out the active no-op tagging intrinsics with MTE-capable ones, if
|
||||
+ // running on the right hardware.
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
+
|
||||
#if BUILDFLAG(HAS_64_BIT_POINTERS)
|
||||
// Reserve address space for partition alloc.
|
||||
internal::PartitionAddressSpace::Init();
|
||||
diff --git a/base/allocator/partition_allocator/tagging.cc b/base/allocator/partition_allocator/tagging.cc
|
||||
index 6f0d49dffc3c6..63368e870fe0c 100644
|
||||
--- a/base/allocator/partition_allocator/tagging.cc
|
||||
+++ b/base/allocator/partition_allocator/tagging.cc
|
||||
@@ -12,9 +12,7 @@
|
||||
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
#include <arm_acle.h>
|
||||
-#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
-#include <sys/ifunc.h>
|
||||
#include <sys/prctl.h>
|
||||
#define PR_SET_TAGGED_ADDR_CTRL 55
|
||||
#define PR_GET_TAGGED_ADDR_CTRL 56
|
||||
@@ -121,6 +119,12 @@ namespace {
|
||||
return ret;
|
||||
}
|
||||
|
||||
+#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
+static bool HasCPUMemoryTaggingExtension() {
|
||||
+ return base::CPU::GetInstanceNoAllocation().has_mte();
|
||||
+}
|
||||
+#endif // PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
+
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
void* TagRegionRandomlyForMTE(void* ptr, size_t sz, uint64_t mask) {
|
||||
// Randomly tag a region (MTE-enabled systems only). The first 16-byte
|
||||
@@ -162,6 +166,7 @@ void* RemaskVoidPtrForMTE(void* ptr) {
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void* TagRegionIncrementNoOp(void* ptr, size_t sz) {
|
||||
// Region parameters are checked even on non-MTE systems to check the
|
||||
@@ -178,49 +183,24 @@ void* TagRegionRandomlyNoOp(void* ptr, size_t sz, uint64_t mask) {
|
||||
void* RemaskVoidPtrNoOp(void* ptr) {
|
||||
return ptr;
|
||||
}
|
||||
-#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
+void InitializeMTESupportIfNeeded() {
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
-using RemaskPtrInternalFn = void*(void* ptr);
|
||||
-using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size);
|
||||
-
|
||||
-using TagMemoryRangeRandomlyInternalFn = void*(void* ptr,
|
||||
- size_t size,
|
||||
- uint64_t mask);
|
||||
-
|
||||
-extern "C" TagMemoryRangeIncrementInternalFn(
|
||||
- *ResolveTagMemoryRangeIncrement(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
|
||||
- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
|
||||
- return TagRegionIncrementForMTE;
|
||||
+ if (HasCPUMemoryTaggingExtension()) {
|
||||
+ global_remask_void_ptr_fn = RemaskVoidPtrForMTE;
|
||||
+ global_tag_memory_range_increment_fn = TagRegionIncrementForMTE;
|
||||
+ global_tag_memory_range_randomly_fn = TagRegionRandomlyForMTE;
|
||||
}
|
||||
- return TagRegionIncrementNoOp;
|
||||
-}
|
||||
-
|
||||
-extern "C" TagMemoryRangeRandomlyInternalFn(
|
||||
- *ResolveTagMemoryRandomly(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
|
||||
- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
|
||||
- return TagRegionRandomlyForMTE;
|
||||
- }
|
||||
- return TagRegionRandomlyNoOp;
|
||||
-}
|
||||
-
|
||||
-extern "C" RemaskPtrInternalFn(
|
||||
- *ResolveRemaskPointer(uint64_t hwcap, struct __ifunc_arg_t* hw)) {
|
||||
- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) {
|
||||
- return RemaskVoidPtrForMTE;
|
||||
- }
|
||||
- return RemaskVoidPtrNoOp;
|
||||
+#endif
|
||||
}
|
||||
|
||||
-void* TagMemoryRangeIncrementInternal(void* ptr, size_t size)
|
||||
- __attribute__((ifunc("ResolveTagMemoryRangeIncrement")));
|
||||
-void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask)
|
||||
- __attribute__((ifunc("ResolveTagMemoryRandomly")));
|
||||
-void* RemaskPointerInternal(void* ptr)
|
||||
- __attribute__((ifunc("ResolveRemaskPointer")));
|
||||
-#endif // PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
+RemaskPtrInternalFn* global_remask_void_ptr_fn = RemaskVoidPtrNoOp;
|
||||
+TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn =
|
||||
+ TagRegionIncrementNoOp;
|
||||
+TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn =
|
||||
+ TagRegionRandomlyNoOp;
|
||||
|
||||
TagViolationReportingMode GetMemoryTaggingModeForCurrentThread() {
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
diff --git a/base/allocator/partition_allocator/tagging.h b/base/allocator/partition_allocator/tagging.h
|
||||
index 858c5c3f69fc5..476e84e849c12 100644
|
||||
--- a/base/allocator/partition_allocator/tagging.h
|
||||
+++ b/base/allocator/partition_allocator/tagging.h
|
||||
@@ -56,16 +56,32 @@ void ChangeMemoryTaggingModeForAllThreadsPerProcess(TagViolationReportingMode);
|
||||
PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
TagViolationReportingMode GetMemoryTaggingModeForCurrentThread();
|
||||
|
||||
-// These forward-defined functions do not really exist in tagging.cc, they're resolved
|
||||
-// by the dynamic linker to MTE-capable versions on the right hardware.
|
||||
-#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
-PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
-void* TagMemoryRangeIncrementInternal(void* ptr, size_t size);
|
||||
-PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
-void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask);
|
||||
-PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
-void* RemaskPointerInternal(void* ptr);
|
||||
-#endif
|
||||
+// Called by the partition allocator after initial startup, this detects MTE
|
||||
+// support in the current CPU and replaces the active tagging intrinsics with
|
||||
+// MTE versions if needed.
|
||||
+PA_COMPONENT_EXPORT(PARTITION_ALLOC) void InitializeMTESupportIfNeeded();
|
||||
+
|
||||
+// These global function pointers hold the implementations of the tagging
|
||||
+// intrinsics (TagMemoryRangeRandomly, TagMemoryRangeIncrement, RemaskPtr).
|
||||
+// They are designed to be callable without taking a branch. They are initially
|
||||
+// set to no-op functions in tagging.cc, but can be replaced with MTE-capable
|
||||
+// ones through InitializeMTEIfNeeded(). This is conceptually similar to an
|
||||
+// IFUNC, even though less secure. These function pointers were introduced to
|
||||
+// support older Android releases. With the removal of support for Android M,
|
||||
+// it became possible to use IFUNC instead.
|
||||
+// TODO(bartekn): void* -> uintptr_t
|
||||
+using RemaskPtrInternalFn = void*(void* ptr);
|
||||
+using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size);
|
||||
+
|
||||
+using TagMemoryRangeRandomlyInternalFn = void*(void* ptr,
|
||||
+ size_t size,
|
||||
+ uint64_t mask);
|
||||
+extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
+ TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn;
|
||||
+extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
+ TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn;
|
||||
+extern PA_COMPONENT_EXPORT(PARTITION_ALLOC)
|
||||
+ RemaskPtrInternalFn* global_remask_void_ptr_fn;
|
||||
|
||||
// Increments the tag of the memory range ptr. Useful for provable revocations
|
||||
// (e.g. free). Returns the pointer with the new tag. Ensures that the entire
|
||||
@@ -75,7 +91,7 @@ void* RemaskPointerInternal(void* ptr);
|
||||
template <typename T>
|
||||
PA_ALWAYS_INLINE T* TagMemoryRangeIncrement(T* ptr, size_t size) {
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
- return reinterpret_cast<T*>(TagMemoryRangeIncrementInternal(ptr, size));
|
||||
+ return reinterpret_cast<T*>(global_tag_memory_range_increment_fn(ptr, size));
|
||||
#else
|
||||
return ptr;
|
||||
#endif
|
||||
@@ -93,7 +109,8 @@ PA_ALWAYS_INLINE T* TagMemoryRangeRandomly(T* ptr,
|
||||
size_t size,
|
||||
uint64_t mask = 0u) {
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
- return reinterpret_cast<T*>(TagMemoryRangeRandomlyInternal(ptr, size, mask));
|
||||
+ return reinterpret_cast<T*>(
|
||||
+ global_tag_memory_range_randomly_fn(ptr, size, mask));
|
||||
#else
|
||||
return ptr;
|
||||
#endif
|
||||
@@ -108,7 +125,7 @@ PA_ALWAYS_INLINE void* TagMemoryRangeRandomly(uintptr_t ptr,
|
||||
template <typename T>
|
||||
PA_ALWAYS_INLINE T* TagPtr(T* ptr) {
|
||||
#if PA_CONFIG(HAS_MEMORY_TAGGING)
|
||||
- return reinterpret_cast<T*>(RemaskPointerInternal(ptr));
|
||||
+ return reinterpret_cast<T*>(global_remask_void_ptr_fn(ptr));
|
||||
#else
|
||||
return ptr;
|
||||
#endif
|
||||
diff --git a/base/allocator/partition_allocator/tagging_unittest.cc b/base/allocator/partition_allocator/tagging_unittest.cc
|
||||
index 5c25a46e62015..fab5db7212a34 100644
|
||||
--- a/base/allocator/partition_allocator/tagging_unittest.cc
|
||||
+++ b/base/allocator/partition_allocator/tagging_unittest.cc
|
||||
@@ -16,6 +16,7 @@ namespace partition_alloc::internal {
|
||||
|
||||
// Check whether we can call the tagging intrinsics safely on all architectures.
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
PageAccessibilityConfiguration(
|
||||
@@ -31,6 +32,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -52,6 +54,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) {
|
||||
#if defined(ARCH_CPU_64_BITS)
|
||||
// Size / alignment constraints are only enforced on 64-bit architectures.
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -68,6 +71,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -83,6 +87,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -99,6 +104,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -114,6 +120,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
@@ -129,6 +136,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) {
|
||||
}
|
||||
|
||||
TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadAlign) {
|
||||
+ ::partition_alloc::internal::InitializeMTESupportIfNeeded();
|
||||
base::CPU cpu;
|
||||
uintptr_t buffer =
|
||||
AllocPages(PageAllocationGranularity(), PageAllocationGranularity(),
|
||||
--
|
||||
2.41.0
|
||||
|
Loading…
Reference in a new issue