aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-04-24 09:02:25 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2020-04-24 11:12:29 +0200
commit739fadc78ad34b35354f0dc51861f882dd8c15e1 (patch)
tree14a67b85b3f9474b6f2d8b255768762a17d839d0
parent2a1fee1509c42c049572b05368d8bf67e8e126ab (diff)
downloadaports-739fadc78ad34b35354f0dc51861f882dd8c15e1.tar.bz2
aports-739fadc78ad34b35354f0dc51861f882dd8c15e1.tar.xz
community/chromium: security upgrade to 80.0.3987.149
CVE-2020-6422: Use after free in WebGL. CVE-2020-6424: Use after free in media. CVE-2020-6425: Insufficient policy enforcement in extensions. CVE-2020-6426: Inappropriate implementation in V8. CVE-2020-6427: Use after free in audio. CVE-2020-6428: Use after free in audio. CVE-2020-6429: Use after free in audio. CVE-2019-20503: Out of bounds read in usersctplib. fixes #11401
-rw-r--r--community/chromium/APKBUILD115
-rw-r--r--community/chromium/aarch64-fixes.patch2
-rw-r--r--community/chromium/chromium-system-harfbuzz.patch19
-rw-r--r--community/chromium/chromium-use-alpine-target.patch25
-rw-r--r--community/chromium/create-extra-view-redefinition.patch6
-rw-r--r--community/chromium/default-pthread-stacksize.patch19
-rw-r--r--community/chromium/elf-arm.patch4
-rw-r--r--community/chromium/gcc-arm.patch4
-rw-r--r--community/chromium/gcc-fno-delete-null-pointer-checks.patch10
-rw-r--r--community/chromium/gn_bootstrap_ninja.patch32
-rw-r--r--community/chromium/llvm-remove-unsupported-compiler-warnings.patch26
-rw-r--r--community/chromium/media-base.patch4
-rw-r--r--community/chromium/musl-arm-limits.patch12
-rw-r--r--community/chromium/musl-crashpad.patch4
-rw-r--r--community/chromium/musl-fixes-breakpad.patch29
-rw-r--r--community/chromium/musl-fixes.patch93
-rw-r--r--community/chromium/musl-hacks.patch24
-rw-r--r--community/chromium/musl-libc++.patch16
-rw-r--r--community/chromium/musl-sandbox.patch60
-rw-r--r--community/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch6
-rw-r--r--community/chromium/nasm.patch2
-rw-r--r--community/chromium/no-execinfo.patch28
-rw-r--r--community/chromium/no-mallinfo.patch12
-rw-r--r--community/chromium/resolver.patch14
-rw-r--r--community/chromium/swiftshader.patch18
-rw-r--r--community/chromium/upstream-cros-search-service-Include-cmath-for-std-pow.patch35
-rw-r--r--community/chromium/upstream-fix-building-with-unbundled-libxml.patch127
-rw-r--r--community/chromium/upstream-move-RemoteTreeNode-declaration.patch237
-rw-r--r--community/chromium/upstream-rebuild-Linux-frame-button-cache-when-activation.patch62
-rw-r--r--community/chromium/upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch64
-rw-r--r--community/chromium/upstream-sync-enable-USSPasswords-by-default.patch28
31 files changed, 809 insertions, 328 deletions
diff --git a/community/chromium/APKBUILD b/community/chromium/APKBUILD
index 01aca9ee2a..ecf0ae186e 100644
--- a/community/chromium/APKBUILD
+++ b/community/chromium/APKBUILD
@@ -1,15 +1,14 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=chromium
-pkgver=79.0.3945.130
+pkgver=80.0.3987.149
pkgrel=0
-pkgdesc="chromium web browser"
-url="http://www.chromium.org/"
+pkgdesc="Chromium web browser"
+url="https://www.chromium.org/Home"
arch="x86_64 aarch64 armv7"
-license="BSD"
+license="BSD-3-Clause"
depends="xdg-utils"
-depends_dev=""
-makedepends="$depends_dev
+makedepends="
alsa-lib-dev
bash
binutils-gold
@@ -54,10 +53,8 @@ makedepends="$depends_dev
libxrandr-dev
libxscrnsaver-dev
libxslt-dev
- libxtst-dev
linux-headers
mesa-dev
- mesa-dev
minizip-dev
ninja
nodejs
@@ -76,18 +73,24 @@ makedepends="$depends_dev
yasm
zlib-dev
"
-install=""
# explicit depends for --headless
depends="eudev-libs ttf-opensans"
-options=suid
+options="suid"
subpackages="$pkgname-chromedriver"
-source="https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
+source="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
pstables-2.8.h::https://git.savannah.gnu.org/cgit/freetype/freetype2.git/plain/src/psnames/pstables.h?h=VER-2-8
chromium-launcher.sh
chromium.conf
chromium.desktop
google-api.keys
+ upstream-cros-search-service-Include-cmath-for-std-pow.patch
+ upstream-fix-building-with-unbundled-libxml.patch
+ upstream-move-RemoteTreeNode-declaration.patch
+ upstream-rebuild-Linux-frame-button-cache-when-activation.patch
+ upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
+ upstream-sync-enable-USSPasswords-by-default.patch
+
default-pthread-stacksize.patch
musl-fixes.patch
musl-fixes-breakpad.patch
@@ -98,7 +101,6 @@ source="https://commondatastorage.googleapis.com/chromium-browser-official/$pkgn
no-mallinfo.patch
resolver.patch
swiftshader.patch
- chromium-system-harfbuzz.patch
create-extra-view-redefinition.patch
llvm-remove-unsupported-compiler-warnings.patch
@@ -110,14 +112,22 @@ source="https://commondatastorage.googleapis.com/chromium-browser-official/$pkgn
gcc-fno-delete-null-pointer-checks.patch
gcc-arm.patch
- musl-arm-limits.patch
aarch64-fixes.patch
elf-arm.patch
- "
-builddir="$srcdir"/$pkgname-$pkgver
+ gn_bootstrap_ninja.patch
+ "
# secfixes:
+# 80.0.3987.149-r0:
+# - CVE-2020-6422
+# - CVE-2020-6424
+# - CVE-2020-6425
+# - CVE-2020-6426
+# - CVE-2020-6427
+# - CVE-2020-6428
+# - CVE-2020-6429
+# - CVE-2019-20503
# 72.0.3626.121-r0:
# - CVE-2019-5786
@@ -130,10 +140,7 @@ else
fi
prepare() {
- cd "$builddir"
-
local i
- cd "$builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p0 -i "$srcdir"/$i;;
@@ -154,6 +161,7 @@ prepare() {
ffmpeg
flac
fontconfig
+ freetype
harfbuzz-ng
libdrm
libevent
@@ -173,6 +181,7 @@ prepare() {
\! -path "*third_party/$_lib/chromium/*" \
\! -path "*third_party/$_lib/google/*" \
\! -path './base/third_party/icu/*' \
+ \! -path './third_party/libxml/*' \
\! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \
\! -path './third_party/yasm/run_yasm.py' \
\! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
@@ -186,7 +195,7 @@ prepare() {
msg "Replacing gyp files"
python build/linux/unbundle/replace_gn_files.py --system-libraries \
- ${use_system}
+ $use_system
third_party/libaddressinput/chromium/tools/update-strings.py
}
@@ -195,8 +204,6 @@ _gn_flags() {
}
build() {
- cd "$builddir"
-
##############################################################
# Please dont use these keys outside of Alpine Linux project #
# You can create your own at: #
@@ -223,12 +230,13 @@ build() {
msg "Configuring build"
_c=$(_gn_flags \
+ blink_symbol_level=0 \
clang_use_chrome_plugins=false \
closure_compile=true \
custom_toolchain=\"//build/toolchain/linux/unbundle:default\" \
enable_hangout_services_extension=true \
- enable_nacl=false \
enable_nacl_nonsfi=false \
+ enable_nacl=false \
enable_precompiled_headers=false \
fatal_linker_warnings=false \
ffmpeg_branding=\"Chrome\" \
@@ -245,17 +253,15 @@ build() {
is_desktop_linux=true \
linux_use_bundled_binutils=false \
proprietary_codecs=true \
- blink_symbol_level=0 \
symbol_level=0 \
treat_warnings_as_errors=false \
- use_allocator=\"none\" \
use_allocator_shim=false \
+ use_allocator=\"none\" \
use_cups=true \
use_custom_libcxx=false \
use_gnome_keyring=false \
use_gold=false \
use_lld=false \
- use_jumbo_build=true \
use_pulseaudio=false \
use_sysroot=false \
use_system_harfbuzz=true \
@@ -283,7 +289,7 @@ build() {
}
package() {
- cd "$builddir"/out/$_buildtype
+ cd out/$_buildtype
local bin pak
# paxmark inside chroot too
paxmark -m mksnapshot
@@ -321,12 +327,12 @@ package() {
cd "$builddir"
for size in 24 48 64 128 256; do
install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
- "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ "$pkgdir/usr/share/icons/hicolor/"$size"x"$size"/apps/chromium.png"
done
for size in 16 32; do
install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
- "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ "$pkgdir/usr/share/icons/hicolor/"$size"x"$size"/apps/chromium.png"
done
}
@@ -338,32 +344,37 @@ chromedriver() {
mv "$pkgdir"/usr/bin/chromedriver "$subpkgdir"/usr/bin
}
-sha512sums="4b5d4769b068f20b8028085a148cbaf31311eeffad0a22c5c0909af273a8e57e077b33cc93331bbeff9165477262eed2e345b2224ac4f76d8bdb79f983596a81 chromium-79.0.3945.130.tar.xz
+sha512sums="5abbf8ff754937a3af566474457b5cd9bbcac0e8b1a52fd95180fcf69b12515278423887668512b3136de72ebe15048c4bd79572511f68189d1e86ace4ca30cb chromium-80.0.3987.149.tar.xz
a3bb959c65944ae2fb765725cedcffd743a58bc0c2cd1f1999d15fe79801d00f3474b08b4ed7b48859ed921eb57093d0ad09d90f201d729ed9b8a419a591ed29 pstables-2.8.h
b9a810416dd7a8ffc3a5ced85ad9acebda1665bd08a57eec7b189698cc5f74d2c3fd69044e20fcb83297a43214b2772a1312b2c6122ea0eb716abacf39524d60 chromium-launcher.sh
f6d962b9e4c22dd42183df3db5d3202dab33eccecafb1bf63ca678147289581262db1e5e64cbe8f9c212beefb0a6717bb8d311e497f56b55fe95b8bab2db493f chromium.conf
e182c998a43d22d1c76a86c561619afd1fca8c2be668265ad5e2f81a3806f7a154272cc027a2f8b370fb69446892c69e5967a4be76082325c14245ee7915234c chromium.desktop
2d8237a940ea691bd10b08315429677a587f7ef9692a0cca53bfd066eae82998a6c71f402a8669e9de39f94d7f3280745d1628ea6eac5d76ca7116844d4e0dac google-api.keys
-230d1819b9d644ebaa6e194e948d662add8d237a99cc3d6b0f8a2fc2b331b43a3cd0766746f1c76c1a114f1730b40504c532d0c40aafa8cbc45022663cbcc245 default-pthread-stacksize.patch
-ef31809702ef020e02445ac36857c621cf852dea14c2fdf291ea0700b6fc6d94e3704726a051e95d193aa10fe74ca53a870848fec5f8153fb262f2e184affe7f musl-fixes.patch
-90efbc89151c77f32434364dcbaabaf9d9a207f4a77f147cd51b3fe100832fbfb3a9fb665303a79a3d788e400f4f41890de202ccbb7bd1fc6252e33c6e74e429 musl-fixes-breakpad.patch
-4640c175657f6a53f8a8d1c6bd2208ec30751d739a086b8f4f49250a88e522441a4919c1e47673cbee54c24c9cc65f18d386071fc4667662e4d13201f0bb7e64 musl-hacks.patch
-95ead57f7338649351948d100e32e5ec1eeadb02bffa136ff15c6c515eceb8013c444be092d777c1b62b945bfb83b97778ba4d3a0ccc2d7c2c9a0a8cd8ee0f01 musl-libc++.patch
-5bb41c9a17545e2504cbfd760a1c138897ae9241a03ae0fe54632ddff679c273ec61e80946a4cd70ff79f237d1a442ca9e6ff4d2f5b0f6458db9239de2d1d3d7 musl-sandbox.patch
-83b4cc042d501bd94ce953d1bc94361adf9d6f0d1fa71c04c5d3688c0befb81fdb6ccf31e6cab6a22d0057db309b473bc6af75535675c61d167035e36dd1d6c6 no-execinfo.patch
-396be05301adad9f9c9bb7a807ecb206deef901e4420206f41f74a660a8c0f300a1f210b1d379bed5519cf68bff8ce7c1a9e155651c478e11469c3d253e12155 no-mallinfo.patch
-3e424b9bf8e819e7759a76fe6f849f93e6b83de5c8b47cce21984611a69906a50cb4a498b0e69ef71d3f81f556914e6e5a6803ebfd81b42eb62177c654b10215 resolver.patch
-84732900f50799ee8d4c9a572a8703c1cd67c6a3b8f8dcf97f308319dcef6ac3d41ea5ddfb2ef4d695bdebdae691e30d5631a8d04e59b931935ba188b0308a61 swiftshader.patch
-c2c17e405863e07b312d7d37b3e8d02cdebd5decee11b0e6387256f6d90517e052fc82544513a771c59083c0d9aeefbac3ddd3ed09654e302bfdd126e2cc1cc8 chromium-system-harfbuzz.patch
-6ca49766db7af5ff12a62f66e0ec873f8d7f8eb2d19a79df55d6688ce2f5a7dd3772305213485b48e579f19072df707e447f7cdfb39578b78a2f936fae6081bf create-extra-view-redefinition.patch
-1b6150ab7844ae6b30faba89ae45c216e987c77588cbe2dd50b6de5381d9c0efe760c8375574f94b7ca5c17ebf13a91b627593045d3d7a8bf70c63a30ecbf3ee llvm-remove-unsupported-compiler-warnings.patch
-50e2c78bc2e7f343ed97d348bbe34350439ede6a15bf8ea1017eb13c391d4718b00a51db9c2eb40d8398d9733bf1925db42011f3bcbdd7d83329b1c7d534032b chromium-use-alpine-target.patch
-589a7acf149d44db081da2dd24a7769f2b9572a8cc64d2aad78577a64768d3b6fb2bfa02292b5260acd2c4a28c3ae9b82847ff901ce8a21baeca0b46dcda0ca9 media-base.patch
-05c1af43038f76014f5f8b605085310414242f2bfad0e3258ddb29a08e7f4307de31b2d551b0a291986cc7d5a01cf3a003ac864216877195bb4310fd33193f0f musl-crashpad.patch
-6953e83d4034f7a016dd055fed152a8a448f741a4c4f7a8f3b03cc7a4589d3d3c03775f844d76d6d4478ac15c655fee0be7355f0d5062ddc7fa9f6ce4b011116 musl-v8-monotonic-pthread-cont_timedwait.patch
-34013a1a960d0f3b20183d03df5be6b36e2eb9b3d3319fa2bcf3c69084968fde0239ad7304c9a6165b3284a2a55a220b3d207889e2b913dc4578268fdede9ea6 nasm.patch
-bb0f3dc1ade429a398d487ae190a278948533398c4a1085aeb35ff57fefb90a1e598008ba839423ca0acd30ba4c992950f395dba3b9994d3c7187fe68b9a93d7 gcc-fno-delete-null-pointer-checks.patch
-91296fcbdfc4b35899e2af949024c7041d85cc64644cf5fe73c8e46a0523b09d1fb8849f315bd212c1ac25caf57553e933cb4eeb8d1856960441d24b2dd20e27 gcc-arm.patch
-3bcffb36f28a01d8bb91f1c1ee1e327caebb1e139d4e8772ad15460ee69cb5ea3307a235dc83184a9e09b687882d9617f3a3ce1a7b07cbd6e11b0a5d6a6ace81 musl-arm-limits.patch
-f0a0fa663fd7a88346d69675a96dfd864364f6ba41d19a5adfbfb0f13fd784b194a60cd2c63edfcc21d6b049628eade690ff803f787dbdd29d84cd8312be4d4a aarch64-fixes.patch
-8f5902983f9933ed4ff5607fbe97ea8dfa00f9974c8c5b35f2611d15d2b6ba75970f71f2e307daa2155c5647210c871cf3d081c292369bf6489c802d277570fa elf-arm.patch"
+75b93ccb6730ba6f516edef179a497275db623f4a8270d2cc9cd26548e0e41e6ee2d600438af8cbd7be3ebc9ad562cac2f58792eb4d2d2be2cf59f45a0253811 upstream-cros-search-service-Include-cmath-for-std-pow.patch
+7e700b6c33188f562bdb77aea795abd44d6d0a874c65192d2f81584cb34ca142b4d1117626a7cfd209729865a82d605aaf81390af6fa406ed3b1423511815131 upstream-fix-building-with-unbundled-libxml.patch
+902d7b08a25323551c1ca671cd2c1889bce0a9b017d4bc8f4abb7ccc654a3cbfb7b2b0652e17f182e018c1d1e3b35328a428e394691c38408e637613a9c76bbc upstream-move-RemoteTreeNode-declaration.patch
+ad0e7e32e5eadbc935abd8f01a360e04133e387c6dc669ca350eaa586cce901682afeb2a61abd8c6380bcc919a76e16a9f1fe516c780bb0af78ed1c9d4327bc2 upstream-rebuild-Linux-frame-button-cache-when-activation.patch
+082bc4340b49c12b519e217f0580ce94cb9bf35901f94ae19f9069530efce3ff3f03b39338724f3f517c3deb724e84d7c95f83b07419b847e245459056c465e2 upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
+59c9bf861caf06e6fe2f69214f55f73753008930716f35a0d5c2cc18f0b5178f7cb104922031a58f4831fcefebd31c9921706f3dbda32ba029487555d52d2254 upstream-sync-enable-USSPasswords-by-default.patch
+b726ef2ecfe7d471e60d67de1e05847d214df6093b41bb2055652a9028327af19a8b10e7175467240f4dfec9e3ae97a6c4666bfd2cd6cb436c54656a085653ae default-pthread-stacksize.patch
+5c61e97621606a43ea91ab64b7432943cceeb8af951f10f6db07d9cb8f8d925e5f5e4c55618d0075e68397464e2315b5c47564e9c4c046652c5636a496f4a335 musl-fixes.patch
+ecb4bf5653bf3d987970d6c708f179bfc4b7d370b59d412bdf20d1f993585ee2f619caf202e7f239cb47111c8a72557c364cf60b7dd17e172e6629792eea8f29 musl-fixes-breakpad.patch
+d78479bdea1c847d6e1506421a3eb716031cd24aa979f0e653c0406b507a5a89924d15e6c603e291f1b17751fb0788571f42699214fd1462334c0daabd584ffe musl-hacks.patch
+919f13a2cd65673f267321cf95c5410e65bc5264d6704d0791b25d39111282bedb425bd9824dde3b67422cfb874c86a9383ded686e39cfd4aac239edaf41cfc8 musl-libc++.patch
+8d57d524978852ded41394793d611083d82241ecbc64808bbf5759d7bf0db0fe92af84935cf9e556d555f8d9963c847611413fa68634202f817b671be414c224 musl-sandbox.patch
+129ec746fd951ee6d0bf0b4389b7c988523870507de1f92f5706f4eb49039d4a49ed30e92b0634e3ae521fc3e129adc1c6edc7435922fc91658d8c087520c707 no-execinfo.patch
+06d6b4c466fa48f2d22c338e20458d8fa50bbbf744468f41bc3c1892e739002b1fbc5c133a37252cec4ff4f804847add6b9c0cc1f84fb276939471c09e467fb6 no-mallinfo.patch
+b1edab2a782a0fd554d0fcee893374282ceca797e9595f1b4dd1c4dbeb65a5d6c368f2000f8d44baea3a53880621fa33c456b663d72960e94f2e05f9ec4f7965 resolver.patch
+f4265df7532625070c51ac43466e3e0f21e696f90c3b6040ef62a21defa7666203ff8219d9c9a5bebc011024aff300fbcbd941cebd0df59c4bc068d8f290221e swiftshader.patch
+aa5e2b73196ea8db15ff995964032d3afcda9acf3f06bd3b196d9abfec022c462284a703e713b0ab7e613a384e8eaa271413025f18948443f58151974984670b create-extra-view-redefinition.patch
+ae600a6a8cfc6cb0daf6e330623d84d460992ecedc0702ed0820fb7d0c59c73df5aa0c8c451bc768e82d4cabc1f386b740def2e6152b719b0fe8afd2a99a49a0 llvm-remove-unsupported-compiler-warnings.patch
+cf9970ef403ff7a68bf08c0ba5e681eec459fcb1afb6859e5a80f4874f1b9a656377b4540eeb5208ddec570efa206f147e32718c687fa29ca3acc4fde6e8cbe8 chromium-use-alpine-target.patch
+599f5ef338b5797e04436bdc88921c31365d2dea2613d40053be6e774f654e2889efb0c0bd55c2c5044a6805510fbc337da555971169a75d584fac93e18256ac media-base.patch
+fca59f9728aa05253688b2ba8d6a610832bc28bd3057636c95e64759d5b006c80e84c549b6037f7dad90d9b8770bd79658b1474274141fa114a48e8a6f0f17c8 musl-crashpad.patch
+556cc2ba28184a75745f13c673605327f5be590be179eb3f941dc0abded854a814e5da1432a28fb8d4dcdcd66ffd4c94ee1a8824d2cd93b632f48e9310dbc3fa musl-v8-monotonic-pthread-cont_timedwait.patch
+7957aae04e8ef3badbc98c982ba1acb1b9ef5e665440116c704512f11554d7b64ba3643b7ff7d00476a6686324033b0cf762deb78ce798619226380953b9dc9c nasm.patch
+56a357668c0928bc488ccec8f53fd37fccbaefe0a185ceaf067c8c39e0fae3d2b61ca010ccabc785bec0f2e86b19f37cebb3ac344225aa8d7651c822e48c6064 gcc-fno-delete-null-pointer-checks.patch
+4a7ea09356823392f75ce188973422c8978fd84f238ed0f533376c50030210323b27e8401749bfb8ebe7d02d29c4b6067259f0a1fa55f0916e9c82c29ff3a420 gcc-arm.patch
+7f81d97cce25d5530a2cb84105247e3707e344a285b0ac73c2f9275eae4bcc5aea6ff27307ec6607f95c13e9e724fab0e15e6fb8a33b3a9bfe0b3dbfdfb33ae6 aarch64-fixes.patch
+bddf4ddaed63fbea15083d7a9e19173aa204fcdce9b4fdde2f673df71c79e56c313325a090af86e3df03034188c83c40e96b497f1f83057ed6bbbe8343490d4a elf-arm.patch
+834e732959dd4a1c5ec847185c8f025307c7f2b79d9e87079a7bea0cbc0b7324cb660e302a462879309e95220117acac1d31c8eb276c78b5c400b2db2d59fda8 gn_bootstrap_ninja.patch"
diff --git a/community/chromium/aarch64-fixes.patch b/community/chromium/aarch64-fixes.patch
index 107bb8b1bc..b35347da03 100644
--- a/community/chromium/aarch64-fixes.patch
+++ b/community/chromium/aarch64-fixes.patch
@@ -1,5 +1,3 @@
-diff --git a/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h b/third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
-index ff20611..ec22982 100644
--- ./third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
+++ ./third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h
@@ -122,7 +122,7 @@
diff --git a/community/chromium/chromium-system-harfbuzz.patch b/community/chromium/chromium-system-harfbuzz.patch
deleted file mode 100644
index a2064cf75b..0000000000
--- a/community/chromium/chromium-system-harfbuzz.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
-index a218d63..6a5bdae 100644
---- components/paint_preview/common/subset_font.cc
-+++ components/paint_preview/common/subset_font.cc
-@@ -10,11 +10,12 @@
- #include "base/bind.h"
- #include "base/callback.h"
- #include "base/macros.h"
--#include "third_party/harfbuzz-ng/src/src/hb-subset.h"
--#include "third_party/harfbuzz-ng/src/src/hb.h"
- #include "third_party/skia/include/core/SkStream.h"
- #include "third_party/skia/include/core/SkTypeface.h"
-
-+#include <hb-subset.h>
-+#include <hb.h>
-+
- namespace paint_preview {
-
- namespace {
diff --git a/community/chromium/chromium-use-alpine-target.patch b/community/chromium/chromium-use-alpine-target.patch
index 769ea7ad77..903114ca3f 100644
--- a/community/chromium/chromium-use-alpine-target.patch
+++ b/community/chromium/chromium-use-alpine-target.patch
@@ -1,6 +1,6 @@
---- build/config/compiler/BUILD.gn.orig
+--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
-@@ -709,8 +709,8 @@
+@@ -752,8 +752,8 @@
}
} else if (current_cpu == "arm") {
if (is_clang && !is_android && !is_nacl) {
@@ -11,7 +11,7 @@
}
if (!is_nacl) {
cflags += [
-@@ -723,8 +723,8 @@
+@@ -766,8 +766,8 @@
}
} else if (current_cpu == "arm64") {
if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
@@ -21,8 +21,8 @@
+ ldflags += [ "--target=aarch64-alpine-linux-musl" ]
}
} else if (current_cpu == "mipsel" && !is_nacl) {
- if (custom_toolchain == "") {
-@@ -733,8 +733,8 @@
+ ldflags += [ "-Wl,--hash-style=sysv" ]
+@@ -777,8 +777,8 @@
cflags += [ "--target=mipsel-linux-android" ]
ldflags += [ "--target=mipsel-linux-android" ]
} else {
@@ -33,7 +33,16 @@
}
} else {
cflags += [ "-EL" ]
-@@ -861,8 +861,8 @@
+@@ -794,7 +794,7 @@
+ "-march=mipsel",
+ "-mcpu=mips32r6",
+ ]
+- } else {
++ } else {
+ cflags += [
+ "-mips32r6",
+ "-Wa,-mips32r6",
+@@ -908,8 +908,8 @@
cflags += [ "--target=mips64el-linux-android" ]
ldflags += [ "--target=mips64el-linux-android" ]
} else {
@@ -44,8 +53,8 @@
}
} else {
cflags += [
-@@ -919,8 +919,8 @@
- } else if (current_cpu == "mips64") {
+@@ -967,8 +967,8 @@
+ ldflags += [ "-Wl,--hash-style=sysv" ]
if (custom_toolchain == "") {
if (is_clang) {
- cflags += [ "--target=mips64-linux-gnuabi64" ]
diff --git a/community/chromium/create-extra-view-redefinition.patch b/community/chromium/create-extra-view-redefinition.patch
index d17a594164..979d8836ec 100644
--- a/community/chromium/create-extra-view-redefinition.patch
+++ b/community/chromium/create-extra-view-redefinition.patch
@@ -1,5 +1,5 @@
---- chrome/browser/ui/views/accessibility/invert_bubble_view.cc.orig 2019-12-11 10:41:00.069472967 -0500
-+++ chrome/browser/ui/views/accessibility/invert_bubble_view.cc 2019-12-11 10:41:48.254466283 -0500
+--- chrome/browser/ui/views/accessibility/invert_bubble_view.cc
++++ chrome/browser/ui/views/accessibility/invert_bubble_view.cc
@@ -47,7 +47,7 @@
// Tag value used to uniquely identify the "learn more" (?) button.
constexpr int kLearnMoreButton = 100;
@@ -10,7 +10,7 @@
views::SetImageFromVectorIcon(learn_more.get(),
vector_icons::kHelpOutlineIcon);
@@ -95,7 +95,7 @@
- dark_theme_(nullptr) {
+ DialogDelegate::set_buttons(ui::DIALOG_BUTTON_OK);
DialogDelegate::set_button_label(ui::DIALOG_BUTTON_OK,
l10n_util::GetStringUTF16(IDS_DONE));
- DialogDelegate::SetExtraView(::CreateExtraView(this));
diff --git a/community/chromium/default-pthread-stacksize.patch b/community/chromium/default-pthread-stacksize.patch
index 16e4d21e6e..e55317035d 100644
--- a/community/chromium/default-pthread-stacksize.patch
+++ b/community/chromium/default-pthread-stacksize.patch
@@ -1,12 +1,18 @@
---- base/threading/platform_thread_linux.cc.orig
+--- base/threading/platform_thread_linux.cc
+++ base/threading/platform_thread_linux.cc
-@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p
+@@ -186,7 +186,8 @@
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
- return 0;
+ // use 8mb like glibc to avoid running out of space
+ return (1 << 23);
---- chrome/app/shutdown_signal_handlers_posix.cc.orig
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+--- chrome/app/shutdown_signal_handlers_posix.cc
+++ chrome/app/shutdown_signal_handlers_posix.cc
-@@ -184,11 +184,19 @@
+@@ -187,11 +187,19 @@
g_shutdown_pipe_read_fd = pipefd[0];
g_shutdown_pipe_write_fd = pipefd[1];
#if !defined(ADDRESS_SANITIZER)
@@ -16,14 +22,13 @@
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
+# endif
#else
++# if defined(__GLIBC__)
// ASan instrumentation bloats the stack frames, so we need to increase the
// stack size to avoid hitting the guard page.
-+# if defined(__GLIBC__)
const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
+# else
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
+# endif
#endif
ShutdownDetector* detector = new ShutdownDetector(
- g_shutdown_pipe_read_fd, shutdown_callback, task_runner);
-
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/community/chromium/elf-arm.patch b/community/chromium/elf-arm.patch
index 77bf9f2b51..aed41c3f33 100644
--- a/community/chromium/elf-arm.patch
+++ b/community/chromium/elf-arm.patch
@@ -1,8 +1,6 @@
-diff --git a/v8/src/base/cpu.cc b/v8/src/base/cpu.cc
-index 4f4ac2b..c32239b 100644
--- ./v8/src/base/cpu.cc
+++ ./v8/src/base/cpu.cc
-@@ -17,7 +17,7 @@ extern "C" char** environ;
+@@ -17,7 +17,7 @@
#if V8_OS_QNX
#include <sys/syspage.h> // cpuinfo
#endif
diff --git a/community/chromium/gcc-arm.patch b/community/chromium/gcc-arm.patch
index 7498954ac6..2673a15898 100644
--- a/community/chromium/gcc-arm.patch
+++ b/community/chromium/gcc-arm.patch
@@ -1,8 +1,6 @@
-diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
-index 1a9cd3b..728a011 100644
--- ./third_party/zlib/BUILD.gn
+++ ./third_party/zlib/BUILD.gn
-@@ -16,7 +16,7 @@ config("zlib_internal_config") {
+@@ -18,7 +18,7 @@
use_arm_neon_optimizations = false
if (current_cpu == "arm" || current_cpu == "arm64") {
diff --git a/community/chromium/gcc-fno-delete-null-pointer-checks.patch b/community/chromium/gcc-fno-delete-null-pointer-checks.patch
index 792cef60f6..55118fef27 100644
--- a/community/chromium/gcc-fno-delete-null-pointer-checks.patch
+++ b/community/chromium/gcc-fno-delete-null-pointer-checks.patch
@@ -1,17 +1,15 @@
-diff --git a/v8/BUILD.gn b/v8/BUILD.gn
-index 3c03942..870b1e6 100644
--- ./v8/BUILD.gn
+++ ./v8/BUILD.gn
-@@ -577,6 +577,14 @@ config("toolchain") {
- defines += [ "V8_ANDROID_LOG_STDOUT" ]
+@@ -675,6 +675,14 @@
+ defines += [ "V8_TARGET_OS_WIN" ]
}
+ if (!is_win && !is_clang) {
-+ # GCC 6+ can optimize away pointer comparisons to null. This is
++ # GCC 6 can optimize away pointer comparisons to null. This is
+ # problematic as V8 encodes Values through tagged pointers and comparisons
+ # with 0 are actually necessary in many cases. As a temporary Workaround
+ # we disable this optimization. See: https://crbug.com/v8/3782
-+ cflags += [ "-fno-delete-null-pointer-checks" ]
++ cflags = [ "-fno-delete-null-pointer-checks" ]
+ }
+
# TODO(jochen): Support v8_enable_prof on Windows.
diff --git a/community/chromium/gn_bootstrap_ninja.patch b/community/chromium/gn_bootstrap_ninja.patch
new file mode 100644
index 0000000000..88dc0a6500
--- /dev/null
+++ b/community/chromium/gn_bootstrap_ninja.patch
@@ -0,0 +1,32 @@
+Patch by Michael Forney <mforney@mforney.org>
+
+Already merged https://chromium-review.googlesource.com/c/chromium/src/+/1975453
+
+--- tools/gn/bootstrap/bootstrap.py
++++ tools/gn/bootstrap/bootstrap.py
+@@ -70,6 +70,7 @@
+ out_dir = os.path.join(SRC_ROOT, build_rel)
+ gn_path = options.output or os.path.join(out_dir, 'gn')
+ gn_build_dir = os.path.join(out_dir, 'gn_build')
++ ninja_binary = os.environ.get('NINJA', 'ninja')
+
+ # TODO(thomasanderson): Remove this once Ubuntu Trusty reaches EOL, or when
+ # Chromium's infrastructure is upgraded from Trusty to Xenial, whichever comes
+@@ -90,7 +91,7 @@
+ os.environ.get('CFLAGS', '').split() +
+ os.environ.get('CXXFLAGS', '').split()),
+ ]) + '\n')
+- subprocess.check_call(['ninja', '-C', libcxx_dir])
++ subprocess.check_call([ninja_binary, '-C', libcxx_dir])
+ shutil.copy2(os.path.join(gn_build_dir, 'libc++.gn.so'), out_dir)
+
+ def append_to_env(var, vals):
+@@ -120,7 +121,7 @@
+ shutil.copy2(
+ os.path.join(BOOTSTRAP_DIR, 'last_commit_position.h'), gn_build_dir)
+ subprocess.check_call(
+- ['ninja', '-C', gn_build_dir, 'gn', '-w', 'dupbuild=err'])
++ [ninja_binary, '-C', gn_build_dir, '-w', 'dupbuild=err', 'gn'])
+ shutil.copy2(os.path.join(gn_build_dir, 'gn'), gn_path)
+
+ if not options.skip_generate_buildfiles:
diff --git a/community/chromium/llvm-remove-unsupported-compiler-warnings.patch b/community/chromium/llvm-remove-unsupported-compiler-warnings.patch
index df8aed86d9..78cfa4a18c 100644
--- a/community/chromium/llvm-remove-unsupported-compiler-warnings.patch
+++ b/community/chromium/llvm-remove-unsupported-compiler-warnings.patch
@@ -5,7 +5,7 @@ Index: dev/build/config/compiler/BUILD.gn
===================================================================
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
-@@ -693,14 +693,6 @@ config("compiler") {
+@@ -708,14 +708,6 @@
ldflags += [ "-Wl,--no-rosegment" ]
}
@@ -20,7 +20,7 @@ Index: dev/build/config/compiler/BUILD.gn
# Pass the same C/C++ flags to the objective C/C++ compiler.
cflags_objc += cflags_c
cflags_objcc += cflags_cc
-@@ -1501,28 +1493,6 @@ config("default_warnings") {
+@@ -1516,26 +1508,6 @@
if (current_toolchain == host_toolchain || !use_xcode_clang) {
# Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not
# recognize.
@@ -32,20 +32,18 @@ Index: dev/build/config/compiler/BUILD.gn
- # TODO(https://crbug.com/989932): Evaluate and possibly enable.
- "-Wno-implicit-int-float-conversion",
-
-- # TODO(https://crbug.com/999871): Decide if we want to clean up the
-- # codebase or just disable this. Doesn't seem super useful, but
-- # also fires in only 4 files.
-- "-Wno-c99-designator",
--
-- # This is a side effect of -Wc99-designator; easier to clean up.
-- "-Wno-reorder-init-list",
--
- # TODO(https://crbug.com/999886): Clean up, enable.
- "-Wno-final-dtor-non-final-class",
-
-- # TODO(https://crbug.com/1002945): Evaluate and possibly enable.
-- "-Wno-sizeof-array-div",
+- # TODO(https://crbug.com/1016947) Clean up, enable.
+- "-Wno-bitwise-conditional-parentheses",
+-
+- # TODO(https://crbug.com/1016945) Clean up, enable.
+- "-Wno-builtin-assume-aligned-alignment",
+-
+- # TODO(https://crbug.com/1028110): Evaluate and possible enable.
+- "-Wno-deprecated-copy",
- ]
- cflags_c += [
- # TODO(https://crbug.com/995993): Clean up and enable.
+ if (is_fuchsia) {
+ cflags += [
diff --git a/community/chromium/media-base.patch b/community/chromium/media-base.patch
index 0a650d3731..99b881fc5c 100644
--- a/community/chromium/media-base.patch
+++ b/community/chromium/media-base.patch
@@ -1,8 +1,6 @@
-diff --git a/media/base/subsample_entry.h b/media/base/subsample_entry.h
-index 48f8ea7..1135a18 100644
--- ./media/base/subsample_entry.h
+++ ./media/base/subsample_entry.h
-@@ -8,6 +8,7 @@
+@@ -9,6 +9,7 @@
#include <stdint.h>
#include <vector>
diff --git a/community/chromium/musl-arm-limits.patch b/community/chromium/musl-arm-limits.patch
deleted file mode 100644
index cfb5473ed3..0000000000
--- a/community/chromium/musl-arm-limits.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc b/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc
-index 6ba52a8..0c7a9f9 100644
---- ./third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc
-+++ ./third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc
-@@ -14,6 +14,7 @@
-
- #include "snapshot/linux/cpu_context_linux.h"
-
-+#include <limits>
- #include <stddef.h>
- #include <string.h>
-
diff --git a/community/chromium/musl-crashpad.patch b/community/chromium/musl-crashpad.patch
index 60f5bc67be..1e19a99d42 100644
--- a/community/chromium/musl-crashpad.patch
+++ b/community/chromium/musl-crashpad.patch
@@ -1,5 +1,3 @@
-diff --git a/third_party/crashpad/crashpad/util/linux/ptracer.cc b/third_party/crashpad/crashpad/util/linux/ptracer.cc
-index 63bee1e..24ef002 100644
--- ./third_party/crashpad/crashpad/util/linux/ptracer.cc
+++ ./third_party/crashpad/crashpad/util/linux/ptracer.cc
@@ -26,6 +26,7 @@
@@ -9,4 +7,4 @@ index 63bee1e..24ef002 100644
+#include <asm/ptrace-abi.h>
#endif
- namespace crashpad {
+ #if defined(ARCH_CPU_ARM_FAMILY)
diff --git a/community/chromium/musl-fixes-breakpad.patch b/community/chromium/musl-fixes-breakpad.patch
index 2cbf88ca20..a86535abec 100644
--- a/community/chromium/musl-fixes-breakpad.patch
+++ b/community/chromium/musl-fixes-breakpad.patch
@@ -1,8 +1,6 @@
-diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-index 052ce37..95b0fb4 100644
---- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
-@@ -49,7 +49,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+@@ -49,7 +49,7 @@
}
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
@@ -11,7 +9,7 @@ index 052ce37..95b0fb4 100644
const greg_t* regs = uc->uc_mcontext.gregs;
out->context_flags = MD_CONTEXT_X86_FULL |
-@@ -97,7 +97,7 @@ uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+@@ -97,7 +97,7 @@
}
void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
@@ -20,11 +18,9 @@ index 052ce37..95b0fb4 100644
const greg_t* regs = uc->uc_mcontext.gregs;
out->context_flags = MD_CONTEXT_AMD64_FULL;
-diff --git a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-index 2de80b7..4cf1377 100644
---- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
-@@ -50,7 +50,7 @@ struct UContextReader {
+@@ -50,7 +50,7 @@
// info: the collection of register structures.
#if defined(__i386__) || defined(__x86_64)
static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
@@ -33,11 +29,9 @@ index 2de80b7..4cf1377 100644
#elif defined(__aarch64__)
static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
const struct fpsimd_context* fpregs);
-diff --git a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-index d1dc331..d1cc562 100644
---- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+--- ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
+++ ./third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h
-@@ -48,7 +48,7 @@ class ExceptionHandler;
+@@ -48,7 +48,7 @@
#if defined(__aarch64__)
typedef struct fpsimd_context fpstate_t;
#elif !defined(__ARM_EABI__) && !defined(__mips__)
@@ -46,7 +40,7 @@ index d1dc331..d1cc562 100644
#endif
// These entries store a list of memory regions that the client wants included
---- ./breakpad/src/common/linux/elf_core_dump.h.orig
+--- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
@@ -36,6 +36,7 @@
#include <elf.h>
@@ -68,9 +62,9 @@ index d1dc331..d1cc562 100644
static const int kClass = ELFCLASS64;
#else
#error "Unsupported __WORDSIZE for ElfCoreDump."
---- ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc.orig
+--- ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+++ ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
-@@ -495,7 +495,9 @@
+@@ -490,7 +490,9 @@
siginfo.si_code = SI_USER;
siginfo.si_pid = getpid();
ucontext_t context;
@@ -80,11 +74,10 @@ index d1dc331..d1cc562 100644
return HandleSignal(sig, &siginfo, &context);
}
-@@ -680,9 +682,14 @@
+@@ -675,9 +677,13 @@
sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
CrashContext context;
-+
+#if defined(__GLIBC__)
int getcontext_result = getcontext(&context.context);
if (getcontext_result)
diff --git a/community/chromium/musl-fixes.patch b/community/chromium/musl-fixes.patch
index 7f851971ca..be2dcb4e60 100644
--- a/community/chromium/musl-fixes.patch
+++ b/community/chromium/musl-fixes.patch
@@ -1,6 +1,6 @@
---- ./third_party/lss/linux_syscall_support.h.orig
+--- ./third_party/lss/linux_syscall_support.h
+++ ./third_party/lss/linux_syscall_support.h
-@@ -1127,6 +1127,12 @@
+@@ -1239,6 +1239,12 @@
#ifndef __NR_fallocate
#define __NR_fallocate 285
#endif
@@ -13,10 +13,10 @@
/* End of x86-64 definitions */
#elif defined(__mips__)
#if _MIPS_SIM == _MIPS_SIM_ABI32
---- ./sandbox/linux/suid/process_util.h.orig
+--- ./sandbox/linux/suid/process_util.h
+++ ./sandbox/linux/suid/process_util.h
-@@ -11,6 +11,14 @@
- #include <stdbool.h>
+@@ -12,6 +12,14 @@
+ #include <stdint.h>
#include <sys/types.h>
+// Some additional functions
@@ -30,9 +30,9 @@
// This adjusts /proc/process/oom_score_adj so the Linux OOM killer
// will prefer certain process types over others. The range for the
// adjustment is [-1000, 1000], with [0, 1000] being user accessible.
---- ./sandbox/linux/seccomp-bpf/trap.cc.orig
+--- ./sandbox/linux/seccomp-bpf/trap.cc
+++ ./sandbox/linux/seccomp-bpf/trap.cc
-@@ -156,7 +156,7 @@
+@@ -168,7 +168,7 @@
// most versions of glibc don't include this information in siginfo_t. So,
// we need to explicitly copy it into a arch_sigsys structure.
struct arch_sigsys sigsys;
@@ -41,9 +41,9 @@
#if defined(__mips__)
// When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
---- ./third_party/ffmpeg/libavutil/cpu.c.orig
+--- ./third_party/ffmpeg/libavutil/cpu.c
+++ ./third_party/ffmpeg/libavutil/cpu.c
-@@ -38,7 +38,6 @@
+@@ -41,7 +41,6 @@
#include <sys/param.h>
#endif
#include <sys/types.h>
@@ -51,11 +51,9 @@
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
-diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
-index 9067e84..1c47b2a 100644
--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
-@@ -39,7 +39,9 @@
+@@ -46,7 +46,9 @@
#endif // defined(OS_ANDROID) && defined(__arm__)
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
@@ -65,7 +63,7 @@ index 9067e84..1c47b2a 100644
#include "base/linux_util.h"
#include "base/strings/string_split.h"
-@@ -295,7 +297,7 @@ void RecordLinuxDistro() {
+@@ -365,7 +367,7 @@ void RecordLinuxDistro() {
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
void RecordLinuxGlibcVersion() {
@@ -74,31 +72,9 @@ index 9067e84..1c47b2a 100644
base::Version version(gnu_get_libc_version());
UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
---- ./services/device/serial/serial_io_handler_posix.cc.orig
-+++ ./services/device/serial/serial_io_handler_posix.cc
-@@ -6,6 +6,7 @@
-
- #include <sys/ioctl.h>
- #include <termios.h>
-+#include <asm-generic/ioctls.h>
-
- #include "base/posix/eintr_wrapper.h"
-
-diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
-index a80ea16..55a2abf 100644
---- third_party/ots/include/opentype-sanitiser.h
-+++ third_party/ots/include/opentype-sanitiser.h
-@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
- #define htonl(x) _byteswap_ulong (x)
- #define htons(x) _byteswap_ushort (x)
- #else
-+#include <sys/types.h>
- #include <arpa/inet.h>
- #include <stdint.h>
- #endif
---- ./base/logging.cc.orig
+--- ./base/logging.cc
+++ ./base/logging.cc
-@@ -545,8 +545,7 @@
+@@ -621,8 +621,7 @@
LogMessage::~LogMessage() {
size_t stack_start = stream_.tellp();
@@ -107,36 +83,34 @@ index a80ea16..55a2abf 100644
+#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
if (severity_ == LOG_FATAL && !base::debug::BeingDebugged()) {
// Include a stack trace on a fatal, unless a debugger is attached.
- base::debug::StackTrace trace;
---- ./net/dns/dns_config_service_posix.cc.orig
+ base::debug::StackTrace stack_trace;
+--- ./net/dns/dns_config_service_posix.cc
+++ ./net/dns/dns_config_service_posix.cc
-@@ -122,7 +122,7 @@
+@@ -150,7 +150,7 @@
+ #if !defined(OS_ANDROID)
ConfigParsePosixResult result;
- config->unhandled_options = false;
// TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia.
-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA)
+#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE)
// Note: res_ninit in glibc always returns 0 and sets RES_INIT.
// res_init behaves the same way.
memset(&_res, 0, sizeof(_res));
---- base/native_library_posix.cc.orig 2016-11-17 01:45:50.032002326 +0100
-+++ base/native_library_posix.cc 2016-11-17 01:46:23.729001549 +0100
+--- base/native_library_posix.cc
++++ base/native_library_posix.cc
@@ -12,6 +12,10 @@
#include "base/strings/utf_string_conversions.h"
- #include "base/threading/thread_restrictions.h"
-
+ #include "base/threading/scoped_blocking_call.h"
+
+#ifndef RTLD_DEEPBIND
+#define RTLD_DEEPBIND 0
+#endif
+
namespace base {
-
+
std::string NativeLibraryLoadError::ToString() const {
-diff --git ./third_party/blink/renderer/platform/wtf/stack_util.cc b/third_party/blink/renderer/platform/wtf/stack_util.cc
-index 10f1c0d..8e86a2e 100644
--- ./third_party/blink/renderer/platform/wtf/stack_util.cc
+++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
-@@ -28,7 +28,7 @@ size_t GetUnderestimatedStackSize() {
+@@ -29,7 +29,7 @@
// FIXME: On Mac OSX and Linux, this method cannot estimate stack size
// correctly for the main thread.
@@ -144,8 +118,8 @@ index 10f1c0d..8e86a2e 100644
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \
defined(OS_FUCHSIA)
// pthread_getattr_np() can fail if the thread is not invoked by
- // pthread_create() (e.g., the main thread of webkit_unit_tests).
-@@ -96,7 +96,7 @@ size_t GetUnderestimatedStackSize() {
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -97,7 +97,7 @@
}
void* GetStackStart() {
@@ -154,7 +128,7 @@ index 10f1c0d..8e86a2e 100644
defined(OS_FUCHSIA)
pthread_attr_t attr;
int error;
---- third_party/lss/linux_syscall_support.h.orig
+--- third_party/lss/linux_syscall_support.h
+++ third_party/lss/linux_syscall_support.h
@@ -132,15 +132,18 @@
@@ -176,7 +150,7 @@ index 10f1c0d..8e86a2e 100644
#endif
#if defined(__ANDROID__) && defined(__x86_64__)
-@@ -4545,12 +4548,14 @@
+@@ -4517,12 +4518,14 @@
# endif
#endif
@@ -192,21 +166,22 @@ index 10f1c0d..8e86a2e 100644
#endif
#if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
---- third_party/crashpad/crashpad/util/linux/ptracer.cc.orig
+--- third_party/crashpad/crashpad/util/linux/ptracer.cc
+++ third_party/crashpad/crashpad/util/linux/ptracer.cc
-@@ -28,6 +28,9 @@
+@@ -28,6 +28,10 @@
#include <asm/ldt.h>
- #include <asm/ptrace-abi.h>
#endif
+
+#if defined(ARCH_CPU_ARM_FAMILY)
+#include <asm/ptrace.h>
+#endif
-
++
namespace crashpad {
---- third_party/crashpad/crashpad/util/linux/thread_info.h.orig
+ namespace {
+--- third_party/crashpad/crashpad/util/linux/thread_info.h
+++ third_party/crashpad/crashpad/util/linux/thread_info.h
-@@ -232,7 +232,7 @@
+@@ -273,7 +273,7 @@
"Size mismatch");
#elif defined(ARCH_CPU_ARMEL)
static_assert(sizeof(f32_t::fpregs) == sizeof(user_fpregs), "Size mismatch");
diff --git a/community/chromium/musl-hacks.patch b/community/chromium/musl-hacks.patch
index d7c61a625b..45d938b78f 100644
--- a/community/chromium/musl-hacks.patch
+++ b/community/chromium/musl-hacks.patch
@@ -1,6 +1,6 @@
---- ./base/debug/stack_trace.cc.orig 2018-12-08 14:11:25.303475116 +0100
-+++ ./base/debug/stack_trace.cc 2018-12-08 18:00:43.874946999 +0100
-@@ -229,7 +229,7 @@
+--- ./base/debug/stack_trace.cc
++++ ./base/debug/stack_trace.cc
+@@ -233,7 +233,7 @@
}
std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
std::stringstream stream;
@@ -9,9 +9,9 @@
OutputToStreamWithPrefix(&stream, prefix_string);
#endif
return stream.str();
---- ./net/socket/udp_socket_posix.cc.orig 2019-07-03 13:13:46.034342649 -0400
-+++ ./net/socket/udp_socket_posix.cc 2019-07-03 13:23:53.117081909 -0400
-@@ -1194,7 +1194,7 @@
+--- ./net/socket/udp_socket_posix.cc
++++ ./net/socket/udp_socket_posix.cc
+@@ -1191,7 +1191,7 @@
msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
msgvec->reserve(buffers.size());
for (size_t j = 0; j < buffers.size(); j++)
@@ -20,3 +20,15 @@
int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
SendResult send_result(0, 0, std::move(buffers));
if (result < 0) {
+diff --git a/chrome/common/string_matching/fuzzy_tokenized_string_match.cc b/chrome/common/string_matching/fuzzy_tokenized_string_match.cc
+index 8351fa7..7ace813 100644
+--- ./chrome/common/string_matching/fuzzy_tokenized_string_match.cc
++++ ./chrome/common/string_matching/fuzzy_tokenized_string_match.cc
+@@ -6,6 +6,7 @@
+
+ #include <algorithm>
+ #include <iterator>
++#include <cmath>
+
+ #include "base/i18n/case_conversion.h"
+ #include "base/metrics/field_trial_params.h"
diff --git a/community/chromium/musl-libc++.patch b/community/chromium/musl-libc++.patch
index 088d80fad5..1e26f65b69 100644
--- a/community/chromium/musl-libc++.patch
+++ b/community/chromium/musl-libc++.patch
@@ -1,8 +1,6 @@
-diff --git a/buildtools/third_party/libc++/trunk/include/locale b/buildtools/third_party/libc++/trunk/include/locale
-index d29a2dc..53998bc 100644
--- buildtools/third_party/libc++/trunk/include/locale
+++ buildtools/third_party/libc++/trunk/include/locale
-@@ -11,6 +11,15 @@
+@@ -10,6 +10,15 @@
#ifndef _LIBCPP_LOCALE
#define _LIBCPP_LOCALE
@@ -18,25 +16,23 @@ index d29a2dc..53998bc 100644
/*
locale synopsis
-diff --git a/buildtools/third_party/libc++/trunk/src/locale.cpp b/buildtools/third_party/libc++/trunk/src/locale.cpp
-index 4163c2c..3d1902a 100644
---- a/buildtools/third_party/libc++/trunk/src/locale.cpp
+--- buildtools/third_party/libc++/trunk/src/locale.cpp
+++ buildtools/third_party/libc++/trunk/src/locale.cpp
-@@ -1028,11 +1028,11 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
+@@ -1019,11 +1019,11 @@
return low;
}
-#if defined(__EMSCRIPTEN__)
-+//#if defined(__EMSCRIPTEN__)
++// #if defined(__EMSCRIPTEN__)
extern "C" const unsigned short ** __ctype_b_loc();
extern "C" const int ** __ctype_tolower_loc();
extern "C" const int ** __ctype_toupper_loc();
-#endif
-+//#endif
++// #endif
#ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
const ctype<char>::mask*
-@@ -1136,12 +1136,10 @@ ctype<char>::classic_table() _NOEXCEPT
+@@ -1127,12 +1127,10 @@
#elif defined(_AIX)
return (const unsigned int *)__lc_ctype_ptr->obj->mask;
#else
diff --git a/community/chromium/musl-sandbox.patch b/community/chromium/musl-sandbox.patch
index f485f6cc75..71af19fb88 100644
--- a/community/chromium/musl-sandbox.patch
+++ b/community/chromium/musl-sandbox.patch
@@ -1,8 +1,6 @@
-diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-index 348ab6e..4550f9e 100644
--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
-@@ -139,21 +139,11 @@ namespace sandbox {
+@@ -139,21 +139,11 @@
// present (as in newer versions of posix_spawn).
ResultExpr RestrictCloneToThreadsAndEPERMFork() {
const Arg<unsigned long> flags(0);
@@ -29,7 +27,7 @@ index 348ab6e..4550f9e 100644
// The following two flags are the two important flags in any vfork-emulating
// clone call. EPERM any clone call that contains both of them.
-@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+@@ -163,7 +153,7 @@
AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
(flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
@@ -38,11 +36,9 @@ index 348ab6e..4550f9e 100644
.ElseIf(is_fork_or_clone_vfork, Error(EPERM))
.Else(CrashSIGSYSClone());
}
-diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-index 7dbcc87..589262f 100644
--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
-@@ -391,6 +391,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+@@ -392,6 +392,7 @@
#if defined(__i386__)
case __NR_waitpid:
#endif
@@ -50,7 +46,7 @@ index 7dbcc87..589262f 100644
return true;
case __NR_clone: // Should be parameter-restricted.
case __NR_setns: // Privileged.
-@@ -403,7 +404,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+@@ -404,7 +405,6 @@
#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
case __NR_set_thread_area:
#endif
@@ -58,7 +54,7 @@ index 7dbcc87..589262f 100644
case __NR_unshare:
#if !defined(__mips__) && !defined(__aarch64__)
case __NR_vfork:
-@@ -513,6 +513,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+@@ -514,6 +514,8 @@
case __NR_mlock:
case __NR_munlock:
case __NR_munmap:
@@ -67,7 +63,7 @@ index 7dbcc87..589262f 100644
return true;
case __NR_madvise:
case __NR_mincore:
-@@ -530,7 +532,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+@@ -531,7 +533,6 @@
case __NR_modify_ldt:
#endif
case __NR_mprotect:
@@ -75,8 +71,6 @@ index 7dbcc87..589262f 100644
case __NR_msync:
case __NR_munlockall:
case __NR_readahead:
-diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
-index 59d0eab..7ae7002 100644
--- ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
@@ -1063,4 +1063,8 @@
@@ -88,8 +82,6 @@ index 59d0eab..7ae7002 100644
+#endif
+
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
-diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
-index 1addd53..7843b5e 100644
--- ./sandbox/linux/system_headers/arm_linux_syscalls.h
+++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
@@ -1385,6 +1385,10 @@
@@ -103,8 +95,6 @@ index 1addd53..7843b5e 100644
// ARM private syscalls.
#if !defined(__ARM_NR_BASE)
#define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
-diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h b/sandbox/linux/system_headers/mips64_linux_syscalls.h
-index ec75815..612fcfa 100644
--- ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
@@ -1271,4 +1271,8 @@
@@ -112,12 +102,10 @@ index ec75815..612fcfa 100644
#endif
+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_Linux + 318)
++#define __NR_membarrier (__NR_Linux 318)
+#endif
+
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
-diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h
-index ddbf97f..1742acd 100644
--- ./sandbox/linux/system_headers/mips_linux_syscalls.h
+++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
@@ -1433,4 +1433,8 @@
@@ -125,26 +113,10 @@ index ddbf97f..1742acd 100644
#endif
+#if !defined(__NR_membarrier)
-+#define __NR_membarrier (__NR_Linux + 358)
++#define __NR_membarrier (__NR_Linux 358)
+#endif
+
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
-diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
-index a6afc62..7ed0a3b 100644
---- ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
-+++ ./sandbox/linux/system_headers/x86_32_linux_syscalls.h
-@@ -1422,5 +1422,9 @@
- #define __NR_memfd_create 356
- #endif
-
-+#if !defined(__NR_membarrier)
-+#define __NR_membarrier 375
-+#endif
-+
- #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
-
-diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
-index 349504a..ea3c7c9 100644
--- ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
@@ -1290,5 +1290,9 @@
@@ -157,11 +129,9 @@ index 349504a..ea3c7c9 100644
+
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
-diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc b/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-index 017f13c..50aeec3 100644
--- ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+++ ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
-@@ -88,10 +88,10 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
+@@ -88,10 +88,10 @@
case __NR_sysinfo:
case __NR_times:
case __NR_uname:
@@ -174,3 +144,15 @@ index 017f13c..50aeec3 100644
case __NR_sched_setscheduler:
return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno);
case __NR_prlimit64:
+diff --git a/sandbox/linux/system_headers/linux_syscalls.h b/sandbox/linux/system_headers/linux_syscalls.h
+index 2b78a0c..b6fedb5 100644
+--- ./sandbox/linux/system_headers/linux_syscalls.h
++++ ./sandbox/linux/system_headers/linux_syscalls.h
+@@ -10,6 +10,7 @@
+ #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
+
+ #include "build/build_config.h"
++#include <sys/syscall.h>
+
+ #if defined(__x86_64__)
+ #include "sandbox/linux/system_headers/x86_64_linux_syscalls.h"
diff --git a/community/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch b/community/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch
index 33a8ea32c9..768027d2be 100644
--- a/community/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch
+++ b/community/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch
@@ -1,10 +1,8 @@
Use monotonic clock for pthread_cond_timedwait with musl too.
-diff --git a/v8/src/base/platform/condition-variable.cc b/v8/src/base/platform/condition-variable.cc
-index 5ea7083..c13027e 100644
--- ./v8/src/base/platform/condition-variable.cc
+++ ./v8/src/base/platform/condition-variable.cc
-@@ -16,7 +16,7 @@ namespace base {
+@@ -16,7 +16,7 @@
ConditionVariable::ConditionVariable() {
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
@@ -13,7 +11,7 @@ index 5ea7083..c13027e 100644
// On Free/Net/OpenBSD and Linux with glibc we can change the time
// source for pthread_cond_timedwait() to use the monotonic clock.
pthread_condattr_t attr;
-@@ -92,7 +92,7 @@ bool ConditionVariable::WaitFor(Mutex* mutex, const TimeDelta& rel_time) {
+@@ -92,7 +92,7 @@
&native_handle_, &mutex->native_handle(), &ts);
#else
#if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
diff --git a/community/chromium/nasm.patch b/community/chromium/nasm.patch
index f5f85bc00f..ff22a6f3d8 100644
--- a/community/chromium/nasm.patch
+++ b/community/chromium/nasm.patch
@@ -1,5 +1,3 @@
-diff --git a/third_party/nasm/config/config-linux.h b/third_party/nasm/config/config-linux.h
-index 7eb7c20..3bdc2eb 100644
--- ./third_party/nasm/config/config-linux.h
+++ ./third_party/nasm/config/config-linux.h
@@ -117,7 +117,7 @@
diff --git a/community/chromium/no-execinfo.patch b/community/chromium/no-execinfo.patch
index 4bfda6638c..5e1a1652ba 100644
--- a/community/chromium/no-execinfo.patch
+++ b/community/chromium/no-execinfo.patch
@@ -1,4 +1,4 @@
---- ./base/debug/stack_trace_posix.cc.orig
+--- ./base/debug/stack_trace_posix.cc
+++ ./base/debug/stack_trace_posix.cc
@@ -27,7 +27,7 @@
#if !defined(USE_SYMBOLIZE)
@@ -9,7 +9,7 @@
#include <execinfo.h>
#endif
-@@ -86,7 +86,7 @@
+@@ -88,7 +88,7 @@
// Note: code in this function is NOT async-signal safe (std::string uses
// malloc internally).
@@ -18,16 +18,7 @@
std::string::size_type search_from = 0;
while (search_from < text->size()) {
// Look for the start of a mangled symbol, from search_from.
-@@ -121,7 +121,7 @@
- search_from = mangled_start + 2;
- }
- }
--#endif // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif // defined(__GLIBC__) && !defined(_AIX)
- }
- #endif // !defined(USE_SYMBOLIZE)
-
-@@ -133,7 +133,7 @@
+@@ -135,7 +135,7 @@
virtual ~BacktraceOutputHandler() = default;
};
@@ -36,16 +27,7 @@
void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
// This should be more than enough to store a 64-bit number in hex:
// 16 hex digits + 1 for null-terminator.
-@@ -216,7 +216,7 @@
- }
- #endif // defined(USE_SYMBOLIZE)
- }
--#endif // !defined(__UCLIBC__) && !defined(_AIX)
-+#endif // defined(__GLIBC__) && !defined(_AIX)
-
- void PrintToStderr(const char* output) {
- // NOTE: This code MUST be async-signal safe (it's used by in-process
-@@ -812,7 +812,7 @@
+@@ -834,7 +834,7 @@
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
@@ -54,7 +36,7 @@
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
return base::saturated_cast<size_t>(backtrace(trace, count));
-@@ -825,13 +825,13 @@
+@@ -847,13 +847,13 @@
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
diff --git a/community/chromium/no-mallinfo.patch b/community/chromium/no-mallinfo.patch
index 0045bd4bd0..9f859b8808 100644
--- a/community/chromium/no-mallinfo.patch
+++ b/community/chromium/no-mallinfo.patch
@@ -1,16 +1,14 @@
---- base/trace_event/malloc_dump_provider.cc.orig
+--- base/trace_event/malloc_dump_provider.cc
+++ base/trace_event/malloc_dump_provider.cc
-@@ -243,7 +243,7 @@
- allocated_objects_count = main_heap_info.block_count;
+@@ -132,7 +132,7 @@
+ }
#elif defined(OS_FUCHSIA)
// TODO(fuchsia): Port, see https://crbug.com/706592.
-#else
+#elif defined(__GLIBC__)
struct mallinfo info = mallinfo();
- DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
-
-diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc
-index 0eb5c1f..8af7799 100644
+ #if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER)
+ // Sanitizers override mallinfo.
--- base/process/process_metrics_posix.cc
+++ base/process/process_metrics_posix.cc
@@ -110,17 +110,16 @@
diff --git a/community/chromium/resolver.patch b/community/chromium/resolver.patch
index bcf32995cf..18974790fa 100644
--- a/community/chromium/resolver.patch
+++ b/community/chromium/resolver.patch
@@ -1,5 +1,3 @@
-diff --git a/net/dns/dns_reloader.cc b/net/dns/dns_reloader.cc
-index 03e248c..1a7b237 100644
--- ./net/dns/dns_reloader.cc
+++ ./net/dns/dns_reloader.cc
@@ -4,8 +4,7 @@
@@ -12,11 +10,9 @@ index 03e248c..1a7b237 100644
#include <resolv.h>
-diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
-index 3c75dde..c748d94 100644
--- ./net/dns/host_resolver_manager.cc
+++ ./net/dns/host_resolver_manager.cc
-@@ -2386,8 +2386,7 @@ HostResolverManager::HostResolverManager(const Options& options,
+@@ -2747,8 +2747,7 @@
NetworkChangeNotifier::AddConnectionTypeObserver(this);
if (system_dns_config_notifier_)
system_dns_config_notifier_->AddObserver(this);
@@ -26,11 +22,9 @@ index 3c75dde..c748d94 100644
EnsureDnsReloaderInit();
#endif
-diff --git a/net/dns/host_resolver_proc.cc b/net/dns/host_resolver_proc.cc
-index 90d9958..71d9b4a 100644
--- ./net/dns/host_resolver_proc.cc
+++ ./net/dns/host_resolver_proc.cc
-@@ -197,8 +197,7 @@ int SystemHostResolverCall(const std::string& host,
+@@ -159,8 +159,7 @@
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
base::BlockingType::WILL_BLOCK);
@@ -39,6 +33,4 @@ index 90d9958..71d9b4a 100644
+#if defined(__GLIBC__)
DnsReloaderMaybeReload();
#endif
- int err = getaddrinfo(host.c_str(), nullptr, &hints, &ai);
---- ./net/dns/host_resolver_manager.cc.orig
-+++ ./net/dns/host_resolver_manager.cc
+ base::Optional<AddressInfo> ai;
diff --git a/community/chromium/swiftshader.patch b/community/chromium/swiftshader.patch
index 5b2deb86fc..989b83e555 100644
--- a/community/chromium/swiftshader.patch
+++ b/community/chromium/swiftshader.patch
@@ -1,13 +1,3 @@
---- ./third_party/swiftshader/src/Common/Socket.cpp
-+++ ./third_party/swiftshader/src/Common/Socket.cpp
-@@ -17,6 +17,7 @@
- #if defined(_WIN32)
- #include <ws2tcpip.h>
- #else
-+ #include <sys/select.h>
- #include <unistd.h>
- #include <netdb.h>
- #include <netinet/in.h>
--- ./third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
+++ ./third_party/swiftshader/third_party/llvm-subzero/build/Linux/include/llvm/Config/config.h
@@ -14,7 +14,7 @@
@@ -15,7 +5,7 @@
/* Define to 1 if you have the `backtrace' function. */
-#define HAVE_BACKTRACE 1
-+/* #undef HAVE_BACKTRACE */
++/* #define HAVE_BACKTRACE 1 */
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
/* #undef HAVE_CRASHREPORTERCLIENT_H */
@@ -24,7 +14,7 @@
/* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
-+/* #undef HAVE_EXECINFO_H */
++/*#undef HAVE_EXECINFO_H 1 */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
@@ -33,11 +23,11 @@
/* Define to 1 if you have the `mallinfo' function. */
-#define HAVE_MALLINFO 1
-+/* #undef HAVE_MALLINFO */
++/* #undef HAVE_MALLINFO 1*/
/* Define to 1 if you have the <malloc.h> header file. */
-#define HAVE_MALLOC_H 1
-+/* #undef HAVE_MALLOC_H */
++/* #undef HAVE_MALLOC_H 1 */
/* Define to 1 if you have the <malloc/malloc.h> header file. */
/* #undef HAVE_MALLOC_MALLOC_H */
diff --git a/community/chromium/upstream-cros-search-service-Include-cmath-for-std-pow.patch b/community/chromium/upstream-cros-search-service-Include-cmath-for-std-pow.patch
new file mode 100644
index 0000000000..200478e607
--- /dev/null
+++ b/community/chromium/upstream-cros-search-service-Include-cmath-for-std-pow.patch
@@ -0,0 +1,35 @@
+From 8273f4d3130e06fd8b6bef87b07c936304b971d9 Mon Sep 17 00:00:00 2001
+From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Date: Tue, 10 Dec 2019 20:59:57 +0000
+Subject: [PATCH] [cros search service]: Include <cmath> for std::pow()
+
+IWYU. Follow up to commit 2b2ea3c09b ("[cros search service] Move shared
+string matching functions to //chrome"), which broke the libstdc++ build:
+
+ ../../chrome/common/string_matching/fuzzy_tokenized_string_match.cc:199:14: error: no member named 'pow' in namespace 'std'
+ std::pow(partial_match_penalty_rate, long_start - current - 1);
+ ~~~~~^
+
+Bug: 957519
+Change-Id: I66f61cb4f93cfa0bfa3d1b00ba391ddd8f31a7fb
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1960310
+Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Reviewed-by: Jia Meng <jiameng@chromium.org>
+Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Cr-Commit-Position: refs/heads/master@{#723499}
+---
+ chrome/common/string_matching/fuzzy_tokenized_string_match.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/chrome/common/string_matching/fuzzy_tokenized_string_match.cc b/chrome/common/string_matching/fuzzy_tokenized_string_match.cc
+index 8351fa701e4..884ef638c61 100644
+--- chrome/common/string_matching/fuzzy_tokenized_string_match.cc
++++ chrome/common/string_matching/fuzzy_tokenized_string_match.cc
+@@ -5,6 +5,7 @@
+ #include "chrome/common/string_matching/fuzzy_tokenized_string_match.h"
+
+ #include <algorithm>
++#include <cmath>
+ #include <iterator>
+
+ #include "base/i18n/case_conversion.h"
diff --git a/community/chromium/upstream-fix-building-with-unbundled-libxml.patch b/community/chromium/upstream-fix-building-with-unbundled-libxml.patch
new file mode 100644
index 0000000000..68e8bf44d1
--- /dev/null
+++ b/community/chromium/upstream-fix-building-with-unbundled-libxml.patch
@@ -0,0 +1,127 @@
+From d3afade220ddb307e16a6dd4f2b0ec88b2af91e7 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Tue, 28 Jan 2020 18:16:54 +0000
+Subject: [PATCH] Fix building with unbundled libxml
+
+Add new targets to libxml.gn that were added in
+ https://chromium-review.googlesource.com/c/chromium/src/+/1894877
+Adjust includes to use system libxml headers too
+
+Bug: 1043042
+Change-Id: I948c063e212e49b9e7f42fed2b8bf7f4af042ca7
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2007110
+Reviewed-by: Robert Sesek <rsesek@chromium.org>
+Reviewed-by: Daniel Cheng <dcheng@chromium.org>
+Reviewed-by: Nico Weber <thakis@chromium.org>
+Commit-Queue: Robert Sesek <rsesek@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#735957}
+---
+ build/linux/unbundle/libxml.gn | 41 ++++++++++++++++++++--
+ third_party/libxml/chromium/libxml_utils.h | 4 +--
+ third_party/libxml/chromium/xml_reader.cc | 3 +-
+ third_party/libxml/chromium/xml_writer.cc | 3 +-
+ 4 files changed, 45 insertions(+), 6 deletions(-)
+
+diff --git build/linux/unbundle/libxml.gn build/linux/unbundle/libxml.gn
+index c481bd3547b..3587881eea8 100644
+--- build/linux/unbundle/libxml.gn
++++ build/linux/unbundle/libxml.gn
+@@ -8,11 +8,48 @@ pkg_config("system_libxml") {
+ packages = [ "libxml-2.0" ]
+ }
+
+-static_library("libxml") {
++source_set("libxml") {
++ public_configs = [ ":system_libxml" ]
++}
++
++static_library("libxml_utils") {
++ # Do not expand this visibility list without first consulting with the
++ # Security Team.
++ visibility = [
++ ":xml_reader",
++ ":xml_writer",
++ "//base/test:test_support",
++ "//services/data_decoder:xml_parser_fuzzer",
++ ]
+ sources = [
+ "chromium/libxml_utils.cc",
+ "chromium/libxml_utils.h",
+ ]
+-
+ public_configs = [ ":system_libxml" ]
+ }
++
++static_library("xml_reader") {
++ # Do not expand this visibility list without first consulting with the
++ # Security Team.
++ visibility = [
++ "//base/test:test_support",
++ "//components/policy/core/common:unit_tests",
++ "//services/data_decoder:*",
++ "//tools/traffic_annotation/auditor:auditor_sources",
++ ]
++ sources = [
++ "chromium/xml_reader.cc",
++ "chromium/xml_reader.h",
++ ]
++ deps = [ ":libxml_utils" ]
++}
++
++static_library("xml_writer") {
++ # The XmlWriter is considered safe to use from any target.
++ visibility = [ "*" ]
++ sources = [
++ "chromium/xml_writer.cc",
++ "chromium/xml_writer.h",
++ ]
++ deps = [ ":libxml_utils" ]
++}
+diff --git third_party/libxml/chromium/libxml_utils.h third_party/libxml/chromium/libxml_utils.h
+index ff969fab540..8b2383f9c8b 100644
+--- third_party/libxml/chromium/libxml_utils.h
++++ third_party/libxml/chromium/libxml_utils.h
+@@ -5,9 +5,9 @@
+ #ifndef THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
+ #define THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_
+
+-#include <string>
++#include <libxml/xmlreader.h>
+
+-#include "third_party/libxml/src/include/libxml/xmlreader.h"
++#include <string>
+
+ // libxml uses a global error function pointer for reporting errors.
+ // A ScopedXmlErrorFunc object lets you change the global error pointer
+diff --git third_party/libxml/chromium/xml_reader.cc third_party/libxml/chromium/xml_reader.cc
+index 92464f4cbcc..899ccefb7c8 100644
+--- third_party/libxml/chromium/xml_reader.cc
++++ third_party/libxml/chromium/xml_reader.cc
+@@ -4,10 +4,11 @@
+
+ #include "third_party/libxml/chromium/xml_reader.h"
+
++#include <libxml/xmlreader.h>
++
+ #include <vector>
+
+ #include "third_party/libxml/chromium/libxml_utils.h"
+-#include "third_party/libxml/src/include/libxml/xmlreader.h"
+
+ using internal::XmlStringToStdString;
+
+diff --git third_party/libxml/chromium/xml_writer.cc third_party/libxml/chromium/xml_writer.cc
+index 51fce8ebeb1..7c58031fe2d 100644
+--- third_party/libxml/chromium/xml_writer.cc
++++ third_party/libxml/chromium/xml_writer.cc
+@@ -4,8 +4,9 @@
+
+ #include "third_party/libxml/chromium/xml_writer.h"
+
++#include <libxml/xmlwriter.h>
++
+ #include "third_party/libxml/chromium/libxml_utils.h"
+-#include "third_party/libxml/src/include/libxml/xmlwriter.h"
+
+ XmlWriter::XmlWriter() : writer_(nullptr), buffer_(nullptr) {}
+
diff --git a/community/chromium/upstream-move-RemoteTreeNode-declaration.patch b/community/chromium/upstream-move-RemoteTreeNode-declaration.patch
new file mode 100644
index 0000000000..81b7b0038a
--- /dev/null
+++ b/community/chromium/upstream-move-RemoteTreeNode-declaration.patch
@@ -0,0 +1,237 @@
+From cdf3e81ff49b200213d67d65558f2919222b60ab Mon Sep 17 00:00:00 2001
+From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Date: Mon, 16 Dec 2019 11:39:11 +0000
+Subject: [PATCH] BookmarkModelMerger: Move RemoteTreeNode declaration to
+ header.
+
+This fixes the build with libstdc++ after commit 8f5dad93e58 ("Fix CHECK
+failure due to untracked local nodes"):
+
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/stl_pair.h:215:11: error: field has incomplete type 'sync_bookmarks::BookmarkModelMerger::RemoteTreeNode'
+ _T2 second; /// @c second is a copy of the second object
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/ext/aligned_buffer.h:91:28: note: in instantiation of template class 'std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>' requested here
+ : std::aligned_storage<sizeof(_Tp), __alignof__(_Tp)>
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/hashtable_policy.h:233:43: note: in instantiation of template class '__gnu_cxx::__aligned_buffer<std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode> >' requested here
+ __gnu_cxx::__aligned_buffer<_Value> _M_storage;
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/hashtable_policy.h:264:39: note: in instantiation of template class 'std::__detail::_Hash_node_value_base<std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode> >' requested here
+ struct _Hash_node<_Value, true> : _Hash_node_value_base<_Value>
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/hashtable_policy.h:2028:25: note: in instantiation of template class 'std::__detail::_Hash_node<std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>, true>' requested here
+ rebind_traits<typename __node_type::value_type>;
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/hashtable.h:184:15: note: in instantiation of template class 'std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>, true> > >
+' requested here
+ private __detail::_Hashtable_alloc<
+ ^
+/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/unordered_map.h:105:18: note: in instantiation of template class 'std::_Hashtable<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>, std::allocator<std::pair<con
+st std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char> >, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__deta
+il::_Hashtable_traits<true, false, true> >' requested here
+ _Hashtable _M_h;
+ ^
+../../components/sync_bookmarks/bookmark_model_merger.h:146:22: note: in instantiation of template class 'std::unordered_map<std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode, std::hash<std::string>, std::equal_to<std::__cxx11::basic_string<char> >, std::allocator<std::pair<con
+st std::__cxx11::basic_string<char>, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode> > >' requested here
+ const RemoteForest remote_forest_;
+ ^
+../../components/sync_bookmarks/bookmark_model_merger.h:53:9: note: forward declaration of 'sync_bookmarks::BookmarkModelMerger::RemoteTreeNode'
+ class RemoteTreeNode;
+ ^
+
+Essentially, the problem is that libstdc++'s std::unordered_map<T, U>
+implementation requires both T and U to be fully declared. I raised the
+problem in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92770, and GCC's
+position is that we are relying on undefined behavior according to the C++
+standard (https://eel.is/c++draft/requirements#res.on.functions-2.5).
+
+Bug: 957519
+Change-Id: Ife7e435e516932a795bfbe05b2c910c3272878f0
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1960156
+Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Reviewed-by: Mikel Astiz <mastiz@chromium.org>
+Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
+Cr-Commit-Position: refs/heads/master@{#725070}
+---
+ .../sync_bookmarks/bookmark_model_merger.cc | 89 +++++++------------
+ .../sync_bookmarks/bookmark_model_merger.h | 48 +++++++++-
+ 2 files changed, 80 insertions(+), 57 deletions(-)
+
+diff --git a/components/sync_bookmarks/bookmark_model_merger.cc b/components/sync_bookmarks/bookmark_model_merger.cc
+index eae153eff95..579848ee664 100644
+--- components/sync_bookmarks/bookmark_model_merger.cc
++++ components/sync_bookmarks/bookmark_model_merger.cc
+@@ -5,7 +5,6 @@
+ #include "components/sync_bookmarks/bookmark_model_merger.h"
+
+ #include <algorithm>
+-#include <memory>
+ #include <set>
+ #include <string>
+ #include <utility>
+@@ -205,66 +204,44 @@ UpdatesPerParentId GroupValidUpdatesByParentId(
+
+ } // namespace
+
+-class BookmarkModelMerger::RemoteTreeNode final {
+- public:
+- // Constructs a tree given |update| as root and recursively all descendants by
+- // traversing |*updates_per_parent_id|. |update| and |updates_per_parent_id|
+- // must not be null. All updates |*updates_per_parent_id| must represent valid
+- // updates. Updates corresponding from descendant nodes are moved away from
+- // |*updates_per_parent_id|.
+- static RemoteTreeNode BuildTree(
+- std::unique_ptr<syncer::UpdateResponseData> update,
+- UpdatesPerParentId* updates_per_parent_id);
+-
+- ~RemoteTreeNode() = default;
+-
+- // Allow moves, useful during construction.
+- RemoteTreeNode(RemoteTreeNode&&) = default;
+- RemoteTreeNode& operator=(RemoteTreeNode&&) = default;
+-
+- const syncer::EntityData& entity() const { return *update_->entity; }
+- int64_t response_version() const { return update_->response_version; }
+-
+- // Direct children nodes, sorted by ascending unique position. These are
+- // guaranteed to be valid updates (e.g. IsValidBookmarkSpecifics()).
+- const std::vector<RemoteTreeNode>& children() const { return children_; }
+-
+- // Recursively emplaces all GUIDs (this node and descendants) into
+- // |*guid_to_remote_node_map|, which must not be null.
+- void EmplaceSelfAndDescendantsByGUID(
+- std::unordered_map<std::string, const RemoteTreeNode*>*
+- guid_to_remote_node_map) const {
+- DCHECK(guid_to_remote_node_map);
+-
+- const std::string& guid = entity().specifics.bookmark().guid();
+- if (!guid.empty()) {
+- DCHECK(base::IsValidGUID(guid));
+-
+- // Duplicate GUIDs have been sorted out before.
+- bool success = guid_to_remote_node_map->emplace(guid, this).second;
+- DCHECK(success);
+- }
++BookmarkModelMerger::RemoteTreeNode::RemoteTreeNode() = default;
+
+- for (const RemoteTreeNode& child : children_) {
+- child.EmplaceSelfAndDescendantsByGUID(guid_to_remote_node_map);
+- }
+- }
++BookmarkModelMerger::RemoteTreeNode::~RemoteTreeNode() = default;
++
++BookmarkModelMerger::RemoteTreeNode::RemoteTreeNode(
++ BookmarkModelMerger::RemoteTreeNode&&) = default;
++BookmarkModelMerger::RemoteTreeNode& BookmarkModelMerger::RemoteTreeNode::
++operator=(BookmarkModelMerger::RemoteTreeNode&&) = default;
++
++void BookmarkModelMerger::RemoteTreeNode::EmplaceSelfAndDescendantsByGUID(
++ std::unordered_map<std::string, const RemoteTreeNode*>*
++ guid_to_remote_node_map) const {
++ DCHECK(guid_to_remote_node_map);
++
++ const std::string& guid = entity().specifics.bookmark().guid();
++ if (!guid.empty()) {
++ DCHECK(base::IsValidGUID(guid));
+
+- private:
+- static bool UniquePositionLessThan(const RemoteTreeNode& lhs,
+- const RemoteTreeNode& rhs) {
+- const syncer::UniquePosition a_pos =
+- syncer::UniquePosition::FromProto(lhs.entity().unique_position);
+- const syncer::UniquePosition b_pos =
+- syncer::UniquePosition::FromProto(rhs.entity().unique_position);
+- return a_pos.LessThan(b_pos);
++ // Duplicate GUIDs have been sorted out before.
++ bool success = guid_to_remote_node_map->emplace(guid, this).second;
++ DCHECK(success);
+ }
+
+- RemoteTreeNode() = default;
++ for (const RemoteTreeNode& child : children_) {
++ child.EmplaceSelfAndDescendantsByGUID(guid_to_remote_node_map);
++ }
++}
+
+- std::unique_ptr<syncer::UpdateResponseData> update_;
+- std::vector<RemoteTreeNode> children_;
+-};
++// static
++bool BookmarkModelMerger::RemoteTreeNode::UniquePositionLessThan(
++ const RemoteTreeNode& lhs,
++ const RemoteTreeNode& rhs) {
++ const syncer::UniquePosition a_pos =
++ syncer::UniquePosition::FromProto(lhs.entity().unique_position);
++ const syncer::UniquePosition b_pos =
++ syncer::UniquePosition::FromProto(rhs.entity().unique_position);
++ return a_pos.LessThan(b_pos);
++}
+
+ // static
+ BookmarkModelMerger::RemoteTreeNode
+diff --git a/components/sync_bookmarks/bookmark_model_merger.h b/components/sync_bookmarks/bookmark_model_merger.h
+index 9b592000dc5..bf0783ecf8e 100644
+--- components/sync_bookmarks/bookmark_model_merger.h
++++ components/sync_bookmarks/bookmark_model_merger.h
+@@ -5,6 +5,7 @@
+ #ifndef COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_MERGER_H_
+ #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_MERGER_H_
+
++#include <memory>
+ #include <string>
+ #include <unordered_map>
+ #include <vector>
+@@ -50,7 +51,52 @@ class BookmarkModelMerger {
+
+ private:
+ // Internal representation of a remote tree, composed of nodes.
+- class RemoteTreeNode;
++ class RemoteTreeNode final {
++ private:
++ using UpdatesPerParentId =
++ std::unordered_map<base::StringPiece,
++ syncer::UpdateResponseDataList,
++ base::StringPieceHash>;
++
++ public:
++ // Constructs a tree given |update| as root and recursively all descendants
++ // by traversing |*updates_per_parent_id|. |update| and
++ // |updates_per_parent_id| must not be null. All updates
++ // |*updates_per_parent_id| must represent valid updates. Updates
++ // corresponding from descendant nodes are moved away from
++ // |*updates_per_parent_id|.
++ static RemoteTreeNode BuildTree(
++ std::unique_ptr<syncer::UpdateResponseData> update,
++ UpdatesPerParentId* updates_per_parent_id);
++
++ ~RemoteTreeNode();
++
++ // Allow moves, useful during construction.
++ RemoteTreeNode(RemoteTreeNode&&);
++ RemoteTreeNode& operator=(RemoteTreeNode&&);
++
++ const syncer::EntityData& entity() const { return *update_->entity; }
++ int64_t response_version() const { return update_->response_version; }
++
++ // Direct children nodes, sorted by ascending unique position. These are
++ // guaranteed to be valid updates (e.g. IsValidBookmarkSpecifics()).
++ const std::vector<RemoteTreeNode>& children() const { return children_; }
++
++ // Recursively emplaces all GUIDs (this node and descendants) into
++ // |*guid_to_remote_node_map|, which must not be null.
++ void EmplaceSelfAndDescendantsByGUID(
++ std::unordered_map<std::string, const RemoteTreeNode*>*
++ guid_to_remote_node_map) const;
++
++ private:
++ static bool UniquePositionLessThan(const RemoteTreeNode& lhs,
++ const RemoteTreeNode& rhs);
++
++ RemoteTreeNode();
++
++ std::unique_ptr<syncer::UpdateResponseData> update_;
++ std::vector<RemoteTreeNode> children_;
++ };
+
+ // A forest composed of multiple trees where the root of each tree represents
+ // a permanent node, keyed by server-defined unique tag of the root.
diff --git a/community/chromium/upstream-rebuild-Linux-frame-button-cache-when-activation.patch b/community/chromium/upstream-rebuild-Linux-frame-button-cache-when-activation.patch
new file mode 100644
index 0000000000..e334cde056
--- /dev/null
+++ b/community/chromium/upstream-rebuild-Linux-frame-button-cache-when-activation.patch
@@ -0,0 +1,62 @@
+From d10f885b9327399be9348b780967ebd6b7f2c4bc Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Fri, 7 Feb 2020 22:44:54 +0000
+Subject: [PATCH] Rebuild Linux frame button cache when activation state
+ changes
+
+This fixes an issue where the frame buttons would always render in an
+inactive state on Linux (see repro steps in bug 1049258).
+
+Bug: 1049258
+R=sky
+CC=pkasting
+
+Change-Id: Ic5af33199003e1d1cdf6cedf506e32388ea11fa9
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2044538
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Commit-Queue: Scott Violet <sky@chromium.org>
+Reviewed-by: Scott Violet <sky@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#739585}
+---
+ .../ui/views/frame/desktop_linux_browser_frame_view.cc | 6 +++---
+ .../desktop_aura/desktop_window_tree_host_platform.cc | 3 +++
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc b/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
+index 954e776057f..4f579955675 100644
+--- chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
++++ chrome/browser/ui/views/frame/desktop_linux_browser_frame_view.cc
+@@ -22,13 +22,13 @@ DesktopLinuxBrowserFrameView::DesktopLinuxBrowserFrameView(
+ : OpaqueBrowserFrameView(frame, browser_view, layout),
+ nav_button_provider_(std::move(nav_button_provider)) {}
+
+-DesktopLinuxBrowserFrameView::~DesktopLinuxBrowserFrameView() {}
++DesktopLinuxBrowserFrameView::~DesktopLinuxBrowserFrameView() = default;
+
+ void DesktopLinuxBrowserFrameView::Layout() {
+ // Calling MaybeUpdateCachedFrameButtonImages() from Layout() is sufficient to
+ // catch all cases that could update the appearance, since
+- // DesktopWindowTreeHostPlatform::OnWindowStateChanged() does a layout any
+- // time any properties change.
++ // DesktopWindowTreeHostPlatform::On{Window,Activation}StateChanged() does a
++ // layout any time the maximized and activation state changes, respectively.
+ MaybeUpdateCachedFrameButtonImages();
+ OpaqueBrowserFrameView::Layout();
+ }
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+index 9c695d8e5b1..9662f19aa90 100644
+--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
++++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -677,9 +677,12 @@ void DesktopWindowTreeHostPlatform::OnCloseRequest() {
+ }
+
+ void DesktopWindowTreeHostPlatform::OnActivationChanged(bool active) {
++ if (is_active_ == active)
++ return;
+ is_active_ = active;
+ aura::WindowTreeHostPlatform::OnActivationChanged(active);
+ desktop_native_widget_aura_->HandleActivationChanged(active);
++ ScheduleRelayout();
+ }
+
+ base::Optional<gfx::Size>
diff --git a/community/chromium/upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch b/community/chromium/upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
new file mode 100644
index 0000000000..554919b59d
--- /dev/null
+++ b/community/chromium/upstream-rename-Relayout-in-DesktopWindowTreeHostPlatform.patch
@@ -0,0 +1,64 @@
+From 5a2cd2409c7d65c019ad9f4595a4e85315857ac4 Mon Sep 17 00:00:00 2001
+From: Tom Anderson <thomasanderson@chromium.org>
+Date: Mon, 3 Feb 2020 23:18:46 +0000
+Subject: [PATCH] Rename Relayout() in DesktopWindowTreeHostPlatform to
+ ScheduleRelayout()
+
+R=sky
+
+Bug: None
+Change-Id: I680cafd25935e59a280e3b2baac754d3d5f13a35
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036553
+Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
+Reviewed-by: Scott Violet <sky@chromium.org>
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#737974}
+---
+ .../desktop_aura/desktop_window_tree_host_platform.cc | 6 +++---
+ .../widget/desktop_aura/desktop_window_tree_host_platform.h | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+index 6c00d49eb3f..9c695d8e5b1 100644
+--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
++++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc
+@@ -556,7 +556,7 @@ void DesktopWindowTreeHostPlatform::SetFullscreen(bool fullscreen) {
+ DCHECK_EQ(fullscreen, IsFullscreen());
+
+ if (IsFullscreen() == fullscreen)
+- Relayout();
++ ScheduleRelayout();
+ // Else: the widget will be relaid out either when the window bounds change
+ // or when |platform_window|'s fullscreen state changes.
+ }
+@@ -669,7 +669,7 @@ void DesktopWindowTreeHostPlatform::OnWindowStateChanged(
+ // Now that we have different window properties, we may need to relayout the
+ // window. (The windows code doesn't need this because their window change is
+ // synchronous.)
+- Relayout();
++ ScheduleRelayout();
+ }
+
+ void DesktopWindowTreeHostPlatform::OnCloseRequest() {
+@@ -712,7 +712,7 @@ gfx::Rect DesktopWindowTreeHostPlatform::ToPixelRect(
+ return gfx::ToEnclosingRect(rect_in_pixels);
+ }
+
+-void DesktopWindowTreeHostPlatform::Relayout() {
++void DesktopWindowTreeHostPlatform::ScheduleRelayout() {
+ Widget* widget = native_widget_delegate_->AsWidget();
+ NonClientView* non_client_view = widget->non_client_view();
+ // non_client_view may be NULL, especially during creation.
+diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
+index 89beb8d2245..75a401e02a7 100644
+--- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
++++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.h
+@@ -129,7 +129,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostPlatform
+ gfx::Rect ToPixelRect(const gfx::Rect& rect_in_dip) const;
+
+ private:
+- void Relayout();
++ void ScheduleRelayout();
+
+ Widget* GetWidget();
+ const Widget* GetWidget() const;
diff --git a/community/chromium/upstream-sync-enable-USSPasswords-by-default.patch b/community/chromium/upstream-sync-enable-USSPasswords-by-default.patch
new file mode 100644
index 0000000000..5f3131c900
--- /dev/null
+++ b/community/chromium/upstream-sync-enable-USSPasswords-by-default.patch
@@ -0,0 +1,28 @@
+From eb997db5527c01fd12c321a6abc52b7cff882e50 Mon Sep 17 00:00:00 2001
+From: Mohamed Amir Yosef <mamir@chromium.org>
+Date: Thu, 9 Jan 2020 21:22:19 +0000
+Subject: [PATCH] [Sync] Enable USSPasswords by default
+
+Change-Id: I021cd952d7a2917a8fb7203cabdac612251193df
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1963804
+Auto-Submit: Mohamed Amir Yosef <mamir@chromium.org>
+Reviewed-by: Mikel Astiz <mastiz@chromium.org>
+Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#729902}
+---
+ components/sync/driver/sync_driver_switches.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/components/sync/driver/sync_driver_switches.cc b/components/sync/driver/sync_driver_switches.cc
+index ddff8b91419..999384aa68a 100644
+--- components/sync/driver/sync_driver_switches.cc
++++ components/sync/driver/sync_driver_switches.cc
+@@ -55,7 +55,7 @@ const base::Feature kStopSyncInPausedState{"StopSyncInPausedState",
+
+ // Enable USS implementation of Passwords datatype.
+ const base::Feature kSyncUSSPasswords{"SyncUSSPasswords",
+- base::FEATURE_DISABLED_BY_DEFAULT};
++ base::FEATURE_ENABLED_BY_DEFAULT};
+
+ // Enable USS implementation of Nigori datatype.
+ const base::Feature kSyncUSSNigori{"SyncUSSNigori",