diff options
author | Antonio Rojas | 2022-04-22 10:25:13 +0200 |
---|---|---|
committer | Antonio Rojas | 2022-04-22 10:25:13 +0200 |
commit | 5e543d5e15fd235fafc12b48eafba6908fd2a5fc (patch) | |
tree | 372f6705df0eec92f53d0b6daf41f0fc021e5152 | |
parent | aa1e4016c27b08a8661a53cb28841cf7e31118df (diff) | |
download | aur-electron9.tar.gz |
import from community
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | PKGBUILD | 56 | ||||
-rw-r--r-- | breakpad-fix-for-non-constant-SIGSTKSZ.patch | 35 | ||||
-rw-r--r-- | chromium-harfbuzz-3.0.0.patch | 20 | ||||
-rw-r--r-- | chromium-include-limits.patch | 31 | ||||
-rw-r--r-- | disk_data_allocator-Metadata-constructor.patch | 18 | ||||
-rw-r--r-- | ffmpeg5.patch | 142 | ||||
-rw-r--r-- | sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch | 39 | ||||
-rw-r--r-- | skia-harfbuzz-3.0.0.patch | 99 | ||||
-rw-r--r-- | sql-make-VirtualCursor-standard-layout-type.patch | 238 | ||||
-rw-r--r-- | std-max-fix.patch | 11 | ||||
-rw-r--r-- | v8-call-new-ListFormatter-createInstance.patch | 95 |
12 files changed, 804 insertions, 9 deletions
@@ -1,7 +1,7 @@ pkgbase = electron9 pkgdesc = Build cross platform desktop apps with web technologies pkgver = 9.4.4 - pkgrel = 2 + pkgrel = 6 url = https://electronjs.org/ arch = x86_64 license = MIT @@ -21,6 +21,10 @@ pkgbase = electron9 makedepends = pciutils makedepends = yarn makedepends = python2 + makedepends = python + makedepends = python-httplib2 + makedepends = python-pyparsing + makedepends = python-six makedepends = wget makedepends = yasm depends = c-ares @@ -28,6 +32,7 @@ pkgbase = electron9 depends = gtk3 depends = http-parser depends = libevent + depends = libnghttp2 depends = libxslt depends = libxss depends = minizip @@ -38,6 +43,7 @@ pkgbase = electron9 optdepends = libappindicator-gtk3: StatusNotifierItem support optdepends = trash-cli: file deletion support (trash-put) optdepends = xdg-utils: open URLs with desktop's default (xdg-email, xdg-open) + options = !lto source = git+https://github.com/electron/electron.git source = git+https://chromium.googlesource.com/chromium/tools/depot_tools.git source = electron9.desktop @@ -45,15 +51,25 @@ pkgbase = electron9 source = use-system-libraries-in-node.patch source = add-missing-algorithm-header-in-crx_install_error.cc.patch source = avoid-double-destruction-of-ServiceWorkerObjectHost.patch + source = breakpad-fix-for-non-constant-SIGSTKSZ.patch source = chromium-83-gcc-10.patch source = chromium-ffmpeg-4.3.patch source = qt5-webengine-glibc-2.33.patch + source = chromium-harfbuzz-3.0.0.patch + source = skia-harfbuzz-3.0.0.patch + source = chromium-include-limits.patch source = chromium-skia-harmony.patch + source = sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch + source = sql-make-VirtualCursor-standard-layout-type.patch + source = std-max-fix.patch + source = ffmpeg5.patch + source = disk_data_allocator-Metadata-constructor.patch source = clean-up-a-call-to-set_utf8.patch source = include-memory-header-to-get-the-definition-of-std-u.patch source = iwyu-std-numeric_limits-is-defined-in-limits.patch source = libstdc-fix-incomplete-type-in-AXTree-for-NodeSetSiz.patch source = make-some-of-blink-custom-iterators-STL-compatible.patch + source = v8-call-new-ListFormatter-createInstance.patch source = v8-remove-soon-to-be-removed-getAllFieldPositions.patch sha256sums = SKIP sha256sums = SKIP @@ -62,16 +78,25 @@ pkgbase = electron9 sha256sums = c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a sha256sums = 0e2a78e4aa7272ab0ff4a4c467750e01bad692a026ad9828aaf06d2a9418b9d8 sha256sums = d793842e9584bf75e3779918297ba0ffa6dd05394ef5b2bf5fb73aa9c86a7e2f + sha256sums = b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf sha256sums = 3e5ba8c0a70a4bc673deec0c61eb2b58f05a4c784cbdb7c8118be1eb6580db6d sha256sums = 5390304b5f544868985ce00a3ec082d4ece2dacb1c73cdb35dd4facfea12449a sha256sums = 5600cfa40254fa3fa2cb541d3b55cc8f7a9231de8d2830c25a7651aa392de16f + sha256sums = 7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928 + sha256sums = fffbdd7479292462a1b4e3846c610ee5a0f0d409ded11426f21dd47051604dfd + sha256sums = cb8e4c347169f145d2f08329e25125eb2a3682bfc3530c674cf1ffad89431bdf sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1 + sha256sums = f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61 + sha256sums = dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150 + sha256sums = c315dd56b354cf5ad3458e1edf397cc7b492fefe82138135a881206a82b9d9dc + sha256sums = 4f32b815349357ef1f17b36059cee588c994472b9754a194fff41ec21a93826b + sha256sums = 52a63a84a10dc501a0712a76170cfa12abc02ed4efe93486a1e6139b1670f90c sha256sums = 58c41713eb6fb33b6eef120f4324fa1fb8123b1fbc4ecbe5662f1f9779b9b6af sha256sums = 071326135bc25226aa165639dff80a03670a17548f2d2ff5cc4f40982b39c52a sha256sums = 675fb3d6276cce569a641436465f58d5709d1d4a5f62b7052989479fd4aaea24 sha256sums = 50687079426094f2056d1f4806dc30fc8d6bad16190520e57ba087ec5db1d778 sha256sums = 3d7f20e1d2ee7d73ed25e708c0d59a0cb215fcce10a379e3d48a856533c4b0b7 + sha256sums = 44ebcff050a1c849819d66399c14bd711801d0eb64f518d292d3d6efedce3b3a sha256sums = e042024423027ad3ef729a7e4709bdf9714aea49d64cfbbf46a645a05703abc2 pkgname = electron9 - @@ -1,23 +1,25 @@ -# Contributor: Nicola Squartini <tensor5@gmail.com> +# Maintainer: Nicola Squartini <tensor5@gmail.com> pkgname=electron9 pkgver=9.4.4 _commit=f981f3a7c41767fa5ec13cbc8e2242129db96e7a _chromiumver=83.0.4103.122 -pkgrel=2 +pkgrel=6 pkgdesc='Build cross platform desktop apps with web technologies' arch=('x86_64') url='https://electronjs.org/' license=('MIT' 'custom') -depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libxslt' 'libxss' - 'minizip' 'nss' 're2' 'snappy') +depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libnghttp2' + 'libxslt' 'libxss' 'minizip' 'nss' 're2' 'snappy') makedepends=('clang' 'git' 'gn-m85' 'gperf' 'harfbuzz-icu' 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'yarn' - 'python2' 'wget' 'yasm') + 'python2' 'python' 'python-httplib2' 'python-pyparsing' 'python-six' + 'wget' 'yasm') optdepends=('kde-cli-tools: file deletion support (kioclient5)' 'libappindicator-gtk3: StatusNotifierItem support' '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' 'electron9.desktop' @@ -25,15 +27,25 @@ source=('git+https://github.com/electron/electron.git' 'use-system-libraries-in-node.patch' 'add-missing-algorithm-header-in-crx_install_error.cc.patch' 'avoid-double-destruction-of-ServiceWorkerObjectHost.patch' + 'breakpad-fix-for-non-constant-SIGSTKSZ.patch' 'chromium-83-gcc-10.patch' 'chromium-ffmpeg-4.3.patch' 'qt5-webengine-glibc-2.33.patch' + 'chromium-harfbuzz-3.0.0.patch' + 'skia-harfbuzz-3.0.0.patch' + 'chromium-include-limits.patch' 'chromium-skia-harmony.patch' + 'sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch' + 'sql-make-VirtualCursor-standard-layout-type.patch' + 'std-max-fix.patch' + 'ffmpeg5.patch' + 'disk_data_allocator-Metadata-constructor.patch' 'clean-up-a-call-to-set_utf8.patch' 'include-memory-header-to-get-the-definition-of-std-u.patch' 'iwyu-std-numeric_limits-is-defined-in-limits.patch' 'libstdc-fix-incomplete-type-in-AXTree-for-NodeSetSiz.patch' 'make-some-of-blink-custom-iterators-STL-compatible.patch' + 'v8-call-new-ListFormatter-createInstance.patch' 'v8-remove-soon-to-be-removed-getAllFieldPositions.patch' ) sha256sums=('SKIP' @@ -43,16 +55,27 @@ sha256sums=('SKIP' 'c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a' '0e2a78e4aa7272ab0ff4a4c467750e01bad692a026ad9828aaf06d2a9418b9d8' 'd793842e9584bf75e3779918297ba0ffa6dd05394ef5b2bf5fb73aa9c86a7e2f' + 'b4d28867c1fabde6c50a2cfa3f784730446c4d86e5191e0f0000fbf7b0f91ecf' '3e5ba8c0a70a4bc673deec0c61eb2b58f05a4c784cbdb7c8118be1eb6580db6d' '5390304b5f544868985ce00a3ec082d4ece2dacb1c73cdb35dd4facfea12449a' '5600cfa40254fa3fa2cb541d3b55cc8f7a9231de8d2830c25a7651aa392de16f' + '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928' + 'fffbdd7479292462a1b4e3846c610ee5a0f0d409ded11426f21dd47051604dfd' + 'cb8e4c347169f145d2f08329e25125eb2a3682bfc3530c674cf1ffad89431bdf' '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1' + 'f910be9370c880de6e1d61cc30383c069e421d7acf406166e4fbfad324fc7d61' + 'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150' + 'c315dd56b354cf5ad3458e1edf397cc7b492fefe82138135a881206a82b9d9dc' + '4f32b815349357ef1f17b36059cee588c994472b9754a194fff41ec21a93826b' + '52a63a84a10dc501a0712a76170cfa12abc02ed4efe93486a1e6139b1670f90c' '58c41713eb6fb33b6eef120f4324fa1fb8123b1fbc4ecbe5662f1f9779b9b6af' '071326135bc25226aa165639dff80a03670a17548f2d2ff5cc4f40982b39c52a' '675fb3d6276cce569a641436465f58d5709d1d4a5f62b7052989479fd4aaea24' '50687079426094f2056d1f4806dc30fc8d6bad16190520e57ba087ec5db1d778' '3d7f20e1d2ee7d73ed25e708c0d59a0cb215fcce10a379e3d48a856533c4b0b7' - 'e042024423027ad3ef729a7e4709bdf9714aea49d64cfbbf46a645a05703abc2') + '44ebcff050a1c849819d66399c14bd711801d0eb64f518d292d3d6efedce3b3a' + 'e042024423027ad3ef729a7e4709bdf9714aea49d64cfbbf46a645a05703abc2' + ) _system_libs=('ffmpeg' 'flac' @@ -98,7 +121,7 @@ prepare() { }, ]" > .gclient - python2 "${srcdir}/depot_tools/gclient.py" sync \ + python3 "${srcdir}/depot_tools/gclient.py" sync \ --with_branch_heads \ --with_tags \ --nohooks @@ -133,17 +156,28 @@ prepare() { cd .. echo "Applying local patches..." + + patch -Np1 -d third_party/breakpad/breakpad < ../breakpad-fix-for-non-constant-SIGSTKSZ.patch + patch -Np1 -i ../ffmpeg5.patch patch -Np1 -i ../add-missing-algorithm-header-in-crx_install_error.cc.patch patch -Np1 -i ../avoid-double-destruction-of-ServiceWorkerObjectHost.patch patch -Np1 -i ../chromium-83-gcc-10.patch patch -Np1 -i ../chromium-ffmpeg-4.3.patch + patch -Np1 -i ../chromium-include-limits.patch patch -Np0 -i ../chromium-skia-harmony.patch + patch -Np1 -i ../sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch + patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch + patch -Np1 -F3 -i ../std-max-fix.patch + patch -Np0 -i ../disk_data_allocator-Metadata-constructor.patch patch -Np4 -i ../qt5-webengine-glibc-2.33.patch + patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch + patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch patch -Np1 -i ../clean-up-a-call-to-set_utf8.patch patch -Np1 -i ../include-memory-header-to-get-the-definition-of-std-u.patch patch -Np1 -F3 -i ../iwyu-std-numeric_limits-is-defined-in-limits.patch patch -Np1 -i ../libstdc-fix-incomplete-type-in-AXTree-for-NodeSetSiz.patch patch -Np1 -i ../make-some-of-blink-custom-iterators-STL-compatible.patch + patch -Np1 -d v8 <../v8-call-new-ListFormatter-createInstance.patch patch -Np1 -d v8 <../v8-remove-soon-to-be-removed-getAllFieldPositions.patch patch -Np1 -i ../use-system-libraries-in-node.patch patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file @@ -178,6 +212,14 @@ build() { # Workaround for building with ICU 68.x CPPFLAGS+=' -DU_DEFINE_FALSE_AND_TRUE=1' + 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' diff --git a/breakpad-fix-for-non-constant-SIGSTKSZ.patch b/breakpad-fix-for-non-constant-SIGSTKSZ.patch new file mode 100644 index 000000000000..1bb121693146 --- /dev/null +++ b/breakpad-fix-for-non-constant-SIGSTKSZ.patch @@ -0,0 +1,35 @@ +From 605c51ed96ad44b34c457bbca320e74e194c317e Mon Sep 17 00:00:00 2001 +From: David Faure <david.faure@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@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. diff --git a/chromium-harfbuzz-3.0.0.patch b/chromium-harfbuzz-3.0.0.patch new file mode 100644 index 000000000000..c7724336bfba --- /dev/null +++ b/chromium-harfbuzz-3.0.0.patch @@ -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; diff --git a/chromium-include-limits.patch b/chromium-include-limits.patch new file mode 100644 index 000000000000..b1ea2c157f29 --- /dev/null +++ b/chromium-include-limits.patch @@ -0,0 +1,31 @@ +--- a/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc ++++ b/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc +@@ -37,6 +37,7 @@ + + #include <algorithm> + #include <array> ++#include <limits> + #include "absl/base/internal/hide_ptr.h" + #include "absl/base/internal/raw_logging.h" + #include "absl/base/internal/spinlock.h" +--- a/third_party/angle/src/libANGLE/HandleAllocator.cpp ++++ b/third_party/angle/src/libANGLE/HandleAllocator.cpp +@@ -11,6 +11,7 @@ + + #include <algorithm> + #include <functional> ++#include <limits> + + #include "common/debug.h" + +--- a/third_party/perfetto/src/trace_processor/containers/string_pool.h ++++ b/third_party/perfetto/src/trace_processor/containers/string_pool.h +@@ -17,6 +17,8 @@ + #ifndef SRC_TRACE_PROCESSOR_CONTAINERS_STRING_POOL_H_ + #define SRC_TRACE_PROCESSOR_CONTAINERS_STRING_POOL_H_ + ++#include <limits> ++ + #include <stddef.h> + #include <stdint.h> + diff --git a/disk_data_allocator-Metadata-constructor.patch b/disk_data_allocator-Metadata-constructor.patch new file mode 100644 index 000000000000..b5f03aa23e72 --- /dev/null +++ b/disk_data_allocator-Metadata-constructor.patch @@ -0,0 +1,18 @@ +# Modeled after https://github.com/chromium/chromium/commit/d62de64e2fd2 + +--- third_party/blink/renderer/platform/disk_data_allocator.h.orig 2021-09-18 15:20:46.550131515 +0000 ++++ third_party/blink/renderer/platform/disk_data_allocator.h 2021-09-18 15:21:20.868676978 +0000 +@@ -36,12 +36,12 @@ class PLATFORM_EXPORT DiskDataAllocator + public: + int64_t start_offset() const { return start_offset_; } + size_t size() const { return size_; } +- Metadata(Metadata&& other) = delete; + + private: + Metadata(int64_t start_offset, size_t size) + : start_offset_(start_offset), size_(size) {} + Metadata(const Metadata& other) = default; ++ Metadata(Metadata&& other) = default; + Metadata& operator=(const Metadata& other) = default; + + int64_t start_offset_; diff --git a/ffmpeg5.patch b/ffmpeg5.patch new file mode 100644 index 000000000000..c8bad53a4769 --- /dev/null +++ b/ffmpeg5.patch @@ -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. diff --git a/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch b/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch new file mode 100644 index 000000000000..2b4391fdeb50 --- /dev/null +++ b/sandbox-build-if-glibc-2.34-dynamic-stack-size-is-en.patch @@ -0,0 +1,39 @@ +From 28ac6a15411d01301e171b8a8b0019abd57589b9 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann <stha09@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@chromium.org> +Commit-Queue: José Dapena Paz <jdapena@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 + diff --git a/skia-harfbuzz-3.0.0.patch b/skia-harfbuzz-3.0.0.patch new file mode 100644 index 000000000000..a57b45bda1b1 --- /dev/null +++ b/skia-harfbuzz-3.0.0.patch @@ -0,0 +1,99 @@ +# 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,7 +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") { diff --git a/sql-make-VirtualCursor-standard-layout-type.patch b/sql-make-VirtualCursor-standard-layout-type.patch new file mode 100644 index 000000000000..c1c68f11646a --- /dev/null +++ b/sql-make-VirtualCursor-standard-layout-type.patch @@ -0,0 +1,238 @@ +From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann <stha09@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_; diff --git a/std-max-fix.patch b/std-max-fix.patch new file mode 100644 index 000000000000..af8d30ac5753 --- /dev/null +++ b/std-max-fix.patch @@ -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. diff --git a/v8-call-new-ListFormatter-createInstance.patch b/v8-call-new-ListFormatter-createInstance.patch new file mode 100644 index 000000000000..1a35030c7739 --- /dev/null +++ b/v8-call-new-ListFormatter-createInstance.patch @@ -0,0 +1,95 @@ +From 035c305ce7761f51328b45f1bd83e26aef267c9d Mon Sep 17 00:00:00 2001 +From: Frank Tang <ftang@chromium.org> +Date: Thu, 15 Oct 2020 22:44:27 -0700 +Subject: [PATCH] [Intl] call new ListFormatter::createInstance + +The one we currently using is now marked as internal and to be removed +for 68. Migrating to the style which already avaiable in ICU 67-1. + +Bug: v8:11031 +Change-Id: I668382a2e1b8602ddca02bf231c5008a6c92bf2d +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477751 +Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> +Commit-Queue: Frank Tang <ftang@chromium.org> +Cr-Commit-Position: refs/heads/master@{#70638} +--- + src/objects/js-list-format.cc | 55 ++++++++++++----------------------- + 1 file changed, 18 insertions(+), 37 deletions(-) + +diff --git a/src/objects/js-list-format.cc b/src/objects/js-list-format.cc +index b17d38c43ff5..e48a387be50f 100644 +--- a/src/objects/js-list-format.cc ++++ b/src/objects/js-list-format.cc +@@ -29,46 +29,27 @@ namespace v8 { + namespace internal { + + namespace { +-const char* kStandard = "standard"; +-const char* kOr = "or"; +-const char* kUnit = "unit"; +-const char* kStandardShort = "standard-short"; +-const char* kOrShort = "or-short"; +-const char* kUnitShort = "unit-short"; +-const char* kStandardNarrow = "standard-narrow"; +-const char* kOrNarrow = "or-narrow"; +-const char* kUnitNarrow = "unit-narrow"; +- +-const char* GetIcuStyleString(JSListFormat::Style style, +- JSListFormat::Type type) { ++ ++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) { ++ switch (style) { ++ case JSListFormat::Style::LONG: ++ return ULISTFMT_WIDTH_WIDE; ++ case JSListFormat::Style::SHORT: ++ return ULISTFMT_WIDTH_SHORT; ++ case JSListFormat::Style::NARROW: ++ return ULISTFMT_WIDTH_NARROW; ++ } ++ UNREACHABLE(); ++} ++ ++UListFormatterType GetIcuType(JSListFormat::Type type) { + switch (type) { + case JSListFormat::Type::CONJUNCTION: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kStandard; +- case JSListFormat::Style::SHORT: +- return kStandardShort; +- case JSListFormat::Style::NARROW: +- return kStandardNarrow; +- } ++ return ULISTFMT_TYPE_AND; + case JSListFormat::Type::DISJUNCTION: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kOr; +- case JSListFormat::Style::SHORT: +- return kOrShort; +- case JSListFormat::Style::NARROW: +- return kOrNarrow; +- } ++ return ULISTFMT_TYPE_OR; + case JSListFormat::Type::UNIT: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kUnit; +- case JSListFormat::Style::SHORT: +- return kUnitShort; +- case JSListFormat::Style::NARROW: +- return kUnitNarrow; +- } ++ return ULISTFMT_TYPE_UNITS; + } + UNREACHABLE(); + } +@@ -143,7 +124,7 @@ MaybeHandle<JSListFormat> JSListFormat::New(Isolate* isolate, Handle<Map> map, + icu::Locale icu_locale = r.icu_locale; + UErrorCode status = U_ZERO_ERROR; + icu::ListFormatter* formatter = icu::ListFormatter::createInstance( +- icu_locale, GetIcuStyleString(style_enum, type_enum), status); ++ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status); + if (U_FAILURE(status) || formatter == nullptr) { + delete formatter; + THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError), |