[arch-commits] Commit in electron12/repos (16 files)
Felix Yan
felixonmars at gemini.archlinux.org
Fri Apr 15 03:44:07 UTC 2022
Date: Friday, April 15, 2022 @ 03:44:07
Author: felixonmars
Revision: 1186440
archrelease: copy trunk to community-staging-x86_64
Added:
electron12/repos/community-staging-x86_64/
electron12/repos/community-staging-x86_64/PKGBUILD
(from rev 1186439, electron12/trunk/PKGBUILD)
electron12/repos/community-staging-x86_64/add-dependency-on-opus-in-webcodecs.patch
(from rev 1186439, electron12/trunk/add-dependency-on-opus-in-webcodecs.patch)
electron12/repos/community-staging-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch
(from rev 1186439, electron12/trunk/breakpad-fix-for-non-constant-SIGSTKSZ.patch)
electron12/repos/community-staging-x86_64/chromium-fix-libva-redef.patch
(from rev 1186439, electron12/trunk/chromium-fix-libva-redef.patch)
electron12/repos/community-staging-x86_64/chromium-glibc-2.33.patch
(from rev 1186439, electron12/trunk/chromium-glibc-2.33.patch)
electron12/repos/community-staging-x86_64/chromium-harfbuzz-3.0.0.patch
(from rev 1186439, electron12/trunk/chromium-harfbuzz-3.0.0.patch)
electron12/repos/community-staging-x86_64/default_app-icon.patch
(from rev 1186439, electron12/trunk/default_app-icon.patch)
electron12/repos/community-staging-x86_64/electron-launcher.sh
(from rev 1186439, electron12/trunk/electron-launcher.sh)
electron12/repos/community-staging-x86_64/electron.desktop
(from rev 1186439, electron12/trunk/electron.desktop)
electron12/repos/community-staging-x86_64/ffmpeg5.patch
(from rev 1186439, electron12/trunk/ffmpeg5.patch)
electron12/repos/community-staging-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
(from rev 1186439, electron12/trunk/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch)
electron12/repos/community-staging-x86_64/skia-harfbuzz-3.0.0.patch
(from rev 1186439, electron12/trunk/skia-harfbuzz-3.0.0.patch)
electron12/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
(from rev 1186439, electron12/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
electron12/repos/community-staging-x86_64/std-max-fix.patch
(from rev 1186439, electron12/trunk/std-max-fix.patch)
electron12/repos/community-staging-x86_64/use-system-libraries-in-node.patch
(from rev 1186439, electron12/trunk/use-system-libraries-in-node.patch)
------------------------------------------------------------+
PKGBUILD | 250 +++++++++++
add-dependency-on-opus-in-webcodecs.patch | 43 +
breakpad-fix-for-non-constant-SIGSTKSZ.patch | 35 +
chromium-fix-libva-redef.patch | 86 +++
chromium-glibc-2.33.patch | 144 ++++++
chromium-harfbuzz-3.0.0.patch | 20
default_app-icon.patch | 21
electron-launcher.sh | 20
electron.desktop | 7
ffmpeg5.patch | 142 ++++++
sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch | 39 +
skia-harfbuzz-3.0.0.patch | 100 ++++
sql-make-VirtualCursor-standard-layout-type.patch | 238 ++++++++++
std-max-fix.patch | 11
use-system-libraries-in-node.patch | 52 ++
15 files changed, 1208 insertions(+)
Copied: electron12/repos/community-staging-x86_64/PKGBUILD (from rev 1186439, electron12/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,250 @@
+# Maintainer: Nicola Squartini <tensor5 at gmail.com>
+
+pkgname=electron12
+pkgver=12.2.3
+_commit=8492c10291d852071bb599fcf59d57eb2566afd8
+_chromiumver=89.0.4389.128
+_gcc_patchset=7
+pkgrel=4
+pkgdesc='Build cross platform desktop apps with web technologies'
+arch=('x86_64')
+url='https://electronjs.org/'
+license=('MIT' 'custom')
+depends=('c-ares' 'ffmpeg' 'gtk3' 'libevent' 'libxslt' 'minizip' 'nss' 're2'
+ 'snappy')
+makedepends=('clang' 'git' 'gn-m87' 'gperf' 'harfbuzz-icu' 'http-parser'
+ 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja'
+ 'npm' 'pciutils' 'pipewire' 'python2' 'python' 'python-httplib2'
+ 'python-pyparsing' 'python-six' 'wget' 'yarn')
+optdepends=('kde-cli-tools: file deletion support (kioclient5)'
+ 'libappindicator-gtk3: StatusNotifierItem support'
+ 'pipewire: WebRTC desktop sharing under Wayland'
+ 'trash-cli: file deletion support (trash-put)'
+ "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+options=('!lto') # Electron adds its own flags for ThinLTO
+source=('git+https://github.com/electron/electron.git'
+ 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main'
+ "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
+ "electron-launcher.sh"
+ "electron.desktop"
+ 'default_app-icon.patch'
+ 'use-system-libraries-in-node.patch'
+ 'add-dependency-on-opus-in-webcodecs.patch'
+ 'breakpad-fix-for-non-constant-SIGSTKSZ.patch'
+ 'chromium-fix-libva-redef.patch'
+ 'chromium-glibc-2.33.patch'
+ 'chromium-harfbuzz-3.0.0.patch'
+ 'sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch'
+ 'skia-harfbuzz-3.0.0.patch'
+ 'sql-make-VirtualCursor-standard-layout-type.patch'
+ 'std-max-fix.patch'
+ 'ffmpeg5.patch'
+ )
+sha256sums=('SKIP'
+ 'SKIP'
+ 'f8b1558f6c87b33423da854d42f0f69d47885a96d6bf6ce7f26373e93d47442f'
+ '929e058a3cbcdea24f42716a43f6ab29727d99b0cddd807099b791662f1a100e'
+ '0805ec335447914d8895afa13f07de0496a687f7f6a088c1fe10d72d08d2f42c'
+ 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
+ 'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
+ 'b86b11de8db438c47f0a84c7956740f648d21035f4ee46bfbd50c3348d369121'
+ 'b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf'
+ 'de9eb3612d44616a500c2eccdffac814eb90ad9a868cc1030d17fc6783d544e2'
+ '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
+ '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
+ 'f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61'
+ 'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
+ 'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+ 'c315dd56b354cf5ad3458e1edf397cc7b492fefe82138135a881206a82b9d9dc'
+ '4f32b815349357ef1f17b36059cee588c994472b9754a194fff41ec21a93826b'
+ )
+
+_system_libs=('ffmpeg'
+ 'flac'
+ 'fontconfig'
+ 'freetype'
+ 'harfbuzz-ng'
+ 'icu'
+ 'libdrm'
+ 'libevent'
+ 'libjpeg'
+ 'libpng'
+# 'libvpx'
+ 'libwebp'
+ 'libxml'
+ 'libxslt'
+# 'openh264'
+ 'opus'
+ 're2'
+ 'snappy'
+ 'zlib'
+ )
+
+prepare() {
+ mkdir -p "${srcdir}"/python2-path
+ ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+ export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+
+ echo "Fetching chromium..."
+ git clone --branch=${_chromiumver} --depth=1 \
+ https://chromium.googlesource.com/chromium/src.git
+
+ echo "solutions = [
+ {
+ \"name\": \"src/electron\",
+ \"url\": \"file://${srcdir}/electron@${_commit}\",
+ \"deps_file\": \"DEPS\",
+ \"managed\": False,
+ \"custom_deps\": {
+ \"src\": None,
+ },
+ \"custom_vars\": {},
+ },
+]" > .gclient
+
+ python3 "${srcdir}/depot_tools/gclient.py" sync \
+ --with_branch_heads \
+ --with_tags \
+ --nohooks
+
+ sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
+
+ echo "Running hooks..."
+ # python2 "${srcdir}/depot_tools/gclient.py" runhooks
+ python2 src/build/landmines.py
+ python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
+ python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
+ --revision-id-only --header src/gpu/config/gpu_lists_version.h
+ python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
+ -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
+ # Create sysmlink to system clang-format
+ ln -s /usr/bin/clang-format src/buildtools/linux64
+ # Create sysmlink to system Node.js
+ mkdir -p src/third_party/node/linux/node-linux-x64/bin
+ ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
+ #python2 src/third_party/depot_tools/download_from_google_storage.py \
+ # --no_resume --extract --no_auth --bucket chromium-nodejs \
+ # -s src/third_party/node/node_modules.tar.gz.sha1
+ cd src/third_party/node
+ npm ci
+ cd ../../..
+ vpython src/tools/download_optimization_profile.py \
+ --newest_state=src/chrome/android/profiles/newest.txt \
+ --local_state=src/chrome/android/profiles/local.txt \
+ --output_name=src/chrome/android/profiles/afdo.prof \
+ --gs_url_base=chromeos-prebuilt/afdo-job/llvm
+ #vpython src/tools/update_pgo_profiles.py \
+ # --target=linux \
+ # update \
+ # --gs-url-base=chromium-optimization-profiles/pgo_profiles
+ python2 src/electron/script/apply_all_patches.py \
+ src/electron/patches/config.json
+ cd src/electron
+ yarn install --frozen-lockfile
+ cd ..
+
+ echo "Applying local patches..."
+ # Fixes for building with libstdc++ instead of libc++
+ patch -Np1 -d third_party/breakpad/breakpad < ../breakpad-fix-for-non-constant-SIGSTKSZ.patch
+ patch -Np1 -i ../patches/chromium-89-quiche-dcheck.patch
+ patch -Np1 -i ../patches/chromium-89-AXTreeSerializer-include.patch
+ patch -Np1 -i ../ffmpeg5.patch
+ patch -Np1 -i ../add-dependency-on-opus-in-webcodecs.patch
+ patch -Np1 -i ../chromium-fix-libva-redef.patch
+ patch -Np1 -i ../chromium-glibc-2.33.patch
+ patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
+ patch -Np1 -i ../sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch
+ patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
+ patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+ patch -Np1 -i ../std-max-fix.patch
+ patch -Np1 -i ../use-system-libraries-in-node.patch
+ patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
+
+ echo "Patching Chromium for using system libraries..."
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+ for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
+ third_party_dir="third_party/${lib}"
+ if [ ! -d ${third_party_dir} ]; then
+ third_party_dir="base/${third_party_dir}"
+ fi
+ find ${third_party_dir} -type f \
+ \! -path "${third_party_dir}/chromium/*" \
+ \! -path "${third_party_dir}/google/*" \
+ \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
+ \! -regex '.*\.\(gn\|gni\|isolate\)' \
+ -delete
+ done
+ python2 build/linux/unbundle/replace_gn_files.py \
+ --system-libraries \
+ "${_system_libs[@]}"
+}
+
+build() {
+ export CC=clang
+ export CXX=clang++
+ export AR=ar
+ export NM=nm
+
+ CFLAGS="${CFLAGS/-fexceptions/}"
+ CXXFLAGS="${CXXFLAGS/-fexceptions/}"
+
+ # This appears to cause random segfaults when combined with ThinLTO
+ # https://bugs.archlinux.org/task/73518
+ CFLAGS=${CFLAGS/-fstack-clash-protection}
+ CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
+
+ # Do not warn about unknown warning options
+ CFLAGS+=' -Wno-unknown-warning-option'
+ CXXFLAGS+=' -Wno-unknown-warning-option'
+
+ cd src
+ export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+ GN_EXTRA_ARGS='
+ blink_symbol_level = 0
+ chrome_pgo_phase = 0
+ clang_use_chrome_plugins = false
+ custom_toolchain = "//build/toolchain/linux/unbundle:default"
+ host_toolchain = "//build/toolchain/linux/unbundle:default"
+ icu_use_data_file = false
+ is_component_ffmpeg = false
+ link_pulseaudio = true
+ rtc_pipewire_version = "0.3"
+ rtc_use_pipewire = true
+ treat_warnings_as_errors = false
+ use_custom_libcxx = false
+ use_gnome_keyring = false
+ use_sysroot = false
+ '
+ gn-m87 gen out/Release \
+ --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
+ ninja -C out/Release electron
+ # Strip before zip to avoid
+ # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
+ strip -s out/Release/electron
+ ninja -C out/Release electron_dist_zip
+ # ninja -C out/Release third_party/electron_node:headers
+}
+
+package() {
+ install -dm755 "${pkgdir}/usr/lib/${pkgname}"
+ bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
+
+ chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
+
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+ for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
+ ln -s \
+ "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
+ "${pkgdir}/usr/share/licenses/${pkgname}"
+ done
+
+ install -Dm755 "${srcdir}/electron-launcher.sh" \
+ "${pkgdir}/usr/bin/${pkgname}"
+
+ # Install .desktop and icon file (see default_app-icon.patch)
+ install -Dm644 "electron.desktop" \
+ "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm644 src/electron/default_app/icon.png \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024
+}
Copied: electron12/repos/community-staging-x86_64/add-dependency-on-opus-in-webcodecs.patch (from rev 1186439, electron12/trunk/add-dependency-on-opus-in-webcodecs.patch)
===================================================================
--- community-staging-x86_64/add-dependency-on-opus-in-webcodecs.patch (rev 0)
+++ community-staging-x86_64/add-dependency-on-opus-in-webcodecs.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,43 @@
+From b5b80df7dafba8cafa4c6c0ba2153dfda467dfc9 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Wed, 27 Jan 2021 20:31:51 +0000
+Subject: [PATCH] add dependency on opus in webcodecs
+
+webcodecs uses opus, but dependency is missing. With unbundled
+opus library build fails, because include path is incomplete.
+
+Bug: 1169758
+Change-Id: I01369364327461196a81002479636cf45017669a
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644623
+Reviewed-by: Dale Curtis <dalecurtis at chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#847754}
+---
+ third_party/blink/renderer/modules/webcodecs/BUILD.gn | 1 +
+ third_party/blink/renderer/modules/webcodecs/DEPS | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/third_party/blink/renderer/modules/webcodecs/BUILD.gn b/third_party/blink/renderer/modules/webcodecs/BUILD.gn
+index fdf4ca0fafc72..01a7bf809ffca 100644
+--- a/third_party/blink/renderer/modules/webcodecs/BUILD.gn
++++ b/third_party/blink/renderer/modules/webcodecs/BUILD.gn
+@@ -65,6 +65,7 @@ blink_modules_sources("webcodecs") {
+ "//media/mojo/clients",
+ "//media/mojo/mojom",
+ "//third_party/libyuv:libyuv",
++ "//third_party/opus",
+ ]
+ if (media_use_openh264) {
+ deps += [ "//third_party/openh264:encoder" ]
+diff --git a/third_party/blink/renderer/modules/webcodecs/DEPS b/third_party/blink/renderer/modules/webcodecs/DEPS
+index b8dd596da8caf..ea1919d12205a 100644
+--- a/third_party/blink/renderer/modules/webcodecs/DEPS
++++ b/third_party/blink/renderer/modules/webcodecs/DEPS
+@@ -19,6 +19,7 @@ include_rules = [
+
+ "+third_party/libyuv",
+ "+third_party/openh264",
++ "+third_party/opus",
+
+ "+ui/gfx/color_space.h",
+ "+ui/gfx/geometry/rect.h",
Copied: electron12/repos/community-staging-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch (from rev 1186439, electron12/trunk/breakpad-fix-for-non-constant-SIGSTKSZ.patch)
===================================================================
--- community-staging-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch (rev 0)
+++ community-staging-x86_64/breakpad-fix-for-non-constant-SIGSTKSZ.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,35 @@
+From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure at kdab.com>
+Date: Wed, 15 Dec 2021 22:26:40 +0100
+Subject: [PATCH] Fix for non-constant SIGSTKSZ
+
+On glibc > 2.33, `SIGSTKSZ` might not be constant (in which case
+it expands to a call to `sysconf` which returns a `long int`); see
+https://sourceware.org/pipermail/libc-alpha/2020-October/118513.html
+
+Pass unsigned explicitly to std::max, to avoid relying on template
+argument deduction. This works both with the old-style constant
+`SIGSTKSZ` and the new configurable one.
+
+Initially based on https://chromium-review.googlesource.com/c/2776379
+
+Change-Id: I9fc95337f973e871b84735ce822b5e11ba73ea8c
+Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3340721
+Reviewed-by: Mark Mentovai <mark at chromium.org>
+---
+ src/client/linux/handler/exception_handler.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
+index ca353c40..499be0a9 100644
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
+ // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
+ // the alternative stack. Ensure that the size of the alternative stack is
+ // large enough.
+- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
++ const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ);
+
+ // Only set an alternative stack if there isn't already one, or if the current
+ // one is too small.
Copied: electron12/repos/community-staging-x86_64/chromium-fix-libva-redef.patch (from rev 1186439, electron12/trunk/chromium-fix-libva-redef.patch)
===================================================================
--- community-staging-x86_64/chromium-fix-libva-redef.patch (rev 0)
+++ community-staging-x86_64/chromium-fix-libva-redef.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,86 @@
+--- a/third_party/libva_protected_content/va_protected_content.h
++++ b/third_party/libva_protected_content/va_protected_content.h
+@@ -132,19 +132,6 @@
+ #define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
+ #define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
+
+-/** \brief TeeExec Function Codes. */
+-typedef enum _VA_TEE_EXEC_FUNCTION_ID {
+- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH_NONE = 0x0,
+-
+- // 0x40000000~0x400000FFF reserved for TEE Exec GPU function
+- VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT = 0x40000000,
+- VA_TEE_EXEC_GPU_FUNCID_DECRYPTION_BLT = 0x40000001,
+-
+- // 0x40001000~0x400001FFF reserved for TEE Exec TEE function
+- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH = 0x40001000,
+-
+-} VA_TEE_EXEC_FUNCTION_ID;
+-
+ /** \brief values for the encryption return status. */
+ typedef enum {
+ /** \brief Indicate encryption operation is successful.*/
+@@ -159,63 +146,6 @@
+ VA_ENCRYPTION_STATUS_UNSUPPORT
+ } VAEncryptionStatus;
+
+-/** \brief structure for encrypted segment info. */
+-typedef struct _VAEncryptionSegmentInfo {
+- /** \brief The offset relative to the start of the bitstream input in
+- * bytes of the start of the segment*/
+- uint32_t segment_start_offset;
+- /** \brief The length of the segments in bytes*/
+- uint32_t segment_length;
+- /** \brief The length in bytes of the remainder of an incomplete block
+- * from a previous segment*/
+- uint32_t partial_aes_block_size;
+- /** \brief The length in bytes of the initial clear data */
+- uint32_t init_byte_length;
+- /** \brief This will be AES 128 counter for secure decode and secure
+- * encode when numSegments equals 1 */
+- uint8_t aes_cbc_iv_or_ctr[16];
+- /** \brief Reserved bytes for future use, must be zero */
+- uint32_t va_reserved[VA_PADDING_MEDIUM];
+-} VAEncryptionSegmentInfo;
+-
+-/** \brief encryption parameters, corresponding to
+- * #VAEncryptionParameterBufferType*/
+-typedef struct _VAEncryptionParameters {
+- /** \brief Encryption type, attribute values. */
+- uint32_t encryption_type;
+- /** \brief The number of sengments */
+- uint32_t num_segments;
+- /** \brief Pointer of segments */
+- VAEncryptionSegmentInfo* segment_info;
+- /** \brief The status report index for CENC workload.
+- * The value is to indicate CENC workload and needs to be
+- * different for each CENC workload */
+- uint32_t status_report_index;
+- /** \brief CENC counter length */
+- uint32_t size_of_length;
+- /** \brief Wrapped decrypt blob (Snd)kb */
+- uint8_t wrapped_decrypt_blob[16];
+- /** \brief Wrapped Key blob info (Sne)kb */
+- uint8_t wrapped_encrypt_blob[16];
+- /** \brief Indicates the number of 16-byte BLOCKS that are encrypted in any
+- * given encrypted region of segments.
+- * If this value is zero:
+- * 1. All bytes in encrypted region of segments are encrypted, i.e. the
+- * CENC or CBC1 scheme is being used
+- * 2. blocks_stripe_clear must also be zero.
+- * If this value is non-zero, blocks_stripe_clear must also be non-zero. */
+- uint32_t blocks_stripe_encrypted;
+- /** \brief Indicates the number of 16-byte BLOCKS that are clear in any given
+- * encrypted region of segments, as defined by the CENS and CBCS schemes in
+- * the common encryption spec.
+- * If this value is zero, all bytes in encrypted region of segments are
+- * encrypted, i.e. the CENC or CBC1 scheme is being used.
+- */
+- uint32_t blocks_stripe_clear;
+- /** \brief Reserved bytes for future use, must be zero */
+- uint32_t va_reserved[VA_PADDING_MEDIUM];
+-} VAEncryptionParameters;
+-
+ /** \brief structure for VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT */
+ typedef struct _VA_PROTECTED_BLT_PARAMS {
+ uint8_t* src_resource; // The source resource which contains the clear data.
Copied: electron12/repos/community-staging-x86_64/chromium-glibc-2.33.patch (from rev 1186439, electron12/trunk/chromium-glibc-2.33.patch)
===================================================================
--- community-staging-x86_64/chromium-glibc-2.33.patch (rev 0)
+++ community-staging-x86_64/chromium-glibc-2.33.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,144 @@
+# Patch made by Kevin Kofler <Kevin at tigcc.ticalc.org>
+# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
+
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500
+@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ return RestrictKillTarget(current_pid, sysno);
+ }
+
++#if defined(__NR_newfstatat)
++ if (sysno == __NR_newfstatat) {
++ return RewriteFstatatSIGSYS();
++ }
++#endif
++
++#if defined(__NR_fstatat64)
++ if (sysno == __NR_fstatat64) {
++ return RewriteFstatatSIGSYS();
++ }
++#endif
++
+ if (SyscallSets::IsFileSystem(sysno) ||
+ SyscallSets::IsCurrentDirectory(sysno)) {
+ return Error(fs_denied_errno);
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500
+@@ -6,6 +6,8 @@
+
+ #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+
++#include <errno.h>
++#include <fcntl.h>
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
+@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
+ return -ENOSYS;
+ }
+
++intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++ void* aux) {
++ switch (args.nr) {
++#if defined(__NR_newfstatat)
++ case __NR_newfstatat:
++#endif
++#if defined(__NR_fstatat64)
++ case __NR_fstatat64:
++#endif
++#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
++ if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
++ && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
++ return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
++ reinterpret_cast<struct stat64 *>(args.args[2]));
++ } else {
++ errno = EACCES;
++ return -1;
++ }
++ break;
++#endif
++ }
++
++ CrashSIGSYS_Handler(args, aux);
++
++ // Should never be reached.
++ RAW_CHECK(false);
++ return -ENOSYS;
++}
++
+ bpf_dsl::ResultExpr CrashSIGSYS() {
+ return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
+ }
+@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
+ return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
+ }
+
++bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
++ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
++}
++
+ void AllocateCrashKeys() {
+ #if !defined(OS_NACL_NONSFI)
+ if (seccomp_crash_key)
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500
+@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
+ // sched_setparam(), sched_setscheduler()
+ SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
+ void* aux);
++// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
++// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
++SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++ void* aux);
+
+ // Variants of the above functions for use with bpf_dsl.
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
+@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
++SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
+
+ // Allocates a crash key so that Seccomp information can be recorded.
+ void AllocateCrashKeys();
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500
+@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
+
+ #endif // defined(MEMORY_SANITIZER)
+
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
++{
++#if defined(__NR_fstat64)
++ return syscall(__NR_fstat64, fd, buf);
++#else
++ return syscall(__NR_fstat, fd, buf);
++#endif
++}
++
+ } // namespace sandbox
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500
+@@ -17,6 +17,7 @@ struct sock_fprog;
+ struct rlimit64;
+ struct cap_hdr;
+ struct cap_data;
++struct stat64;
+
+ namespace sandbox {
+
+@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
+ const struct sigaction* act,
+ struct sigaction* oldact);
+
++// Recent glibc rewrites fstat to fstatat.
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
++
+ } // namespace sandbox
+
+ #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_
Copied: electron12/repos/community-staging-x86_64/chromium-harfbuzz-3.0.0.patch (from rev 1186439, electron12/trunk/chromium-harfbuzz-3.0.0.patch)
===================================================================
--- community-staging-x86_64/chromium-harfbuzz-3.0.0.patch (rev 0)
+++ community-staging-x86_64/chromium-harfbuzz-3.0.0.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,20 @@
+# https://github.com/chromium/chromium/commit/b289f6f3fcbc
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 8ff0540d9a..20a7d37474 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
+ hb_set_t* glyphs =
+ hb_subset_input_glyph_set(input.get()); // Owned by |input|.
+ usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
+- hb_subset_input_set_retain_gids(input.get(), true);
++ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
+
+- HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
++ HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
++ if (!subset_face)
++ return nullptr;
+ HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
+ if (!subset_blob)
+ return nullptr;
Copied: electron12/repos/community-staging-x86_64/default_app-icon.patch (from rev 1186439, electron12/trunk/default_app-icon.patch)
===================================================================
--- community-staging-x86_64/default_app-icon.patch (rev 0)
+++ community-staging-x86_64/default_app-icon.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.ts
++++ b/electron/default_app/default_app.ts
+@@ -60,7 +60,7 @@
+ };
+
+ if (process.platform === 'linux') {
+- options.icon = path.join(__dirname, 'icon.png');
++ options.icon = '/usr/share/pixmaps/electron.png';
+ }
+
+ mainWindow = new BrowserWindow(options);
+--- a/electron/filenames.gni
++++ b/electron/filenames.gni
+@@ -6,7 +6,6 @@
+ ]
+
+ default_app_static_sources = [
+- "default_app/icon.png",
+ "default_app/index.html",
+ "default_app/package.json",
+ "default_app/styles.css",
Copied: electron12/repos/community-staging-x86_64/electron-launcher.sh (from rev 1186439, electron12/trunk/electron-launcher.sh)
===================================================================
--- community-staging-x86_64/electron-launcher.sh (rev 0)
+++ community-staging-x86_64/electron-launcher.sh 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,20 @@
+#!/usr/bin/bash
+
+set -euo pipefail
+
+name=electron12
+flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
+
+declare -a flags
+
+if [[ -f "${flags_file}" ]]; then
+ mapfile -t < "${flags_file}"
+fi
+
+for line in "${MAPFILE[@]}"; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ flags+=("${line}")
+ fi
+done
+
+exec /usr/lib/${name}/electron "$@" "${flags[@]}"
Copied: electron12/repos/community-staging-x86_64/electron.desktop (from rev 1186439, electron12/trunk/electron.desktop)
===================================================================
--- community-staging-x86_64/electron.desktop (rev 0)
+++ community-staging-x86_64/electron.desktop 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron 12
+Icon=electron12
+Exec=electron12 %u
+Categories=Development;GTK;
+StartupNotify=true
Copied: electron12/repos/community-staging-x86_64/ffmpeg5.patch (from rev 1186439, electron12/trunk/ffmpeg5.patch)
===================================================================
--- community-staging-x86_64/ffmpeg5.patch (rev 0)
+++ community-staging-x86_64/ffmpeg5.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,142 @@
+diff --git a/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h
+index 2734a485cbd..70b1877a43c 100644
+--- a/media/ffmpeg/ffmpeg_common.h
++++ b/media/ffmpeg/ffmpeg_common.h
+@@ -29,6 +29,7 @@ extern "C" {
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
+ #include <libavutil/avutil.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/imgutils.h>
+ #include <libavutil/log.h>
+ #include <libavutil/mastering_display_metadata.h>
+diff --git a/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc
+index cb81d920def..bd73908d0ca 100644
+--- a/media/filters/audio_file_reader.cc
++++ b/media/filters/audio_file_reader.cc
+@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() {
+ }
+
+ bool AudioFileReader::OpenDecoder() {
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (codec) {
+ // MP3 decodes to S16P which we don't support, tell it to use S16 instead.
+ if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P)
+diff --git a/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc
+index 0d825ed791b..72fac6167ef 100644
+--- a/media/filters/ffmpeg_audio_decoder.cc
++++ b/media/filters/ffmpeg_audio_decoder.cc
+@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) {
+ }
+ }
+
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (!codec ||
+ avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) {
+ DLOG(ERROR) << "Could not initialize audio decoder: "
+diff --git a/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc
+index d34db63f3ef..427565b00c1 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
+
+ // Next try to use the first DTS value, for codecs where we know PTS == DTS
+ // (excludes all H26x codecs). The start time must be returned in PTS.
+- if (stream->first_dts != kNoFFmpegTimestamp &&
++ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
+ stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
+ stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
+ stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
+ const base::TimeDelta first_pts =
+- ConvertFromTimeBase(stream->time_base, stream->first_dts);
++ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
+ if (first_pts < start_time)
+ start_time = first_pts;
+ }
+@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ scoped_refptr<DecoderBuffer> buffer;
+
+ if (type() == DemuxerStream::TEXT) {
+- int id_size = 0;
++ size_t id_size = 0;
+ uint8_t* id_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+
+- int settings_size = 0;
++ size_t settings_size = 0;
+ uint8_t* settings_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+
+@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+ side_data.data(), side_data.size());
+ } else {
+- int side_data_size = 0;
++ size_t side_data_size = 0;
+ uint8_t* side_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+
+@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ packet->size - data_offset);
+ }
+
+- int skip_samples_size = 0;
++ size_t skip_samples_size = 0;
+ const uint32_t* skip_samples_ptr =
+ reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
+diff --git a/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc
+index 0ef3521473d..8483ecc348f 100644
+--- a/media/filters/ffmpeg_glue.cc
++++ b/media/filters/ffmpeg_glue.cc
+@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) {
+ // Enable fast, but inaccurate seeks for MP3.
+ format_context_->flags |= AVFMT_FLAG_FAST_SEEK;
+
+- // Ensures we can read out various metadata bits like vp8 alpha.
+- format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA;
+-
+ // Ensures format parsing errors will bail out. From an audit on 11/2017, all
+ // instances were real failures. Solves bugs like http://crbug.com/710791.
+ format_context_->error_recognition |= AV_EF_EXPLODE;
+diff --git a/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc
+index ef12477ee89..7996606f5f9 100644
+--- a/media/filters/ffmpeg_video_decoder.cc
++++ b/media/filters/ffmpeg_video_decoder.cc
+@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config,
+ if (decode_nalus_)
+ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
+
+- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
+ ReleaseFFmpegResources();
+ return false;
+diff --git a/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc
+index 59c2a2fc618..1a9872c7acb 100644
+--- a/media/filters/media_file_checker.cc
++++ b/media/filters/media_file_checker.cc
+@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
+ auto context = AVStreamToAVCodecContext(format_context->streams[i]);
+ if (!context)
+ continue;
+- AVCodec* codec = avcodec_find_decoder(cp->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(cp->codec_id);
+ if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) {
+ auto loop = std::make_unique<FFmpegDecodingLoop>(context.get());
+ stream_contexts[i] = {std::move(context), std::move(loop)};
+diff --git a/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+index 9002b874611..d12fade8b63 100644
+--- a/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
++++ b/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
+@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
+ // a pointer |this|.
+ av_context_->opaque = this;
+
+- AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
++ const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id);
+ if (!codec) {
+ // This is an indication that FFmpeg has not been initialized or it has not
+ // been compiled/initialized with the correct set of codecs.
Copied: electron12/repos/community-staging-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch (from rev 1186439, electron12/trunk/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch)
===================================================================
--- community-staging-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch (rev 0)
+++ community-staging-x86_64/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,39 @@
+From 28ac6a15411d01301e171b8a8b0019abd57589b9 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Mon, 7 Feb 2022 20:09:57 +0000
+Subject: [PATCH] sandbox: build if glibc 2.34+ dynamic stack size is enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compilation of sandbox fails when using dynamic stack size in glibc
+2.34 or newer. This is because the value is not a literal anymore but
+obtained through sysconf.
+
+To avoid this, use memset to put zeros in the buffer.
+
+Change-Id: Ia479e0f799b77a10a00197aaaa0500e62546f458
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3436947
+Reviewed-by: Jorge Lucangeli Obes <jorgelo at chromium.org>
+Commit-Queue: José Dapena Paz <jdapena at igalia.com>
+Cr-Commit-Position: refs/heads/main@{#967943}
+---
+ sandbox/linux/services/credentials.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
+index ca6b5954798..c933eafd163 100644
+--- a/sandbox/linux/services/credentials.cc
++++ b/sandbox/linux/services/credentials.cc
+@@ -100,7 +100,10 @@ bool ChrootToSafeEmptyDir() {
+ // TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f.
+ clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
+
+- char tls_buf[PTHREAD_STACK_MIN] = {0};
++ // PTHREAD_STACK_MIN can be dynamic in glibc2.34+, so it is not possible to
++ // zeroify tls_buf assigning { 0 }
++ char tls_buf[PTHREAD_STACK_MIN];
++ memset(tls_buf, 0, PTHREAD_STACK_MIN);
+ tls = tls_buf;
+ #endif
+
Copied: electron12/repos/community-staging-x86_64/skia-harfbuzz-3.0.0.patch (from rev 1186439, electron12/trunk/skia-harfbuzz-3.0.0.patch)
===================================================================
--- community-staging-x86_64/skia-harfbuzz-3.0.0.patch (rev 0)
+++ community-staging-x86_64/skia-harfbuzz-3.0.0.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,100 @@
+# Minimal diff for harfbuzz 3.0.0 support; based on:
+# https://github.com/google/skia/commit/66684b17b382
+# https://github.com/google/skia/commit/51d83abcd24a
+
+diff --git a/gn/skia.gni b/gn/skia.gni
+index d98fdc19ee..199335d5c4 100644
+--- a/gn/skia.gni
++++ b/gn/skia.gni
+@@ -34,8 +34,6 @@ declare_args() {
+ skia_include_multiframe_procs = false
+ skia_lex = false
+ skia_libgifcodec_path = "third_party/externals/libgifcodec"
+- skia_pdf_subset_harfbuzz =
+- false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
+ skia_qt_path = getenv("QT_PATH")
+ skia_skqp_global_error_tolerance = 0
+ skia_tools_require_resources = false
+@@ -99,6 +97,10 @@ declare_args() {
+ skia_use_libfuzzer_defaults = true
+ }
+
++declare_args() {
++ skia_pdf_subset_harfbuzz = skia_use_harfbuzz
++}
++
+ declare_args() {
+ skia_compile_sksl_tests = skia_compile_processors
+ skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
+diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
+index 81c37eef3a..2340a7937b 100644
+--- a/src/pdf/SkPDFSubsetFont.cpp
++++ b/src/pdf/SkPDFSubsetFont.cpp
+@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
+ blob.release());
+ }
+
++template<typename...> using void_t = void;
++template<typename T, typename = void>
++struct SkPDFHarfBuzzSubset {
++ // This is the HarfBuzz 3.0 interface.
++ // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of
++ // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
++ static HBFace Make(T input, hb_face_t* face) {
++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++ // If it isn't known if a font is 'tricky', retain the hints.
++ hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
++ return HBFace(hb_subset_or_fail(face, input));
++ }
++};
++template<typename T>
++struct SkPDFHarfBuzzSubset<T, void_t<
++ decltype(hb_subset_input_set_retain_gids(std::declval<T>(), std::declval<bool>())),
++ decltype(hb_subset_input_set_drop_hints(std::declval<T>(), std::declval<bool>())),
++ decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
++ >>
++{
++ // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
++ // This code should be removed as soon as all users are migrated to the newer API.
++ static HBFace Make(T input, hb_face_t* face) {
++ hb_subset_input_set_retain_gids(input, true);
++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++ // If it isn't known if a font is 'tricky', retain the hints.
++ hb_subset_input_set_drop_hints(input, false);
++ return HBFace(hb_subset(face, input));
++ }
++};
++
+ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+ const SkPDFGlyphUse& glyphUsage,
+ int ttcIndex) {
+@@ -71,11 +102,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+ hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
+ glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});
+
+- hb_subset_input_set_retain_gids(input.get(), true);
+- // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+- // If it isn't known if a font is 'tricky', retain the hints.
+- hb_subset_input_set_drop_hints(input.get(), false);
+- HBFace subset(hb_subset(face.get(), input.get()));
++ HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), face.get());
++ if (!subset) {
++ return nullptr;
++ }
+ HBBlob result(hb_face_reference_blob(subset.get()));
+ return to_data(std::move(result));
+ }
+diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
+index 173830de62..4156607ef9 100644
+--- a/third_party/harfbuzz/BUILD.gn
++++ b/third_party/harfbuzz/BUILD.gn
+@@ -14,6 +14,9 @@ if (skia_use_system_harfbuzz) {
+ "harfbuzz",
+ "harfbuzz-icu",
+ ]
++ if (skia_pdf_subset_harfbuzz) {
++ libs += [ "harfbuzz-subset" ]
++ }
+ }
+ } else {
+ third_party("harfbuzz") {
Copied: electron12/repos/community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (from rev 1186439, electron12/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
===================================================================
--- community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (rev 0)
+++ community-staging-x86_64/sql-make-VirtualCursor-standard-layout-type.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,238 @@
+From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Tue, 4 May 2021 15:00:19 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
+raw pointers.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc | 21 +++++++++++++++------
+ sql/recover_module/btree.h | 17 +++++++++++++----
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h | 2 +-
+ sql/recover_module/pager.cc | 7 +++----
+ sql/recover_module/pager.h | 5 +++--
+ 6 files changed, 47 insertions(+), 29 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index 9ecaafe8a3..839318abf9 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
+ "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 d76d076bf6..33114b01fa 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -102,7 +102,7 @@ class LeafPageDecoder {
+ //
+ // |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 @@ class LeafPageDecoder {
+ // 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 @@ class LeafPageDecoder {
+ 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 0029ff9295..42548bc4b5 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
+ 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 @@ int VirtualCursor::Next() {
+ 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 @@ int VirtualCursor::ReadColumn(int column_index,
+ 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 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
+ 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 afcd6900e1..b15c31d425 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -129,7 +129,7 @@ class VirtualCursor {
+ 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 58e75de270..5fe96204e5 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
+ "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 @@ int DatabasePageReader::ReadPage(int page_id) {
+ 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 0e388ddc3b..99314e30ff 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 @@ class DatabasePageReader {
+ 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 @@ class DatabasePageReader {
+ 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_;
Copied: electron12/repos/community-staging-x86_64/std-max-fix.patch (from rev 1186439, electron12/trunk/std-max-fix.patch)
===================================================================
--- community-staging-x86_64/std-max-fix.patch (rev 0)
+++ community-staging-x86_64/std-max-fix.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,11 @@
+--- a/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
++++ b/third_party/abseil-cpp/absl/debugging/failure_signal_handler.cc
+@@ -136,7 +136,7 @@
+ #else
+ const size_t page_mask = sysconf(_SC_PAGESIZE) - 1;
+ #endif
+- size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
++ size_t stack_size = (std::max<unsigned>(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
+ #if defined(ABSL_HAVE_ADDRESS_SANITIZER) || \
+ defined(ABSL_HAVE_MEMORY_SANITIZER) || defined(ABSL_HAVE_THREAD_SANITIZER)
+ // Account for sanitizer instrumentation requiring additional stack space.
Copied: electron12/repos/community-staging-x86_64/use-system-libraries-in-node.patch (from rev 1186439, electron12/trunk/use-system-libraries-in-node.patch)
===================================================================
--- community-staging-x86_64/use-system-libraries-in-node.patch (rev 0)
+++ community-staging-x86_64/use-system-libraries-in-node.patch 2022-04-15 03:44:07 UTC (rev 1186440)
@@ -0,0 +1,52 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+ node_module_version = ""
+ }
+
++if (is_linux) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("cares") {
++ packages = [ "libcares" ]
++ }
++
++ pkg_config("nghttp2") {
++ packages = [ "libnghttp2" ]
++ }
++}
++
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+ assert(!node_use_etw, "node_use_etw not supported in GN")
+
+@@ -190,10 +202,8 @@
+ component("node_lib") {
+ deps = [
+ ":node_js2c",
+- "deps/cares",
+ "deps/histogram",
+ "deps/llhttp",
+- "deps/nghttp2",
+ "deps/uvwasi",
+ "//third_party/zlib",
+ "//third_party/brotli:dec",
+@@ -209,6 +219,19 @@
+ public_configs = [ ":node_lib_config" ]
+ include_dirs = [ "src" ]
+ libs = []
++ if (is_linux) {
++ configs += [
++ ":cares",
++ ":nghttp2",
++ ]
++ libs += [ "http_parser" ]
++ } else {
++ deps += [
++ "deps/cares",
++ "deps/http_parser",
++ "deps/nghttp2",
++ ]
++ }
+ frameworks = []
+ cflags_cc = [
+ "-Wno-deprecated-declarations",
More information about the arch-commits
mailing list