From 4da704c93b1a3b46a159986d86084b857e5e36ba Mon Sep 17 00:00:00 2001 From: Stephan Hartmann Date: Thu, 9 Apr 2020 15:30:25 +0200 Subject: [PATCH] www-client/chromium: security cleanup Bug: https://bugs.gentoo.org/716612 Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Stephan Hartmann Signed-off-by: Mike Gilbert Closes: https://github.com/gentoo/gentoo/pull/15274 --- www-client/chromium/Manifest | 2 - .../chromium/chromium-80.0.3987.162.ebuild | 747 ------------------ .../chromium/chromium-80.0.3987.163.ebuild | 747 ------------------ .../files/chromium-77-system-icu.patch | 20 - .../files/chromium-80-gcc-abstract.patch | 41 - .../chromium-80-gcc-incomplete-type.patch | 229 ------ .../files/chromium-80-gcc-permissive.patch | 33 - .../chromium/files/chromium-80-include.patch | 33 - .../files/chromium-80-unbundle-libxml.patch | 101 --- .../files/chromium-compiler-r10.patch | 185 ----- .../files/chromium-unbundle-zlib-r1.patch | 13 - 11 files changed, 2151 deletions(-) delete mode 100644 www-client/chromium/chromium-80.0.3987.162.ebuild delete mode 100644 www-client/chromium/chromium-80.0.3987.163.ebuild delete mode 100644 www-client/chromium/files/chromium-77-system-icu.patch delete mode 100644 www-client/chromium/files/chromium-80-gcc-abstract.patch delete mode 100644 www-client/chromium/files/chromium-80-gcc-incomplete-type.patch delete mode 100644 www-client/chromium/files/chromium-80-gcc-permissive.patch delete mode 100644 www-client/chromium/files/chromium-80-include.patch delete mode 100644 www-client/chromium/files/chromium-80-unbundle-libxml.patch delete mode 100644 www-client/chromium/files/chromium-compiler-r10.patch delete mode 100644 www-client/chromium/files/chromium-unbundle-zlib-r1.patch diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest index 2cc3c8caf35b..35be393a4e1d 100644 --- a/www-client/chromium/Manifest +++ b/www-client/chromium/Manifest @@ -1,4 +1,2 @@ -DIST chromium-80.0.3987.162.tar.xz 796961972 BLAKE2B 77357adb39f5e49a6c71ba695c9947fb6aad811fc58c5ac21355a30be8beecaa842d2de59028dec58b1805d314e13282c0f386d61ee2014c87ad50ea0dc61121 SHA512 95a6bbe291faccd1a085daec89a3cf27eb00bc62f0b3956c2668568c7cabd67ac4dc02a2aaa093bb2844d4972cd8a7978c4249b2f0ebead038a215f574f68180 -DIST chromium-80.0.3987.163.tar.xz 796981144 BLAKE2B 60b4807f30add0bff5d7d0176cfaee6cdb9de9ac85d60d3e56af01f6cbf3296c473ce09dc96cb81d3aaf43883462cd6d6601e716338d146d8d2705f918f16f31 SHA512 d6c25035870276cc0c8b9608ffd61cbc8d9c5beac3894163433d3b379b1c11ba00973c4268c2128a320407d2086d1c00b0896ec974a7575a4802ea0596d48a1c DIST chromium-81.0.4044.92.tar.xz 785906276 BLAKE2B af8e40391362c5ea182b917b085cfc1c2fe605503621316196e4a60d7031fe3b3075af9040ad756bddbad77058b5210d265731990a828ca6a11829e41c7cb807 SHA512 2d5817c84ac17e7b4d2e4473df841f53a074528e0ac997345ee68db4a9f8b45d84ef50c1d475608428f49ae40fe5315cda9d501ee22b829156c9e533044fb5af DIST chromium-83.0.4100.3.tar.xz 801342020 BLAKE2B 504c4d905f7ed91050f54e19e215fc2827c7299dff75e57282895f6f550ad323070ab49a2c597abfe0e88308d31fe613e8bd5bbcbfbc1b63bbc968148f939332 SHA512 d9037a7db5adad46d562f22e5ee53016170f257678d25acb124c432dc4ed4c0eb936ff9c4e0e39653a33621208e5037924ff94a9c98730da6ef68cb29a5a0f52 diff --git a/www-client/chromium/chromium-80.0.3987.162.ebuild b/www-client/chromium/chromium-80.0.3987.162.ebuild deleted file mode 100644 index 2837b792e8ff..000000000000 --- a/www-client/chromium/chromium-80.0.3987.162.ebuild +++ /dev/null @@ -1,747 +0,0 @@ -# Copyright 2009-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -PYTHON_COMPAT=( python2_7 ) - -CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he - hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr - sv sw ta te th tr uk vi zh-CN zh-TW" - -inherit check-reqs chromium-2 desktop flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs xdg-utils - -DESCRIPTION="Open-source version of Google Chrome web browser" -HOMEPAGE="https://chromium.org/" -SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 ~arm64 ~x86" -IUSE="+closure-compile component-build cups cpu_flags_arm_neon +hangouts kerberos pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine" -RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )" -REQUIRED_USE="component-build? ( !suid )" - -COMMON_DEPEND=" - >=app-accessibility/at-spi2-atk-2.26:2 - app-arch/bzip2:= - cups? ( >=net-print/cups-1.3.11:= ) - >=dev-libs/atk-2.26 - dev-libs/expat:= - dev-libs/glib:2 - system-icu? ( >=dev-libs/icu-65:= ) - >=dev-libs/libxml2-2.9.4-r3:=[icu] - dev-libs/libxslt:= - dev-libs/nspr:= - >=dev-libs/nss-3.26:= - >=dev-libs/re2-0.2019.08.01:= - >=media-libs/alsa-lib-1.0.19:= - media-libs/fontconfig:= - media-libs/freetype:= - >=media-libs/harfbuzz-2.4.0:0=[icu(-)] - media-libs/libjpeg-turbo:= - media-libs/libpng:= - system-libvpx? ( media-libs/libvpx:=[postproc,svc] ) - >=media-libs/openh264-1.6.0:= - pulseaudio? ( media-sound/pulseaudio:= ) - system-ffmpeg? ( - >=media-video/ffmpeg-4:= - || ( - media-video/ffmpeg[-samba] - >=net-fs/samba-4.5.10-r1[-debug(-)] - ) - >=media-libs/opus-1.3.1:= - ) - sys-apps/dbus:= - sys-apps/pciutils:= - virtual/udev - x11-libs/cairo:= - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11:= - x11-libs/libXcomposite:= - x11-libs/libXcursor:= - x11-libs/libXdamage:= - x11-libs/libXext:= - x11-libs/libXfixes:= - >=x11-libs/libXi-1.6.0:= - x11-libs/libXrandr:= - x11-libs/libXrender:= - x11-libs/libXScrnSaver:= - x11-libs/libXtst:= - x11-libs/pango:= - app-arch/snappy:= - media-libs/flac:= - >=media-libs/libwebp-0.4.0:= - sys-libs/zlib:=[minizip] - kerberos? ( virtual/krb5 ) -" -# For nvidia-drivers blocker, see bug #413637 . -RDEPEND="${COMMON_DEPEND} - x11-misc/xdg-utils - virtual/opengl - virtual/ttf-fonts - selinux? ( sec-policy/selinux-chromium ) - tcmalloc? ( ! gn leftovers - base/third_party/libevent - third_party/adobe - third_party/speech-dispatcher - third_party/usb_ids - third_party/xdg-utils - third_party/yasm/run_yasm.py - ) - if ! use system-ffmpeg; then - keeplibs+=( third_party/ffmpeg third_party/opus ) - fi - if ! use system-icu; then - keeplibs+=( third_party/icu ) - fi - if ! use system-libvpx; then - keeplibs+=( third_party/libvpx ) - keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc ) - fi - if use tcmalloc; then - keeplibs+=( third_party/tcmalloc ) - fi - - # Remove most bundled libraries. Some are still needed. - build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die -} - -src_configure() { - # Calling this here supports resumption via FEATURES=keepwork - python_setup - - local myconf_gn="" - - # Make sure the build system will use the right tools, bug #340795. - tc-export AR CC CXX NM - - if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then - # Force clang since gcc is pretty broken at the moment. - CC=${CHOST}-clang - CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - if tc-is-clang; then - myconf_gn+=" is_clang=true clang_use_chrome_plugins=false" - else - myconf_gn+=" is_clang=false" - fi - - # Define a custom toolchain for GN - myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" - - if tc-is-cross-compiler; then - tc-export BUILD_{AR,CC,CXX,NM} - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\"" - myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\"" - else - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" - fi - - # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. - myconf_gn+=" is_debug=false" - - # Component build isn't generally intended for use by end users. It's mostly useful - # for development and debugging. - myconf_gn+=" is_component_build=$(usex component-build true false)" - - myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")" - - # Disable nacl, we can't build without pnacl (http://crbug.com/269560). - myconf_gn+=" enable_nacl=false" - - # Use system-provided libraries. - # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733). - # TODO: use_system_hunspell (upstream changes needed). - # TODO: use_system_libsrtp (bug #459932). - # TODO: use_system_protobuf (bug #525560). - # TODO: use_system_ssl (http://crbug.com/58087). - # TODO: use_system_sqlite (http://crbug.com/22208). - - # libevent: https://bugs.gentoo.org/593458 - local gn_system_libraries=( - flac - fontconfig - freetype - # Need harfbuzz_from_pkgconfig target - #harfbuzz-ng - libdrm - libjpeg - libpng - libwebp - libxml - libxslt - openh264 - re2 - snappy - yasm - zlib - ) - if use system-ffmpeg; then - gn_system_libraries+=( ffmpeg opus ) - fi - if use system-icu; then - gn_system_libraries+=( icu ) - fi - if use system-libvpx; then - gn_system_libraries+=( libvpx ) - fi - build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die - - # See dependency logic in third_party/BUILD.gn - myconf_gn+=" use_system_harfbuzz=true" - - # Disable deprecated libgnome-keyring dependency, bug #713012 - myconf_gn+=" use_gnome_keyring=false" - - # Optional dependencies. - myconf_gn+=" closure_compile=$(usex closure-compile true false)" - myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)" - myconf_gn+=" enable_widevine=$(usex widevine true false)" - myconf_gn+=" use_cups=$(usex cups true false)" - myconf_gn+=" use_kerberos=$(usex kerberos true false)" - myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)" - - # TODO: link_pulseaudio=true for GN. - - myconf_gn+=" fieldtrial_testing_like_official_build=true" - - # Never use bundled gold binary. Disable gold linker flags for now. - # Do not use bundled clang. - # Trying to use gold results in linker crash. - myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false" - - # Disable forced lld, bug 641556 - myconf_gn+=" use_lld=false" - - ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)" - myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)" - myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\"" - - # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . - # Note: these are for Gentoo use ONLY. For your own distribution, - # please get your own set of keys. Feel free to contact chromium@gentoo.org - # for more info. - local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc" - local google_default_client_id="329227923882.apps.googleusercontent.com" - local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu" - myconf_gn+=" google_api_key=\"${google_api_key}\"" - myconf_gn+=" google_default_client_id=\"${google_default_client_id}\"" - myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\"" - local myarch="$(tc-arch)" - - # Avoid CFLAGS problems, bug #352457, bug #390147. - if ! use custom-cflags; then - replace-flags "-Os" "-O2" - strip-flags - - # Prevent linker from running out of address space, bug #471810 . - if use x86; then - filter-flags "-g*" - fi - - # Prevent libvpx build failures. Bug 530248, 544702, 546984. - if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then - filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 - fi - fi - - if [[ $myarch = amd64 ]] ; then - myconf_gn+=" target_cpu=\"x64\"" - ffmpeg_target_arch=x64 - elif [[ $myarch = x86 ]] ; then - myconf_gn+=" target_cpu=\"x86\"" - ffmpeg_target_arch=ia32 - - # This is normally defined by compiler_cpu_abi in - # build/config/compiler/BUILD.gn, but we patch that part out. - append-flags -msse2 -mfpmath=sse -mmmx - elif [[ $myarch = arm64 ]] ; then - myconf_gn+=" target_cpu=\"arm64\"" - ffmpeg_target_arch=arm64 - elif [[ $myarch = arm ]] ; then - myconf_gn+=" target_cpu=\"arm\"" - ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm) - else - die "Failed to determine target arch, got '$myarch'." - fi - - # Make sure that -Werror doesn't get added to CFLAGS by the build system. - # Depending on GCC version the warnings are different and we don't want - # the build to fail because of that. - myconf_gn+=" treat_warnings_as_errors=false" - - # Disable fatal linker warnings, bug 506268. - myconf_gn+=" fatal_linker_warnings=false" - - # Bug 491582. - export TMPDIR="${WORKDIR}/temp" - mkdir -p -m 755 "${TMPDIR}" || die - - # https://bugs.gentoo.org/654216 - addpredict /dev/dri/ #nowarn - - #if ! use system-ffmpeg; then - if false; then - local build_ffmpeg_args="" - if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then - build_ffmpeg_args+=" --disable-asm" - fi - - # Re-configure bundled ffmpeg. See bug #491378 for example reasons. - einfo "Configuring bundled ffmpeg..." - pushd third_party/ffmpeg > /dev/null || die - chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \ - --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die - chromium/scripts/copy_config.sh || die - chromium/scripts/generate_gn.py || die - popd > /dev/null || die - fi - - # Explicitly disable ICU data file support for system-icu builds. - if use system-icu; then - myconf_gn+=" icu_use_data_file=false" - fi - - einfo "Configuring Chromium..." - set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release - echo "$@" - "$@" || die -} - -src_compile() { - # Final link uses lots of file descriptors. - ulimit -n 2048 - - # Calling this here supports resumption via FEATURES=keepwork - python_setup - - #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die - - # Build mksnapshot and pax-mark it. - local x - for x in mksnapshot v8_context_snapshot_generator; do - if tc-is-cross-compiler; then - eninja -C out/Release "host/${x}" - pax-mark m "out/Release/host/${x}" - else - eninja -C out/Release "${x}" - pax-mark m "out/Release/${x}" - fi - done - - # Even though ninja autodetects number of CPUs, we respect - # user's options, for debugging with -j 1 or any other reason. - eninja -C out/Release chrome chromedriver - use suid && eninja -C out/Release chrome_sandbox - - pax-mark m out/Release/chrome - - # Build manpage; bug #684550 - sed -e 's|@@PACKAGE@@|chromium-browser|g; - s|@@MENUNAME@@|Chromium|g;' \ - chrome/app/resources/manpage.1.in > \ - out/Release/chromium-browser.1 || die - - # Build desktop file; bug #706786 - sed -e 's|@@MENUNAME@@|Chromium|g; - s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g; - s|@@PACKAGE@@|chromium-browser|g; - s|\(^Exec=\)/usr/bin/|\1|g;' \ - chrome/installer/linux/common/desktop.template > \ - out/Release/chromium-browser-chromium.desktop || die -} - -src_install() { - local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser" - exeinto "${CHROMIUM_HOME}" - doexe out/Release/chrome - - if use suid; then - newexe out/Release/chrome_sandbox chrome-sandbox - fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" - fi - - doexe out/Release/chromedriver - - local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" ) - sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die - doexe chromium-launcher.sh - - # It is important that we name the target "chromium-browser", - # xdg-utils expect it; bug #355517. - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser - # keep the old symlink around for consistency - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium - - dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver - - # Allow users to override command-line options, bug #357629. - insinto /etc/chromium - newins "${FILESDIR}/chromium.default" "default" - - pushd out/Release/locales > /dev/null || die - chromium_remove_language_paks - popd - - insinto "${CHROMIUM_HOME}" - doins out/Release/*.bin - doins out/Release/*.pak - doins out/Release/*.so - - if ! use system-icu; then - doins out/Release/icudtl.dat - fi - - doins -r out/Release/locales - doins -r out/Release/resources - - if [[ -d out/Release/swiftshader ]]; then - insinto "${CHROMIUM_HOME}/swiftshader" - doins out/Release/swiftshader/*.so - fi - - # Install icons - local branding size - for size in 16 24 32 48 64 128 256 ; do - case ${size} in - 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; - *) branding="chrome/app/theme/chromium" ;; - esac - newicon -s ${size} "${branding}/product_logo_${size}.png" \ - chromium-browser.png - done - - # Install desktop entry - domenu out/Release/chromium-browser-chromium.desktop - - # Install GNOME default application entry (bug #303100). - insinto /usr/share/gnome-control-center/default-apps - newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml - - # Install manpage; bug #684550 - doman out/Release/chromium-browser.1 - dosym chromium-browser.1 /usr/share/man/man1/chromium.1 - - readme.gentoo_create_doc -} - -pkg_postrm() { - xdg_icon_cache_update - xdg_desktop_database_update -} - -pkg_postinst() { - xdg_icon_cache_update - xdg_desktop_database_update - readme.gentoo_print_elog -} diff --git a/www-client/chromium/chromium-80.0.3987.163.ebuild b/www-client/chromium/chromium-80.0.3987.163.ebuild deleted file mode 100644 index db2e6b828695..000000000000 --- a/www-client/chromium/chromium-80.0.3987.163.ebuild +++ /dev/null @@ -1,747 +0,0 @@ -# Copyright 2009-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -PYTHON_COMPAT=( python2_7 ) - -CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he - hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr - sv sw ta te th tr uk vi zh-CN zh-TW" - -inherit check-reqs chromium-2 desktop flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs xdg-utils - -DESCRIPTION="Open-source version of Google Chrome web browser" -HOMEPAGE="https://chromium.org/" -SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm64 ~x86" -IUSE="+closure-compile component-build cups cpu_flags_arm_neon +hangouts kerberos pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine" -RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )" -REQUIRED_USE="component-build? ( !suid )" - -COMMON_DEPEND=" - >=app-accessibility/at-spi2-atk-2.26:2 - app-arch/bzip2:= - cups? ( >=net-print/cups-1.3.11:= ) - >=dev-libs/atk-2.26 - dev-libs/expat:= - dev-libs/glib:2 - system-icu? ( >=dev-libs/icu-65:= ) - >=dev-libs/libxml2-2.9.4-r3:=[icu] - dev-libs/libxslt:= - dev-libs/nspr:= - >=dev-libs/nss-3.26:= - >=dev-libs/re2-0.2019.08.01:= - >=media-libs/alsa-lib-1.0.19:= - media-libs/fontconfig:= - media-libs/freetype:= - >=media-libs/harfbuzz-2.4.0:0=[icu(-)] - media-libs/libjpeg-turbo:= - media-libs/libpng:= - system-libvpx? ( media-libs/libvpx:=[postproc,svc] ) - >=media-libs/openh264-1.6.0:= - pulseaudio? ( media-sound/pulseaudio:= ) - system-ffmpeg? ( - >=media-video/ffmpeg-4:= - || ( - media-video/ffmpeg[-samba] - >=net-fs/samba-4.5.10-r1[-debug(-)] - ) - >=media-libs/opus-1.3.1:= - ) - sys-apps/dbus:= - sys-apps/pciutils:= - virtual/udev - x11-libs/cairo:= - x11-libs/gdk-pixbuf:2 - x11-libs/gtk+:3[X] - x11-libs/libX11:= - x11-libs/libXcomposite:= - x11-libs/libXcursor:= - x11-libs/libXdamage:= - x11-libs/libXext:= - x11-libs/libXfixes:= - >=x11-libs/libXi-1.6.0:= - x11-libs/libXrandr:= - x11-libs/libXrender:= - x11-libs/libXScrnSaver:= - x11-libs/libXtst:= - x11-libs/pango:= - app-arch/snappy:= - media-libs/flac:= - >=media-libs/libwebp-0.4.0:= - sys-libs/zlib:=[minizip] - kerberos? ( virtual/krb5 ) -" -# For nvidia-drivers blocker, see bug #413637 . -RDEPEND="${COMMON_DEPEND} - x11-misc/xdg-utils - virtual/opengl - virtual/ttf-fonts - selinux? ( sec-policy/selinux-chromium ) - tcmalloc? ( ! gn leftovers - base/third_party/libevent - third_party/adobe - third_party/speech-dispatcher - third_party/usb_ids - third_party/xdg-utils - third_party/yasm/run_yasm.py - ) - if ! use system-ffmpeg; then - keeplibs+=( third_party/ffmpeg third_party/opus ) - fi - if ! use system-icu; then - keeplibs+=( third_party/icu ) - fi - if ! use system-libvpx; then - keeplibs+=( third_party/libvpx ) - keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc ) - fi - if use tcmalloc; then - keeplibs+=( third_party/tcmalloc ) - fi - - # Remove most bundled libraries. Some are still needed. - build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die -} - -src_configure() { - # Calling this here supports resumption via FEATURES=keepwork - python_setup - - local myconf_gn="" - - # Make sure the build system will use the right tools, bug #340795. - tc-export AR CC CXX NM - - if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then - # Force clang since gcc is pretty broken at the moment. - CC=${CHOST}-clang - CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - if tc-is-clang; then - myconf_gn+=" is_clang=true clang_use_chrome_plugins=false" - else - myconf_gn+=" is_clang=false" - fi - - # Define a custom toolchain for GN - myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" - - if tc-is-cross-compiler; then - tc-export BUILD_{AR,CC,CXX,NM} - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\"" - myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\"" - else - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" - fi - - # GN needs explicit config for Debug/Release as opposed to inferring it from build directory. - myconf_gn+=" is_debug=false" - - # Component build isn't generally intended for use by end users. It's mostly useful - # for development and debugging. - myconf_gn+=" is_component_build=$(usex component-build true false)" - - myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")" - - # Disable nacl, we can't build without pnacl (http://crbug.com/269560). - myconf_gn+=" enable_nacl=false" - - # Use system-provided libraries. - # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733). - # TODO: use_system_hunspell (upstream changes needed). - # TODO: use_system_libsrtp (bug #459932). - # TODO: use_system_protobuf (bug #525560). - # TODO: use_system_ssl (http://crbug.com/58087). - # TODO: use_system_sqlite (http://crbug.com/22208). - - # libevent: https://bugs.gentoo.org/593458 - local gn_system_libraries=( - flac - fontconfig - freetype - # Need harfbuzz_from_pkgconfig target - #harfbuzz-ng - libdrm - libjpeg - libpng - libwebp - libxml - libxslt - openh264 - re2 - snappy - yasm - zlib - ) - if use system-ffmpeg; then - gn_system_libraries+=( ffmpeg opus ) - fi - if use system-icu; then - gn_system_libraries+=( icu ) - fi - if use system-libvpx; then - gn_system_libraries+=( libvpx ) - fi - build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die - - # See dependency logic in third_party/BUILD.gn - myconf_gn+=" use_system_harfbuzz=true" - - # Disable deprecated libgnome-keyring dependency, bug #713012 - myconf_gn+=" use_gnome_keyring=false" - - # Optional dependencies. - myconf_gn+=" closure_compile=$(usex closure-compile true false)" - myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)" - myconf_gn+=" enable_widevine=$(usex widevine true false)" - myconf_gn+=" use_cups=$(usex cups true false)" - myconf_gn+=" use_kerberos=$(usex kerberos true false)" - myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)" - - # TODO: link_pulseaudio=true for GN. - - myconf_gn+=" fieldtrial_testing_like_official_build=true" - - # Never use bundled gold binary. Disable gold linker flags for now. - # Do not use bundled clang. - # Trying to use gold results in linker crash. - myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false" - - # Disable forced lld, bug 641556 - myconf_gn+=" use_lld=false" - - ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)" - myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)" - myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\"" - - # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys . - # Note: these are for Gentoo use ONLY. For your own distribution, - # please get your own set of keys. Feel free to contact chromium@gentoo.org - # for more info. - local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc" - local google_default_client_id="329227923882.apps.googleusercontent.com" - local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu" - myconf_gn+=" google_api_key=\"${google_api_key}\"" - myconf_gn+=" google_default_client_id=\"${google_default_client_id}\"" - myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\"" - local myarch="$(tc-arch)" - - # Avoid CFLAGS problems, bug #352457, bug #390147. - if ! use custom-cflags; then - replace-flags "-Os" "-O2" - strip-flags - - # Prevent linker from running out of address space, bug #471810 . - if use x86; then - filter-flags "-g*" - fi - - # Prevent libvpx build failures. Bug 530248, 544702, 546984. - if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then - filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 - fi - fi - - if [[ $myarch = amd64 ]] ; then - myconf_gn+=" target_cpu=\"x64\"" - ffmpeg_target_arch=x64 - elif [[ $myarch = x86 ]] ; then - myconf_gn+=" target_cpu=\"x86\"" - ffmpeg_target_arch=ia32 - - # This is normally defined by compiler_cpu_abi in - # build/config/compiler/BUILD.gn, but we patch that part out. - append-flags -msse2 -mfpmath=sse -mmmx - elif [[ $myarch = arm64 ]] ; then - myconf_gn+=" target_cpu=\"arm64\"" - ffmpeg_target_arch=arm64 - elif [[ $myarch = arm ]] ; then - myconf_gn+=" target_cpu=\"arm\"" - ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm) - else - die "Failed to determine target arch, got '$myarch'." - fi - - # Make sure that -Werror doesn't get added to CFLAGS by the build system. - # Depending on GCC version the warnings are different and we don't want - # the build to fail because of that. - myconf_gn+=" treat_warnings_as_errors=false" - - # Disable fatal linker warnings, bug 506268. - myconf_gn+=" fatal_linker_warnings=false" - - # Bug 491582. - export TMPDIR="${WORKDIR}/temp" - mkdir -p -m 755 "${TMPDIR}" || die - - # https://bugs.gentoo.org/654216 - addpredict /dev/dri/ #nowarn - - #if ! use system-ffmpeg; then - if false; then - local build_ffmpeg_args="" - if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then - build_ffmpeg_args+=" --disable-asm" - fi - - # Re-configure bundled ffmpeg. See bug #491378 for example reasons. - einfo "Configuring bundled ffmpeg..." - pushd third_party/ffmpeg > /dev/null || die - chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \ - --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die - chromium/scripts/copy_config.sh || die - chromium/scripts/generate_gn.py || die - popd > /dev/null || die - fi - - # Explicitly disable ICU data file support for system-icu builds. - if use system-icu; then - myconf_gn+=" icu_use_data_file=false" - fi - - einfo "Configuring Chromium..." - set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release - echo "$@" - "$@" || die -} - -src_compile() { - # Final link uses lots of file descriptors. - ulimit -n 2048 - - # Calling this here supports resumption via FEATURES=keepwork - python_setup - - #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die - - # Build mksnapshot and pax-mark it. - local x - for x in mksnapshot v8_context_snapshot_generator; do - if tc-is-cross-compiler; then - eninja -C out/Release "host/${x}" - pax-mark m "out/Release/host/${x}" - else - eninja -C out/Release "${x}" - pax-mark m "out/Release/${x}" - fi - done - - # Even though ninja autodetects number of CPUs, we respect - # user's options, for debugging with -j 1 or any other reason. - eninja -C out/Release chrome chromedriver - use suid && eninja -C out/Release chrome_sandbox - - pax-mark m out/Release/chrome - - # Build manpage; bug #684550 - sed -e 's|@@PACKAGE@@|chromium-browser|g; - s|@@MENUNAME@@|Chromium|g;' \ - chrome/app/resources/manpage.1.in > \ - out/Release/chromium-browser.1 || die - - # Build desktop file; bug #706786 - sed -e 's|@@MENUNAME@@|Chromium|g; - s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g; - s|@@PACKAGE@@|chromium-browser|g; - s|\(^Exec=\)/usr/bin/|\1|g;' \ - chrome/installer/linux/common/desktop.template > \ - out/Release/chromium-browser-chromium.desktop || die -} - -src_install() { - local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser" - exeinto "${CHROMIUM_HOME}" - doexe out/Release/chrome - - if use suid; then - newexe out/Release/chrome_sandbox chrome-sandbox - fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox" - fi - - doexe out/Release/chromedriver - - local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" ) - sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die - doexe chromium-launcher.sh - - # It is important that we name the target "chromium-browser", - # xdg-utils expect it; bug #355517. - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser - # keep the old symlink around for consistency - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium - - dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver - - # Allow users to override command-line options, bug #357629. - insinto /etc/chromium - newins "${FILESDIR}/chromium.default" "default" - - pushd out/Release/locales > /dev/null || die - chromium_remove_language_paks - popd - - insinto "${CHROMIUM_HOME}" - doins out/Release/*.bin - doins out/Release/*.pak - doins out/Release/*.so - - if ! use system-icu; then - doins out/Release/icudtl.dat - fi - - doins -r out/Release/locales - doins -r out/Release/resources - - if [[ -d out/Release/swiftshader ]]; then - insinto "${CHROMIUM_HOME}/swiftshader" - doins out/Release/swiftshader/*.so - fi - - # Install icons - local branding size - for size in 16 24 32 48 64 128 256 ; do - case ${size} in - 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;; - *) branding="chrome/app/theme/chromium" ;; - esac - newicon -s ${size} "${branding}/product_logo_${size}.png" \ - chromium-browser.png - done - - # Install desktop entry - domenu out/Release/chromium-browser-chromium.desktop - - # Install GNOME default application entry (bug #303100). - insinto /usr/share/gnome-control-center/default-apps - newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml - - # Install manpage; bug #684550 - doman out/Release/chromium-browser.1 - dosym chromium-browser.1 /usr/share/man/man1/chromium.1 - - readme.gentoo_create_doc -} - -pkg_postrm() { - xdg_icon_cache_update - xdg_desktop_database_update -} - -pkg_postinst() { - xdg_icon_cache_update - xdg_desktop_database_update - readme.gentoo_print_elog -} diff --git a/www-client/chromium/files/chromium-77-system-icu.patch b/www-client/chromium/files/chromium-77-system-icu.patch deleted file mode 100644 index 1f848d7ee2be..000000000000 --- a/www-client/chromium/files/chromium-77-system-icu.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn -index 4450e40..9ca36dd 100644 ---- a/build/linux/unbundle/icu.gn -+++ b/build/linux/unbundle/icu.gn -@@ -96,6 +96,7 @@ shim_headers("icui18n_shim") { - "unicode/fpositer.h", - "unicode/gender.h", - "unicode/gregocal.h", -+ "unicode/listformatter.h", - "unicode/measfmt.h", - "unicode/measunit.h", - "unicode/measure.h", -@@ -178,7 +179,6 @@ shim_headers("icuuc_shim") { - "unicode/icudataver.h", - "unicode/icuplug.h", - "unicode/idna.h", -- "unicode/listformatter.h", - "unicode/localpointer.h", - "unicode/locdspnm.h", - "unicode/locid.h", diff --git a/www-client/chromium/files/chromium-80-gcc-abstract.patch b/www-client/chromium/files/chromium-80-gcc-abstract.patch deleted file mode 100644 index 190a67258e1d..000000000000 --- a/www-client/chromium/files/chromium-80-gcc-abstract.patch +++ /dev/null @@ -1,41 +0,0 @@ -In file included from ../../third_party/blink/renderer/platform/heap/persistent.h:18, - from ../../third_party/blink/public/platform/web_private_ptr.h:40, - from ../../third_party/blink/public/platform/web_media_stream_track.h:33, - from ../../third_party/blink/public/platform/web_media_stream_source.h:37, - from ../../third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h:19, - from ../../third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc:5: -../../third_party/blink/renderer/platform/wtf/cross_thread_copier.h: In instantiation of 'struct WTF::CrossThreadCopierPassThrough': -../../third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h:169:14: required from here -../../third_party/blink/renderer/platform/wtf/cross_thread_copier.h:80:15: error: invalid abstract return type 'webrtc::VideoTrackInterface' - 80 | static Type Copy(const T& parameter) { return parameter; } - | ^~~~ -In file included from ../../third_party/webrtc/api/peer_connection_interface.h:88, - from ../../third_party/blink/public/platform/web_rtc_peer_connection_handler.h:39, - from ../../third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h:20, - from ../../third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc:5: -../../third_party/webrtc/api/media_stream_interface.h:174:18: note: because the following virtual functions are pure within 'webrtc::VideoTrackInterface': - 174 | class RTC_EXPORT VideoTrackInterface - | ^~~~~~~~~~~~~~~~~~~ -../../third_party/webrtc/api/media_stream_interface.h:48:16: note: 'virtual void webrtc::NotifierInterface::RegisterObserver(webrtc::ObserverInterface*)' - 48 | virtual void RegisterObserver(ObserverInterface* observer) = 0; - | ^~~~~~~~~~~~~~~~ -../../third_party/webrtc/api/media_stream_interface.h:49:16: note: 'virtual void webrtc::NotifierInterface::UnregisterObserver(webrtc::ObserverInterface*)' - 49 | virtual void UnregisterObserver(ObserverInterface* observer) = 0; - | ^~~~~~~~~~~~~~~~~~ - -diff --git a/third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h b/third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h -index 54cb7d1..0d6c40f 100644 ---- a/third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h -+++ b/third_party/blink/renderer/modules/peerconnection/adapters/web_rtc_cross_thread_copier.h -@@ -165,8 +165,9 @@ struct CrossThreadCopier - }; - - template <> --struct CrossThreadCopier -- : public CrossThreadCopierPassThrough { -+struct CrossThreadCopier> -+ : public CrossThreadCopierPassThrough< -+ rtc::scoped_refptr> { - STATIC_ONLY(CrossThreadCopier); - }; - diff --git a/www-client/chromium/files/chromium-80-gcc-incomplete-type.patch b/www-client/chromium/files/chromium-80-gcc-incomplete-type.patch deleted file mode 100644 index 8d10620a7170..000000000000 --- a/www-client/chromium/files/chromium-80-gcc-incomplete-type.patch +++ /dev/null @@ -1,229 +0,0 @@ -From cdf3e81ff49b200213d67d65558f2919222b60ab Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa -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, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>' requested here - : std::aligned_storage - ^ -/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, 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, 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, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>, true>' requested here - rebind_traits; - ^ -/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, 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::pair, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode>, std::allocator, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode> >, std::__detail::_Select1st, std::equal_to >, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__deta -il::_Hashtable_traits >' requested here - _Hashtable _M_h; - ^ -../../components/sync_bookmarks/bookmark_model_merger.h:146:22: note: in instantiation of template class 'std::unordered_map, sync_bookmarks::BookmarkModelMerger::RemoteTreeNode, std::hash, std::equal_to >, std::allocator, 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 -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 -Reviewed-by: Mikel Astiz -Auto-Submit: Raphael Kubo da Costa -Cr-Commit-Position: refs/heads/master@{#725070} ---- - -diff --git a/components/sync_bookmarks/bookmark_model_merger.cc b/components/sync_bookmarks/bookmark_model_merger.cc -index eae153ef..579848e 100644 ---- a/components/sync_bookmarks/bookmark_model_merger.cc -+++ b/components/sync_bookmarks/bookmark_model_merger.cc -@@ -5,7 +5,6 @@ - #include "components/sync_bookmarks/bookmark_model_merger.h" - - #include --#include - #include - #include - #include -@@ -205,66 +204,44 @@ - - } // 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 update, -- UpdatesPerParentId* updates_per_parent_id); -+BookmarkModelMerger::RemoteTreeNode::RemoteTreeNode() = default; - -- ~RemoteTreeNode() = default; -+BookmarkModelMerger::RemoteTreeNode::~RemoteTreeNode() = default; - -- // Allow moves, useful during construction. -- RemoteTreeNode(RemoteTreeNode&&) = default; -- RemoteTreeNode& operator=(RemoteTreeNode&&) = default; -+BookmarkModelMerger::RemoteTreeNode::RemoteTreeNode( -+ BookmarkModelMerger::RemoteTreeNode&&) = default; -+BookmarkModelMerger::RemoteTreeNode& BookmarkModelMerger::RemoteTreeNode:: -+operator=(BookmarkModelMerger::RemoteTreeNode&&) = default; - -- const syncer::EntityData& entity() const { return *update_->entity; } -- int64_t response_version() const { return update_->response_version; } -+void BookmarkModelMerger::RemoteTreeNode::EmplaceSelfAndDescendantsByGUID( -+ std::unordered_map* -+ guid_to_remote_node_map) const { -+ DCHECK(guid_to_remote_node_map); - -- // Direct children nodes, sorted by ascending unique position. These are -- // guaranteed to be valid updates (e.g. IsValidBookmarkSpecifics()). -- const std::vector& children() const { return children_; } -+ const std::string& guid = entity().specifics.bookmark().guid(); -+ if (!guid.empty()) { -+ DCHECK(base::IsValidGUID(guid)); - -- // Recursively emplaces all GUIDs (this node and descendants) into -- // |*guid_to_remote_node_map|, which must not be null. -- void EmplaceSelfAndDescendantsByGUID( -- std::unordered_map* -- 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); -- } -- -- for (const RemoteTreeNode& child : children_) { -- child.EmplaceSelfAndDescendantsByGUID(guid_to_remote_node_map); -- } -+ // Duplicate GUIDs have been sorted out before. -+ bool success = guid_to_remote_node_map->emplace(guid, this).second; -+ DCHECK(success); - } - -- 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); -+ for (const RemoteTreeNode& child : children_) { -+ child.EmplaceSelfAndDescendantsByGUID(guid_to_remote_node_map); - } -+} - -- RemoteTreeNode() = default; -- -- std::unique_ptr update_; -- std::vector 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 9b59200..bf0783ec 100644 ---- a/components/sync_bookmarks/bookmark_model_merger.h -+++ b/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 - #include - #include - #include -@@ -50,7 +51,52 @@ - - private: - // Internal representation of a remote tree, composed of nodes. -- class RemoteTreeNode; -+ class RemoteTreeNode final { -+ private: -+ using UpdatesPerParentId = -+ std::unordered_map; -+ -+ 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 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& 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* -+ guid_to_remote_node_map) const; -+ -+ private: -+ static bool UniquePositionLessThan(const RemoteTreeNode& lhs, -+ const RemoteTreeNode& rhs); -+ -+ RemoteTreeNode(); -+ -+ std::unique_ptr update_; -+ std::vector 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/www-client/chromium/files/chromium-80-gcc-permissive.patch b/www-client/chromium/files/chromium-80-gcc-permissive.patch deleted file mode 100644 index c7aef49add12..000000000000 --- a/www-client/chromium/files/chromium-80-gcc-permissive.patch +++ /dev/null @@ -1,33 +0,0 @@ -In file included from ../../media/base/media_log_properties.h:13, - from ../../media/base/media_log.h:23, - from ../../media/filters/frame_processor.h:15, - from ../../media/filters/frame_processor.cc:5: -../../media/base/media_log_properties_helper.h:86:8: error: extra qualification not allowed [-fpermissive] - 86 | struct internal::MediaLogPropertyTypeConverter { - | ^~~~~~~~ -../../media/base/media_log_properties_helper.h:86:75: error: explicit specialization of non-template 'media::internal::' - 86 | struct internal::MediaLogPropertyTypeConverter { - | ^ - -diff --git a/media/base/media_log_properties_helper.h b/media/base/media_log_properties_helper.h -index 95ff70a..549b003 100644 ---- a/media/base/media_log_properties_helper.h -+++ b/media/base/media_log_properties_helper.h -@@ -83,7 +83,7 @@ struct MediaLogPropertyTypeConverter> { - - // Specializer for sending AudioDecoderConfigs to the media tab in devtools. - template <> --struct internal::MediaLogPropertyTypeConverter { -+struct MediaLogPropertyTypeConverter { - static base::Value Convert(const AudioDecoderConfig& value) { - base::Value result(base::Value::Type::DICTIONARY); - result.SetStringKey("codec", GetCodecName(value.codec())); -@@ -114,7 +114,7 @@ struct internal::MediaLogPropertyTypeConverter { - - // Specializer for sending VideoDecoderConfigs to the media tab in devtools. - template <> --struct internal::MediaLogPropertyTypeConverter { -+struct MediaLogPropertyTypeConverter { - static base::Value Convert(const VideoDecoderConfig& value) { - base::Value result(base::Value::Type::DICTIONARY); - result.SetStringKey("codec", GetCodecName(value.codec())); diff --git a/www-client/chromium/files/chromium-80-include.patch b/www-client/chromium/files/chromium-80-include.patch deleted file mode 100644 index dd85de7249c4..000000000000 --- a/www-client/chromium/files/chromium-80-include.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8273f4d3130e06fd8b6bef87b07c936304b971d9 Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa -Date: Tue, 10 Dec 2019 20:59:57 +0000 -Subject: [PATCH] [cros search service]: Include 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 -Reviewed-by: Jia Meng -Commit-Queue: Raphael Kubo da Costa -Cr-Commit-Position: refs/heads/master@{#723499} ---- - -diff --git a/chrome/common/string_matching/fuzzy_tokenized_string_match.cc b/chrome/common/string_matching/fuzzy_tokenized_string_match.cc -index 8351fa7..884ef63 100644 ---- a/chrome/common/string_matching/fuzzy_tokenized_string_match.cc -+++ b/chrome/common/string_matching/fuzzy_tokenized_string_match.cc -@@ -5,6 +5,7 @@ - #include "chrome/common/string_matching/fuzzy_tokenized_string_match.h" - - #include -+#include - #include - - #include "base/i18n/case_conversion.h" diff --git a/www-client/chromium/files/chromium-80-unbundle-libxml.patch b/www-client/chromium/files/chromium-80-unbundle-libxml.patch deleted file mode 100644 index 0f369052cde2..000000000000 --- a/www-client/chromium/files/chromium-80-unbundle-libxml.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff --git a/build/linux/unbundle/libxml.gn b/build/linux/unbundle/libxml.gn -index c481bd3..3aaa1a4 100644 ---- a/build/linux/unbundle/libxml.gn -+++ b/build/linux/unbundle/libxml.gn -@@ -8,11 +8,52 @@ 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 a/third_party/libxml/chromium/libxml_utils.h b/third_party/libxml/chromium/libxml_utils.h -index ff969fa..e0f3ecd 100644 ---- a/third_party/libxml/chromium/libxml_utils.h -+++ b/third_party/libxml/chromium/libxml_utils.h -@@ -6,8 +6,7 @@ - #define THIRD_PARTY_LIBXML_CHROMIUM_LIBXML_UTILS_H_ - - #include -- --#include "third_party/libxml/src/include/libxml/xmlreader.h" -+#include - - // libxml uses a global error function pointer for reporting errors. - // A ScopedXmlErrorFunc object lets you change the global error pointer -diff --git a/third_party/libxml/chromium/xml_reader.cc b/third_party/libxml/chromium/xml_reader.cc -index 92464f4..4779290 100644 ---- a/third_party/libxml/chromium/xml_reader.cc -+++ b/third_party/libxml/chromium/xml_reader.cc -@@ -7,7 +7,8 @@ - #include - - #include "third_party/libxml/chromium/libxml_utils.h" --#include "third_party/libxml/src/include/libxml/xmlreader.h" -+ -+#include - - using internal::XmlStringToStdString; - -diff --git a/third_party/libxml/chromium/xml_writer.cc b/third_party/libxml/chromium/xml_writer.cc -index 51fce8e..aa3a34f 100644 ---- a/third_party/libxml/chromium/xml_writer.cc -+++ b/third_party/libxml/chromium/xml_writer.cc -@@ -5,7 +5,8 @@ - #include "third_party/libxml/chromium/xml_writer.h" - - #include "third_party/libxml/chromium/libxml_utils.h" --#include "third_party/libxml/src/include/libxml/xmlwriter.h" -+ -+#include - - XmlWriter::XmlWriter() : writer_(nullptr), buffer_(nullptr) {} - diff --git a/www-client/chromium/files/chromium-compiler-r10.patch b/www-client/chromium/files/chromium-compiler-r10.patch deleted file mode 100644 index f2ecdc3f32b4..000000000000 --- a/www-client/chromium/files/chromium-compiler-r10.patch +++ /dev/null @@ -1,185 +0,0 @@ -From a1207cc75454e653030716948d27ec27412f6fe8 Mon Sep 17 00:00:00 2001 -From: Mike Gilbert -Date: Sat, 16 Jun 2019 15:43:27 +0100 -Subject: [PATCH] Disable various compiler configs - ---- - build/config/compiler/BUILD.gn | 64 +++++++++++++--------------------- - 1 file changed, 25 insertions(+), 39 deletions(-) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index a3f21b7..0a7bec6 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -230,8 +230,6 @@ config("compiler") { - - configs += [ - # See the definitions below. -- ":clang_revision", -- ":compiler_cpu_abi", - ":compiler_codegen", - ":compiler_deterministic", - ] -@@ -471,20 +469,6 @@ config("compiler") { - } - } - -- if (is_clang && !is_nacl && !use_xcode_clang) { -- cflags += [ "-fcrash-diagnostics-dir=" + -- rebase_path("//tools/clang/crashreports", root_build_dir) ] -- -- cflags += [ -- # TODO(hans): Remove this once Clang generates better optimized debug info -- # by default. https://crbug.com/765793 -- "-Xclang", -- "-mllvm", -- "-Xclang", -- "-instcombine-lower-dbg-declare=0", -- ] -- } -- - # C11/C++11 compiler flags setup. - # --------------------------- - if (is_linux || is_android || (is_nacl && is_clang) || current_os == "aix") { -@@ -1431,6 +1415,12 @@ config("default_warnings") { - "-Wno-narrowing", - ] - -+ # -Wno-class-memaccess warns about hash table and vector in blink. -+ # But the violation is intentional. -+ if (!is_nacl) { -+ cflags_cc += [ "-Wno-class-memaccess" ] -+ } -+ - # -Wunused-local-typedefs is broken in gcc, - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872 - cflags += [ "-Wno-unused-local-typedefs" ] -@@ -1525,7 +1515,7 @@ config("chromium_code") { - defines = [ "_HAS_NODISCARD" ] - } - } else { -- cflags = [ "-Wall" ] -+ cflags = [] - if (treat_warnings_as_errors) { - cflags += [ "-Werror" ] - -@@ -1534,10 +1524,6 @@ config("chromium_code") { - # well. - ldflags = [ "-Werror" ] - } -- if (is_clang) { -- # Enable extra warnings for chromium_code when we control the compiler. -- cflags += [ "-Wextra" ] -- } - - # In Chromium code, we define __STDC_foo_MACROS in order to get the - # C99 macros on Mac and Linux. -@@ -1546,15 +1532,6 @@ config("chromium_code") { - "__STDC_FORMAT_MACROS", - ] - -- if (!is_debug && !using_sanitizer && current_cpu != "s390x" && -- current_cpu != "s390" && current_cpu != "ppc64" && -- current_cpu != "mips" && current_cpu != "mips64") { -- # Non-chromium code is not guaranteed to compile cleanly with -- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are -- # disabled, so only do that for Release build. -- defines += [ "_FORTIFY_SOURCE=2" ] -- } -- - if (is_mac) { - cflags_objc = [ "-Wobjc-missing-property-synthesis" ] - cflags_objcc = [ "-Wobjc-missing-property-synthesis" ] -@@ -1943,7 +1920,8 @@ config("default_stack_frames") { - } - - # Default "optimization on" config. --config("optimize") { -+config("optimize") { } -+config("xoptimize") { - if (is_win) { - # TODO(thakis): Remove is_clang here, https://crbug.com/598772 - if (is_official_build && full_wpo_on_official && !is_clang) { -@@ -1977,7 +1955,8 @@ config("optimize") { - } - - # Same config as 'optimize' but without the WPO flag. --config("optimize_no_wpo") { -+config("optimize_no_wpo") { } -+config("xoptimize_no_wpo") { - if (is_win) { - # Favor size over speed, /O1 must be before the common flags. The GYP - # build also specifies /Os and /GF but these are implied by /O1. -@@ -2000,7 +1979,8 @@ config("optimize_no_wpo") { - } - - # Turn off optimizations. --config("no_optimize") { -+config("no_optimize") { } -+config("xno_optimize") { - if (is_win) { - cflags = [ - "/Od", # Disable optimization. -@@ -2028,7 +2008,8 @@ config("no_optimize") { - # Turns up the optimization level. On Windows, this implies whole program - # optimization and link-time code generation which is very expensive and should - # be used sparingly. --config("optimize_max") { -+config("optimize_max") { } -+config("xoptimize_max") { - if (is_nacl && is_nacl_irt) { - # The NaCl IRT is a special case and always wants its own config. - # Various components do: -@@ -2075,7 +2056,8 @@ config("optimize_max") { - # - # TODO(crbug.com/621335) - rework how all of these configs are related - # so that we don't need this disclaimer. --config("optimize_speed") { -+config("optimize_speed") { } -+config("xoptimize_speed") { - if (is_nacl && is_nacl_irt) { - # The NaCl IRT is a special case and always wants its own config. - # Various components do: -@@ -2113,7 +2095,8 @@ config("optimize_speed") { - } - } - --config("optimize_fuzzing") { -+config("optimize_fuzzing") { } -+config("xoptimize_fuzzing") { - cflags = [ "-O1" ] + common_optimize_on_cflags - ldflags = common_optimize_on_ldflags - visibility = [ ":default_optimization" ] -@@ -2215,7 +2198,8 @@ config("win_pdbaltpath") { - } - - # Full symbols. --config("symbols") { -+config("symbols") { } -+config("xsymbols") { - if (is_win) { - if (use_goma || is_clang) { - # Note that with VC++ this requires is_win_fastlink, enforced elsewhere. -@@ -2325,7 +2309,8 @@ config("symbols") { - # Minimal symbols. - # This config guarantees to hold symbol for stack trace which are shown to user - # when crash happens in unittests running on buildbot. --config("minimal_symbols") { -+config("minimal_symbols") { } -+config("xminimal_symbols") { - if (is_win) { - # Linker symbols for backtraces only. - cflags = [] -@@ -2382,7 +2367,8 @@ config("minimal_symbols") { - } - - # No symbols. --config("no_symbols") { -+config("no_symbols") { } -+config("xno_symbols") { - if (!is_win) { - cflags = [ "-g0" ] - asmflags = cflags --- -2.21.0 - diff --git a/www-client/chromium/files/chromium-unbundle-zlib-r1.patch b/www-client/chromium/files/chromium-unbundle-zlib-r1.patch deleted file mode 100644 index 951a2adb196a..000000000000 --- a/www-client/chromium/files/chromium-unbundle-zlib-r1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn -index 3bc618a..e0ddf6d 100644 ---- a/third_party/perfetto/gn/BUILD.gn -+++ b/third_party/perfetto/gn/BUILD.gn -@@ -244,7 +244,7 @@ if (enable_perfetto_trace_processor || perfetto_build_standalone || - "//buildtools:zlib", - ] - } else { -- public_configs = [ "//third_party/zlib:zlib_config" ] -+ public_configs = [ "//third_party/zlib:system_zlib" ] - public_deps = [ - "//third_party/zlib", - ] -- 2.26.2